/* Voting kiosk. Loaded after app.css, which supplies the tokens, buttons and
   inputs. Everything here is sized for a lab monitor and a child's mouse:
   one question per screen, large targets, high contrast selection. */

.kiosk-body { background: var(--bg); overflow-x: hidden; }
.kiosk { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.k-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.k-logo { height: 54px; width: auto; flex: none; }
.k-school { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.k-title { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-head-right { display: flex; align-items: center; gap: 10px; flex: none; }
.k-voter { font-size: 15px; font-weight: 700; color: var(--brand-text); background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-radius: 999px; padding: 6px 14px; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-station { font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }

/* Progress steps */
.k-steps { list-style: none; margin: 0; padding: 14px 32px 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.k-steps[hidden] { display: none; }
.k-stepitem { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-stepitem.is-current { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.k-stepitem.is-done { color: var(--brand-text); }
.k-stepdot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--border); color: var(--ink-2); }
.k-stepitem.is-current .k-stepdot { background: var(--ink); color: #fff; }
.k-stepitem.is-done .k-stepdot { background: var(--brand-deep); color: #fff; }
.k-stepdot svg { width: 14px; height: 14px; }

/* Screens */
.k-main { flex: 1; display: flex; flex-direction: column; }
.k-screen { flex: 1; display: flex; flex-direction: column; }
.k-screen[hidden] { display: none; }
.k-center { margin: auto; text-align: center; padding: 36px 24px 48px; width: 100%; }
.k-narrow { max-width: 620px; }
.k-mid { max-width: 900px; }
.k-wide { max-width: 1280px; }
.k-step { color: var(--brand-text); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.k-h2 { font-size: 40px; font-weight: 750; margin-bottom: 8px; letter-spacing: -0.02em; }
.k-lead { font-size: 20px; color: var(--ink-2); margin-bottom: 26px; }
.k-form { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; align-items: stretch; }
.k-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.k-icon { width: 96px; height: 96px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.k-icon-big { width: 128px; height: 128px; }
.k-icon-good { background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 0 0 10px var(--brand-soft-2); }
.k-icon-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.k-countdown { color: var(--muted); font-size: 15px; margin: 6px 0 20px; }
.k-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 32px; font-size: 13px; color: var(--muted); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand-deep); margin: 0 auto 16px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-xl { min-height: 68px; padding: 14px 36px; font-size: 22px; border-radius: 16px; }
.btn-next { min-width: 220px; }
.btn-cast { min-width: 280px; background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.btn-cast:hover:not(:disabled) { background: #43781a; }
.input-xl { min-height: 84px; font-size: 36px; text-align: center; font-weight: 600; border-width: 2px; border-radius: 16px; letter-spacing: .01em; }
.input-code { letter-spacing: .18em; text-transform: uppercase; font-family: var(--mono); }
.field-label { text-align: left; }

/* On-screen alphabet */
.keypad { display: flex; flex-direction: column; gap: 10px; margin: 4px auto 0; max-width: 820px; }
.keypad-row { display: flex; justify-content: center; gap: 10px; }
.key { flex: 1 1 0; max-width: 84px; min-height: 66px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 28px; font-weight: 600; cursor: pointer; box-shadow: var(--sh-1); transition: transform .05s ease, background .12s ease; }
.key:hover { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.key:active { transform: translateY(2px); background: var(--brand-soft-2); }
.key-wide { max-width: 260px; font-size: 20px; }
.key-del { color: var(--danger-text); }

/* Class and section choices */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.choice { min-height: 96px; border-radius: 20px; border: 2px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 26px; font-weight: 700; cursor: pointer; box-shadow: var(--sh-1); padding: 12px 18px; transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease; }
.choice:hover { border-color: var(--brand-deep); box-shadow: var(--sh-2); transform: translateY(-2px); }
.choice:active { transform: translateY(0); }
.choice.is-selected { border-color: var(--brand-deep); background: var(--brand-soft); }
.choice:disabled { opacity: .6; cursor: wait; transform: none; }
.choice-section { font-size: 24px; }

/* Nominee picture cards. Sized from the viewport height so the whole screen,
   cards and the Next button included, fits a 768px lab monitor without
   scrolling: a child who has tapped a face must always see Next. */
.k-screen[data-screen="vote"] .k-center { display: flex; flex-direction: column; min-height: calc(100vh - 150px); padding-top: 18px; padding-bottom: 22px; }
.k-screen[data-screen="vote"] .k-lead { margin-bottom: 14px; }
.k-screen[data-screen="vote"] .k-h2 { font-size: 34px; margin-bottom: 4px; }
.k-screen[data-screen="vote"] .k-actions { margin-top: auto; padding-top: 18px; }
.pcards { --pw: clamp(190px, calc((100vh - 470px) / 1.25), 320px); display: grid; gap: 22px; justify-content: center; margin: 0 auto; grid-template-columns: repeat(auto-fit, var(--pw)); }
.pcards-2 { grid-template-columns: repeat(2, var(--pw)); }
.pcards-3 { grid-template-columns: repeat(3, var(--pw)); }
.pcards-4 { grid-template-columns: repeat(4, var(--pw)); }
.pcard { position: relative; display: flex; flex-direction: column; text-align: center; padding: 0; overflow: hidden; background: var(--surface); border: 3px solid var(--border); border-radius: 24px; font: inherit; color: var(--ink); cursor: pointer; box-shadow: var(--sh-1); transition: border-color .12s ease, box-shadow .12s ease, transform .1s ease; }
.pcard:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); transform: translateY(-2px); }
.pcard[aria-checked="true"] { border-color: var(--brand-deep); box-shadow: 0 0 0 6px var(--brand-soft-2), var(--sh-2); }
.pcard-photo { aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.pcard-initials { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 700; background: var(--brand-soft-2); color: var(--brand-text); }
.pcard-meta { padding: 12px 12px 14px; }
.pcard-name { font-size: clamp(17px, calc(var(--pw) / 14), 22px); font-weight: 750; line-height: 1.15; }
.pcard-class { font-size: 15px; color: var(--muted); margin-top: 4px; }
.pcard-tag { font-size: 14px; color: var(--ink-2); font-style: italic; margin-top: 4px; }
.pcard-check { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: transparent; }
.pcard[aria-checked="true"] .pcard-check { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.pcard[aria-checked="true"] .pcard-meta { background: var(--brand-soft); }

/* Confirm (roll mode) */
.voter-card { display: flex; align-items: center; gap: 18px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-2); padding: 20px 24px; margin: 8px 0 24px; box-shadow: var(--sh-1); }
.voter-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft-2); color: var(--brand-text); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; flex: none; }
.voter-name { font-size: 24px; font-weight: 700; }
.voter-class { color: var(--muted); font-size: 16px; }

/* Review. Same rule as the vote screen: the whole thing, green button
   included, must fit a 768px monitor without scrolling. */
.k-screen[data-screen="review"] .k-center { display: flex; flex-direction: column; min-height: calc(100vh - 150px); padding-top: 18px; padding-bottom: 22px; }
.k-screen[data-screen="review"] .k-h2 { font-size: 34px; margin-bottom: 4px; }
.k-screen[data-screen="review"] .k-lead { margin-bottom: 12px; }
.k-screen[data-screen="review"] .k-actions { margin-top: auto; padding-top: 16px; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin: 0 auto; text-align: left; width: 100%; max-width: 640px; }
.review-who { display: flex; align-items: baseline; gap: 10px; padding: 0 6px 6px; }
.review-who-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.review-who strong { font-size: 18px; }
.review-row { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 8px 14px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.review-row:hover { border-color: var(--border-strong); }
.review-photo { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; object-position: center 15%; flex: none; }
.review-initials { width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; background: var(--brand-soft-2); color: var(--brand-text); flex: none; }
.review-text { flex: 1; min-width: 0; }
.review-pos { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.review-name { font-size: 20px; font-weight: 750; line-height: 1.15; }
.review-change { font-size: 14px; font-weight: 600; color: var(--brand-text); text-decoration: underline; }

/* Smaller screens (in case a tablet is used) */
@media (max-width: 860px) {
  .k-head { padding: 12px 16px; }
  .k-logo { height: 40px; }
  .k-title { font-size: 17px; }
  .k-voter { display: none; }
  .k-steps { padding: 10px 12px 0; gap: 2px; }
  .k-steplabel { display: none; }
  .k-stepitem { padding: 6px; }
  .k-h2 { font-size: 30px; }
  .k-lead { font-size: 17px; }
  .input-xl { min-height: 64px; font-size: 26px; }
  .key { min-height: 50px; font-size: 20px; border-radius: 10px; }
  .keypad, .keypad-row { gap: 6px; }
  .choice { min-height: 76px; font-size: 21px; }
  .pcards, .pcards-2, .pcards-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .pcard-name { font-size: 17px; }
  .btn-xl { min-height: 56px; font-size: 18px; padding: 10px 22px; }
  .btn-next, .btn-cast { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard, .choice, .key, .btn { transition: none; }
  .spinner { animation-duration: 2s; }
}
