/* =============================================================================================
   Home (Student / Teacher) and the student's exam-code screen.
   Both are "kiosk" screens: a blind or low-vision student may be the first person at the laptop,
   so they use the exam's AAA colour pairs (yellow on black by default; the laptop's chosen
   exam colours via data-theme) and one huge target. Staff screens keep the Ink and paper look.
   ============================================================================================= */
.kiosk {
  --k-bg: #000; --k-fg: #FFD400; --k-strong: #FFFFFF; --k-muted: #C8C8C8; --k-line: #8A8A8A;
  --k-card: #121212; --k-go: #3DDC84; --k-warn: #FFAB00; --k-ink: #000;
  min-height: 100vh; min-height: 100dvh; box-sizing: border-box;
  display: flex; flex-direction: column; gap: clamp(14px, 2.6vh, 28px);
  padding: clamp(16px, 3vh, 36px) clamp(16px, 4vw, 56px);
  background: var(--k-bg); color: var(--k-fg);
  font-family: var(--font); line-height: 1.5;
}
.kiosk[data-theme="white"] { --k-fg: #FFFFFF; }
.kiosk[data-theme="light"] {
  --k-bg: #FFFFFF; --k-fg: #000000; --k-strong: #000000; --k-muted: #3D3D3D; --k-line: #6B6B6B;
  --k-card: #F4F4F4; --k-go: #00602F; --k-warn: #7A3E00; --k-ink: #FFFFFF;
}
body:has(> .kiosk:not([hidden])) { background: var(--k-bg, #000); }
.kiosk[hidden] { display: none; }
.kiosk :focus-visible { outline: 5px solid var(--k-strong); outline-offset: 4px; }
.kiosk .en { text-transform: uppercase; letter-spacing: .07em; font-weight: 750; }

/* ---- brand (home): mark + name, the Hindi name and tagline under it */
.k-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.k-brand .mark { flex: none; width: clamp(44px, 6vh, 60px); height: clamp(44px, 6vh, 60px); }
.k-brand .mark .seal { fill: var(--k-fg); }
.k-brand .mark .nib { fill: var(--k-bg); }
.k-brand .mark .slit { stroke: var(--k-fg); }
.k-brand .mark .hole { fill: var(--k-fg); }
.k-brand > div { min-width: 0; }
.k-brand h1 { margin: 0; white-space: nowrap; font-size: clamp(24px, 3.4vh, 36px); line-height: 1.15; font-weight: 800; color: var(--k-strong); }
.k-tag { margin: 2px 0 0; color: var(--k-muted); font-size: clamp(14px, 1.9vh, 18px); line-height: 1.35; }
.k-tag [lang="hi"] { color: var(--k-fg); font-weight: 700; }

/* ---- the one huge target (home: "I am a student"; code screen: "press, then say a digit") */
.k-big {
  all: unset; box-sizing: border-box; cursor: pointer;
  flex: 1 1 auto; min-height: 220px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: clamp(16px, 3vw, 40px); row-gap: 10px;
  align-items: center; padding: clamp(20px, 4vh, 48px) clamp(20px, 4vw, 56px);
  background: var(--k-fg); color: var(--k-ink);
  border: 6px solid var(--k-fg); border-radius: 28px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.k-big:hover { filter: brightness(1.06); }
.k-big:focus-visible { outline: 6px solid var(--k-strong); outline-offset: 6px; }
.k-big:active { transform: scale(.995); }
.k-ico { grid-row: span 2; width: clamp(72px, 12vh, 140px); height: clamp(72px, 12vh, 140px); border-radius: 50%; background: var(--k-ink); display: grid; place-items: center; }
.k-ico .ico { width: 55%; height: 55%; background: var(--k-fg); }
.k-big-t { display: flex; flex-direction: column; gap: .15em; font-size: clamp(34px, 7vh, 80px); font-weight: 800; line-height: 1.2; align-self: end; }
.k-big-t .en { font-size: .42em; letter-spacing: .1em; }
.k-big-s { font-size: clamp(16px, 2.3vh, 24px); font-weight: 650; align-self: start; }

/* home: everything centred in the target, so it reads as one calm poster */
.k-home { grid-template-columns: 1fr; grid-template-rows: none; align-content: center; justify-items: center; text-align: center; row-gap: clamp(14px, 2.6vh, 28px); }
.k-home .k-ico { grid-row: auto; }
.k-home .k-big-t { align-self: auto; align-items: center; font-size: clamp(40px, 9vh, 104px); }
.k-hint { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: clamp(16px, 2.4vh, 24px); font-weight: 650; }
.k-hint kbd { font: inherit; font-weight: 800; background: transparent; color: inherit; box-shadow: none; padding: .18em .9em; border: 3px solid var(--k-ink); border-bottom-width: 6px; border-radius: 12px; letter-spacing: .04em; }

.k-foot { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap; color: var(--k-muted); font-size: 15px; }
.k-foot > span { display: inline-flex; align-items: center; gap: 8px; }
.k-foot .ico { width: 18px; height: 18px; background: var(--k-muted); }

/* ---- exam-code screen */
.k-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-eyebrow { margin: 0; font-size: clamp(16px, 2.2vh, 22px); font-weight: 800; color: var(--k-muted); text-transform: uppercase; letter-spacing: .08em; }
.k-link { all: unset; flex: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--k-strong); font-size: 16px; font-weight: 650; padding: 10px 16px; border: 2px solid var(--k-line); border-radius: 12px; }
.k-link .ico { width: 20px; height: 20px; background: currentColor; }
.k-link:hover { color: var(--k-strong); border-color: var(--k-strong); }
.k-title { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .7em; font-size: clamp(28px, 5vh, 56px); font-weight: 800; line-height: 1.25; color: var(--k-strong); }
.k-title .en { font-size: .45em; color: var(--k-muted); }

.k-digits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 22px); max-width: 1100px; }
.k-digits li {
  aspect-ratio: 4 / 5; max-height: 22vh; display: grid; place-items: center;
  border: 5px solid var(--k-line); border-radius: 20px; background: var(--k-card);
  font-size: clamp(30px, min(11vh, 10vw), 128px); font-weight: 800; line-height: 1; color: var(--k-fg); font-variant-numeric: tabular-nums;
}
.k-digits li[data-s="filled"] { border-color: var(--k-fg); }
.k-digits li[data-s="next"] { border: 5px dashed var(--k-strong); }
.k-digits li[data-s="fix"] { border: 5px dashed var(--k-warn); color: var(--k-warn); }
.join[data-mode="listening"] .k-digits li[data-s="next"] { border-style: solid; border-color: var(--k-go); box-shadow: 0 0 0 6px color-mix(in srgb, var(--k-go) 35%, transparent); animation: k-pulse 1.1s ease-in-out infinite; }
.join[data-mode="wrong"] .k-digits li { border-color: #FF8A80; }
.join[data-mode="found"] .k-digits li { border-color: var(--k-go); }
@keyframes k-pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--k-go) 10%, transparent); } }

