:root {
  --bg: #0e0e0e;
  --panel: #171717;
  --line: #2a2a2a;
  --text: #f3ede2;
  --muted: #9b958b;
  --gold: #b08d57;
  --gold-soft: rgba(176, 141, 87, 0.14);
  --ok: #6f9e7d;
  --warn: #c9a24a;
  --err: #c0645a;
  font-family: 'Helvetica Neue', Helvetica, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; user-select: none; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 28px; }
.screen[hidden], [hidden] { display: none !important; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; letter-spacing: 0.02em; }
.mark { width: 34px; height: 34px; }
header { display: flex; justify-content: space-between; align-items: center; }

/* Vinculación */
#pair { justify-content: center; align-items: center; text-align: center; gap: 14px; }
#pair h1 { font-weight: 400; font-size: 30px; margin: 24px 0 0; }
#pair-form { display: flex; gap: 12px; margin-top: 12px; }
#pair-code { font-size: 28px; letter-spacing: 0.25em; text-transform: uppercase; width: 280px; padding: 14px 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; text-align: center; user-select: text; }
#pair-code:focus { outline: none; border-color: var(--gold); }
button.primary { background: var(--gold); color: #111; border: 0; border-radius: 10px; font-size: 20px; padding: 0 26px; font-weight: 500; }
.msg { min-height: 1.4em; color: var(--err); }

/* Reloj */
.clock { text-align: center; margin: 3vh 0 1vh; }
#clock-time { font-size: clamp(64px, 13vw, 128px); font-weight: 200; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
#clock-date { font-size: 20px; }

/* Captura */
.entry { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dots { display: flex; gap: 18px; margin-bottom: 10px; }
.dots i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--gold); transition: background 0.08s; }
.dots i.on { background: var(--gold); }
.hint { margin: 0 0 18px; font-size: 18px; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(88px, 128px)); gap: 14px; }
.keypad button { height: clamp(72px, 10vh, 104px); font-size: 38px; font-weight: 300; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; touch-action: manipulation; }
.keypad button:active { background: var(--gold-soft); border-color: var(--gold); }
.keypad button.ghost { font-size: 20px; color: var(--muted); background: transparent; }

footer { display: flex; gap: 10px; justify-content: center; padding-top: 12px; }
.pill { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.off { color: var(--warn); border-color: var(--warn); }
.pill.q { color: var(--gold); border-color: var(--gold); }
#camera { position: fixed; right: 18px; bottom: 18px; width: 120px; border-radius: 10px; opacity: 0.85; border: 1px solid var(--line); }

/* Resultado */
.result { position: fixed; inset: 0; background: rgba(14, 14, 14, 0.94); display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { width: min(560px, 100%); text-align: center; border: 1px solid var(--line); border-radius: 22px; padding: 40px 28px; background: var(--panel); }
.card.ok { border-color: var(--gold); }
.card.offline { border-color: var(--warn); }
.card.err { border-color: var(--err); }
.r-kind { font-size: 44px; font-weight: 500; color: var(--gold); }
.card.err .r-kind { color: var(--err); }
.card.offline .r-kind { color: var(--warn); }
.r-time { font-size: 64px; font-weight: 200; font-variant-numeric: tabular-nums; margin: 6px 0; }
.r-name { font-size: 26px; }
.r-note { color: var(--muted); font-size: 17px; margin-top: 10px; min-height: 1.2em; }
.r-alt { margin-top: 22px; }
#r-alt-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#r-alt-buttons button { font-size: 19px; padding: 14px 18px; border-radius: 12px; background: transparent; color: var(--text); border: 1px solid var(--gold); }
.bar { height: 3px; background: var(--line); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); width: 100%; transition: width linear; }
