/* Shop tablet, KMG Fence Design 2.0 (tokens, fonts: /assets/kmg.css). Built for an 11" tablet mounted upright:
   navy header with the white logo and a big clock, the crew as one full-height list of names, a large keypad. */
:root {
  --bg: var(--gray-50);
  --panel: var(--kmg-navy);
  --tile: #fff;
  --tile-hi: var(--kmg-orange-50);
  --ink: var(--kmg-navy);
  --quiet: var(--gray-500);
  --in: var(--success);
  --out: var(--kmg-navy);
  --warn: var(--warning);
  --bad: var(--danger);
  --radius-k: 8px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 400 18px/1.35 var(--font-body); user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

/* Header: navy, white lockup, clock, language + status */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; background: var(--panel); color: #fff;
  border-bottom: 4px solid var(--kmg-orange); }
.brand { min-width: 150px; display: flex; align-items: center; }
.brand img { height: 52px; width: auto; display: block; pointer-events: none; }
.now { text-align: center; }
.clock { font: 800 60px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: #fff; }
.date { color: rgba(255, 255, 255, .72); margin-top: 6px; font-size: 18px; }
.side { min-width: 150px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lang { background: rgba(255, 255, 255, .1); color: #fff; padding: 10px 16px; border-radius: var(--radius); font: 600 16px var(--font-display);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); }
.net { font-size: 15px; color: rgba(255, 255, 255, .72); text-align: right; }
.net.off { color: var(--kmg-orange); font-weight: 700; }
.power { font-size: 15px; font-weight: 700; color: var(--kmg-orange); text-align: right; max-width: 260px; }

main { flex: 1; display: flex; min-height: 0; }
.screen { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 20px 28px 16px; gap: 14px; min-height: 0; }
h1 { margin: 4px 0 0; font: 800 38px/1.15 var(--font-display); color: var(--kmg-navy); text-align: center; }
.prompt { color: var(--gray-600); font-size: 24px; margin: 0; }
.rules { color: var(--quiet); font-size: 17px; margin: 0; text-align: center; }

/* "Tap your name": the Design 2.0 eyebrow (orange bar + uppercase) */
#screen-home .prompt { align-self: flex-start; display: inline-flex; align-items: center; gap: 14px;
  font: 800 16px/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--kmg-navy); }
#screen-home .prompt::before { content: ""; width: 32px; height: 4px; background: var(--kmg-orange); flex: none; }

/* Names: one column that fills the screen, so everyone is visible without scrolling. Two columns past 12 people. */
.tiles { width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.tiles.two { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(64px, 1fr); }
.tile { position: relative; flex: 1 1 0; min-height: 64px; max-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--tile); border-radius: var(--radius-k); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--gray-100);
  padding: 0 24px 0 28px; font: 700 32px/1.1 var(--font-display); color: var(--kmg-navy); text-align: left; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: transparent; }
.tile:active { background: var(--tile-hi); transform: scale(.99); }
.tile .st { flex: none; font: 600 18px/1 var(--font-body); color: var(--quiet); }
.tile.in::before { background: var(--in); }
.tile.in .st { color: #fff; background: var(--in); padding: 8px 12px; border-radius: 999px; }
.empty { color: var(--quiet); }

/* PIN, clock in/out and done: centered top to bottom on the upright screen */
#screen-pin, #screen-done { justify-content: center; padding-bottom: 72px; position: relative; }
/* Wrong name? Big, plain way back at the top of the PIN screen (the keypad's Cancel does the same) */
.back { position: absolute; top: 20px; left: 28px; min-height: 60px; padding: 0 24px; border-radius: 999px; background: #fff;
  box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--gray-200); font: 700 22px var(--font-display); color: var(--kmg-navy); }
.back:active { background: var(--tile-hi); box-shadow: inset 0 0 0 2px var(--kmg-orange); }

