/* ---------- The gate, TV pairing, Kim izliyor? and the PIN (js/profiles.js); tokens from app.css :root ---------- */
.gate { width: min(380px, 90vw); display: grid; gap: 10px; }
.gate p { color: var(--muted); margin: 0 0 8px; }
.gate .btn { justify-content: center; margin-top: 6px; }
/* Pairing by phone: how, the code read from across the room, that the screen opens by itself, and the
   QR code beside it (a TV) or under it (a phone or a computer too old for the sign-in page). */
.gate.pair { width: min(560px, 90vw); grid-template-columns: minmax(0, 1fr); justify-items: center; }
.pair-main { display: grid; gap: 10px; justify-items: center; }
.pair-main .brand-mark { margin-bottom: 18px; }
/* The signed-out gate draws in the text face alone (one font file there), its heading too. */
.center-screen .pair-title { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.pair-code { margin: 8px 0 4px; font-family: "Newsreader Digits", var(--sans); font-size: clamp(2.6rem, 8vw, 4.5rem); font-weight: 500; letter-spacing: .06em; line-height: 1.1; color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.gate p.pair-code { color: var(--ink); }
.gate p.pair-code.waiting { color: var(--muted); opacity: .5; }
.gate p.pair-self { color: var(--ink); margin: 0; }
.gate p.pair-valid { margin: 0; }
.gate p.pair-wait { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; color: var(--ink-2); font-weight: 600; }
.pair-wait::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.gate.pair .msg { margin: 0; }
.gate.pair .row-btns { justify-content: center; margin-top: 8px; }
.pair-side { display: grid; justify-items: center; }
/* A TV: two columns inside the overscan box, the words on the left (130 px code), the QR code right. */
html.tv .pairing { place-content: center stretch; padding: 54px 106px; text-align: left; }
html.tv .gate.pair { width: auto; grid-template-columns: minmax(0, 1fr) auto; column-gap: 96px; align-items: center; justify-items: stretch; }
html.tv .pair-main { justify-items: start; gap: 18px; }
html.tv .pair-main .brand-mark { margin-bottom: 20px; font-size: 2.2rem; }
html.tv .center-screen .pair-title { font-size: var(--fs-title); letter-spacing: -.02em; }
html.tv .gate p { font-size: var(--fs-body); line-height: 1.4; max-width: 30em; }
html.tv .gate p.pair-code { margin: 6px 0 2px; font-size: 130px; line-height: 1; letter-spacing: .04em; }
html.tv .gate p.pair-valid, html.tv .gate p.pair-wait { font-size: var(--fs-detail); }
html.tv .gate.pair .row-btns { justify-content: flex-start; }
html.tv .pair-qr { width: 360px; border-radius: var(--r2); }
/* Kim izliyor? (round 4 S6): the greeting (or Kim izliyor?), why the focused profile is the one, the
   faces with their names and a second line, and on a TV the OK line; centred on every screen. */
.who h1 { font-size: var(--fs-title); }
.who-why { margin: -12px 0 0; max-width: 46em; color: var(--ink-2); font-size: var(--fs-body); line-height: 1.4; }
.profiles { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; justify-content: center; }
.profile { display: grid; gap: 10px; justify-items: center; align-content: start; color: var(--muted); font-size: 1.1rem; padding: 8px; border-radius: 14px; transition: color .15s, transform 200ms var(--ease-out); }
.profile img { width: clamp(96px, 12vw, 160px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
/* The kid's face keeps a brighter ring of its own: the one he looks for. Same size as everyone's. */
.profile.kid img { border: 5px solid rgba(255, 246, 214, .72); }
.profile-name { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; color: var(--ink); white-space: nowrap; }
.profile-sub { min-height: 1.4em; font-size: var(--fs-detail); line-height: 1.4; color: var(--ink-2); white-space: nowrap; }
.profile:focus-visible { color: var(--ink); transform: scale(1.05); box-shadow: none; }
.profile:focus-visible img { box-shadow: var(--focus-art); }   /* the picture lights up, like a card */
.who-foot { display: grid; gap: 6px; justify-items: center; }
.who-foot p { margin: 0; }
.who-go { font-size: var(--fs-body); font-weight: 700; color: var(--ink); }
.who-go kbd { margin-right: .25em; padding: 0 .3em; border-radius: var(--r1); font-size: .8em; vertical-align: .08em; }
.who-soft { font-size: var(--fs-detail); color: var(--ink-2); }
/* Opening by itself (access.js wakeChoice): the bar empties a step a second, one 200 ms transform each. */
.who-timer { width: 360px; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.who-timer i { display: block; height: 100%; background: var(--ink-2); transform-origin: 0 50%; transition: transform 200ms linear; }
html.tv .who { gap: 36px; }
html.tv .who h1 { font-size: var(--fs-cover); }
html.tv .who-why { margin-top: -20px; }
html.tv .profiles { gap: 56px; }
html.tv .profile { gap: 14px; padding: 12px; }
html.tv .profile img { width: 200px; height: 200px; }
html.tv .profile.kid img { border-width: 6px; }
html.tv .profile-name { font-size: 42px; }
@media (max-width: 720px) {
  html:not(.tv) .who { place-content: center stretch; justify-items: stretch; text-align: left; }
  html:not(.tv) .who .brand-mark { justify-self: start; }
  html:not(.tv) .who-why { margin-top: -16px; }
  /* A phone lists them: face, name, second line, one row each, the whole row the target. */
  html:not(.tv) .who .profiles { display: grid; gap: 10px; justify-content: stretch; }
  html:not(.tv) .who .profile { grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 2px; justify-items: start; align-items: center;
    padding: 12px 14px; background: var(--panel-1); text-align: left; }
  html:not(.tv) .who .profile img { grid-row: 1 / span 2; width: 72px; height: 72px; }
  html:not(.tv) .who .profile-name { align-self: end; font-size: 1.45rem; }
  html:not(.tv) .who .profile-sub { align-self: start; min-height: 0; }
  html:not(.tv) .who .profile:focus-visible, html:not(.tv) .who .profile.chosen { transform: none; box-shadow: var(--focus); }
  html:not(.tv) .who .profile:focus-visible img, html:not(.tv) .who .profile.chosen img { box-shadow: none; }
  html:not(.tv) .who .profile.sel { box-shadow: inset 0 0 0 2px var(--ink-2); }
}
/* The PIN (js/profiles.js askPin): native <dialog> (modal, inert background, Escape closes), boxes
   that fill and a pad; the remote's and a keyboard's digits type. Two columns where there is room. */
.pin-dialog { width: min(760px, 94vw); margin: auto; border: 0; color: var(--ink); background: var(--panel-1); border-radius: var(--r3); padding: 36px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 48px; align-items: center; }
/* The scrim: black .85, never blurred, on every device (docs/design-language.md, materials). A blur
   behind it cost a TV 184 ms a key and showed nobody anything. */
.pin-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.pin-who { display: grid; gap: 12px; justify-items: start; }
.pin-who h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: var(--fs-row); line-height: 1.15; }
.pin-who p { margin: 0; }
.pin-ask { font-size: var(--fs-body); }
.pin-boxes { display: flex; gap: 10px; margin: 8px 0 4px; }
.pin-box { position: relative; width: 48px; height: 60px; border-radius: var(--r2); background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); }
.pin-box.next { box-shadow: inset 0 0 0 2px var(--line), inset 0 -4px 0 var(--ink-2); }
.pin-box.on::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); }
.pin-dialog .msg { margin: 0; min-height: 1.4em; }
.pin-dialog:focus, .pin-dialog:focus-visible { outline: none; box-shadow: none; }
.pin-hint { color: var(--ink-2); font-size: var(--fs-detail); line-height: 1.4; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pin-key { height: 60px; border-radius: var(--r2); background: var(--panel-2); font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1; color: var(--ink); }
.pin-key.word { font-family: var(--sans); font-weight: 600; font-size: var(--fs-detail); color: var(--ink-2); }
.pin-key:focus-visible { background: var(--panel-3); }
.pin-dialog.busy .pin-pad { opacity: .5; }
.modal-avatar { width: 88px; height: 88px; border-radius: 50%; }
html.tv .pin-dialog { width: 1180px; max-width: none; padding: 64px 72px; column-gap: 80px; }
html.tv .pin-who { gap: 16px; }
html.tv .pin-who h2 { font-size: var(--fs-title); }
html.tv .modal-avatar { width: 120px; height: 120px; }
html.tv .pin-boxes { gap: 14px; margin: 12px 0 6px; }
html.tv .pin-box { width: 72px; height: 88px; }
html.tv .pin-box.on::after { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
html.tv .pin-pad { grid-template-columns: repeat(3, 112px); gap: 14px; }
html.tv .pin-key { height: 88px; font-size: 44px; }
html.tv .pin-key.word { font-size: 28px; }
/* The remote's light on a key is the cream fill (like Ara's keyboard), never a ring. */
html.tv .pin-key:focus { background: var(--focus-c); color: var(--ink-inv); box-shadow: none; }
@media (max-width: 720px) {
  .pin-dialog { grid-template-columns: minmax(0, 1fr); row-gap: 24px; padding: 28px 22px; }
  .pin-who { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .pin-boxes { justify-self: stretch; justify-content: center; width: 100%; }
  .pin-box { flex: 0 1 48px; min-width: 0; }
  .pin-pad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pin-key { height: 56px; }
}
@media (hover: hover) {
  .profile:hover { color: var(--ink); transform: scale(1.05); }
  .pin-key:hover { background: var(--panel-3); }
}
@supports not (aspect-ratio: 1) {
  .profile img { height: clamp(96px, 12vw, 160px); }
}
@media (prefers-reduced-motion: reduce) { .profile:hover, .profile:focus-visible { transform: none; } }
/* A profile answers the press that picks it (app.js): the chosen one holds its lift and light, the
   others step back, and further picks are ignored until the app opens. Opacity only on a TV. */
.profile.chosen { color: var(--ink); transform: scale(1.05); }
.profile.chosen img { box-shadow: var(--focus-art); }
.picking .profile:not(.chosen) { opacity: .35; transition: opacity 150ms var(--ease-out); }
html.tv .picking .profile:not(.chosen) { transition: opacity 120ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .profile.chosen { transform: none; } }
.pair-qr { justify-self: center; width: clamp(160px, 22vh, 240px); height: auto; border-radius: 8px; image-rendering: pixelated; }   /* square: the canvas is */
.pair-qr.waiting { opacity: .2; }