.k-status { margin: 0; min-height: 1.6em; font-size: clamp(20px, 3.4vh, 36px); font-weight: 650; color: var(--k-strong); }
.k-status:empty::before { content: "\00a0"; }

.k-press { min-height: 160px; }
.join[data-mode="listening"] .k-press { background: var(--k-go); border-color: var(--k-go); }
.join[data-mode="busy"] .k-press, .join[data-mode="found"] .k-press { background: var(--k-card); color: var(--k-muted); border-color: var(--k-line); cursor: default; }
.join[data-mode="busy"] .k-press .k-ico .ico, .join[data-mode="found"] .k-press .k-ico .ico { background: var(--k-muted); }

@media (max-width: 640px) {
  .k-wide { display: none; }
  .k-link { padding: 9px 12px; }
  .k-big { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .k-ico { grid-row: auto; }
  .k-digits li { border-width: 3px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .join[data-mode="listening"] .k-digits li[data-s="next"] { animation: none; }
  .k-big:active { transform: none; }
}

/* the online demo's red banner sits above the kiosk screen: keep home on one screen with it */
body:has(#banner:not([hidden])) .kiosk { min-height: calc(100vh - 44px); min-height: calc(100dvh - 44px); }
@media (max-width: 640px) { body:has(#banner:not([hidden])) .kiosk { min-height: calc(100dvh - 84px); } }