/* PIN */
.dots { display: flex; gap: 24px; margin: 10px 0; }
.dots i { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--kmg-navy); }
.dots i.on { background: var(--kmg-navy); }
.dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-12px); } 75% { transform: translateX(12px); } }
.pad { display: grid; grid-template-columns: repeat(3, 200px); gap: 16px; margin-top: 12px; }
.pad button { height: 136px; border-radius: var(--radius-k); background: #fff; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--gray-200);
  font: 700 56px/1 var(--font-display); color: var(--kmg-navy); }
.pad button:active { background: var(--tile-hi); box-shadow: inset 0 0 0 2px var(--kmg-orange); }
.pad .soft { font: 600 24px var(--font-display); background: transparent; box-shadow: inset 0 0 0 2px var(--gray-200); color: var(--gray-600); }
.msg { min-height: 28px; margin: 0; color: var(--bad); font-weight: 700; font-size: 21px; text-align: center; }

/* Buttons */
.big { width: min(600px, 100%); min-height: 80px; border-radius: var(--radius-k); font: 600 24px var(--font-display); }
.big.go { background: var(--kmg-orange); color: #fff; }
.big.soft { background: transparent; color: var(--gray-600); box-shadow: inset 0 0 0 2px var(--gray-200); }
.note { max-width: 640px; background: var(--warning-50); border-left: 6px solid var(--warn); color: var(--gray-800); padding: 16px 20px;
  border-radius: var(--radius); font-size: 21px; text-align: center; }

/* Done */
.check { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; font: 800 92px/1 var(--font-display); margin-top: 0;
  background: var(--in); color: #fff; box-shadow: var(--shadow-md); }
.check.out { background: var(--kmg-navy); }
.check.warn { background: var(--warn); }
.sub { font-size: 26px; color: var(--gray-600); margin: 0; text-align: center; }

#setup-key { width: min(560px, 100%); font-size: 24px; padding: 16px; border-radius: var(--radius-k); border: 2px solid var(--gray-200); background: #fff;
  color: var(--ink); user-select: text; }

.foot { padding: 8px 28px; font-size: 13px; color: var(--gray-400); display: flex; justify-content: space-between; }

/* Screensaver: almost all black. A dim clock drifts to a new spot every 15 minutes (fades out, moves, fades in) so no
   pixels stay lit in one place: the usual guard against image retention on an LCD left on all day. */
#saver { position: fixed; inset: 0; background: #000; z-index: 50; }
#saver-box { position: absolute; left: 20px; top: 20px; text-align: center; transition: opacity 1.5s ease; }
#saver-clock { font: 800 110px/1 var(--font-display); color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
#saver-hint { color: rgba(255, 255, 255, .55); font-size: 30px; font-weight: 600; margin-top: 16px; }
#saver-power { color: rgba(255, 103, 31, .55); font-size: 20px; margin-top: 16px; max-width: 420px; }

#info { position: fixed; inset: 0; z-index: 60; background: var(--bg); padding: 28px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
#info pre { width: min(700px, 100%); background: #fff; box-shadow: inset 0 0 0 1px var(--gray-200); padding: 16px; border-radius: var(--radius-k);
  white-space: pre-wrap; font-size: 15px; user-select: text; }

/* Sideways or short screens: smaller keypad so it all fits */
@media (max-height: 900px) {
  .bar { padding: 12px 24px; }
  .brand img { height: 42px; }
  .clock { font-size: 50px; }
  .pad { grid-template-columns: repeat(3, 124px); gap: 12px; }
  .pad button { height: 82px; font-size: 36px; }
  .check { width: 130px; height: 130px; font-size: 76px; }
}
@media (max-width: 700px) {
  .clock { font-size: 40px; }
  .brand, .side { min-width: 0; }
  .brand img { height: 36px; }
  .pad { grid-template-columns: repeat(3, 92px); }
  .pad button { height: 76px; }
  .tile { font-size: 26px; }
}
