html:has(body.kiosk) {
  background: #050508;
  color-scheme: dark;
}

body.kiosk {
  background-color: #050508;
  background-image:
    radial-gradient(ellipse 90% 55% at 15% -5%, rgba(93, 186, 80, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 25%, rgba(94, 232, 255, 0.05), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(1, 96, 56, 0.12), transparent 55%);
  color: #f7f7fa;
  color-scheme: dark;
  font-family: "Nexa", "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.35;
  scrollbar-color: #2a2a32 #050508;
}

body.kiosk * { scrollbar-color: #2a2a32 #050508; }

body.kiosk ::selection {
  background: rgba(93, 186, 80, 0.4);
  color: #ffffff;
}

body.kiosk :focus-visible {
  outline: 3px solid #5ee8ff;
  outline-offset: 3px;
}

.frame {
  width: min(100% - 2.5rem, 42rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0 0.85rem;
}

.frame > .credit {
  position: static;
  z-index: auto;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 0.85rem;
}

.mast {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0 0.35rem;
}

.mast::after {
  content: "";
  width: 4rem;
  height: 4px;
  margin-top: 0.8rem;
  border-radius: 999px;
  background: #5dba50;
  box-shadow:
    0 0 10px rgba(93, 186, 80, 0.55),
    0 0 22px rgba(93, 186, 80, 0.2);
}

.logo {
  display: block;
  width: min(17.5rem, 72vw);
  height: auto;
  margin-inline: auto;
}

.is-quiz .logo,
.is-score .logo { width: min(10.5rem, 46vw); }

#stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: stage-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.is-quiz #stage {
  justify-content: flex-start;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.stand,
.progress,
.prompt,
.verdict,
.score-title,
.score-line,
.score-read {
  text-align: center;
}

.stand {
  margin: 0 0 1.4rem;
  color: #f7f7fa;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.progress {
  margin: 0 0 0.7rem;
  color: #c8c8d0;
  font-size: 1.15rem;
}

.prompt {
  margin: 0 0 1.15rem;
  font-weight: 700;
  font-size: clamp(1.85rem, 4.2vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  text-wrap: balance;
}

.verdict {
  margin: -0.35rem 0 0.9rem;
  color: #c8c8d0;
  font-weight: 700;
  font-size: 1.35rem;
}

.verdict.is-hit { color: #5dba50; }
.verdict.is-miss { color: #ffb4b4; }

.options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.options form { margin: 0; }

.plate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 72px;
  padding: 0.9rem 1.15rem;
  border: 1px solid #2a2a32;
  border-radius: 16px;
  background: #121218;
  color: #f7f7fa;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1.25;
  text-align: left;
  transition:
    background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

button.plate { cursor: pointer; }

button.plate:hover { background: #1a1a22; }

button.plate:active { transform: scale(0.985); }

.plate-label { flex: 1; }

.plate-tag {
  flex: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.plate.is-correct {
  border-color: #5dba50;
  background: #5dba50;
  color: #061408;
}

.plate.is-wrong {
  border-color: #c62828;
  background: #c62828;
  color: #ffffff;
}

.plate.is-chosen {
  border-color: #9a9aa8;
  background: #1c1c24;
  color: #f7f7fa;
}

.plate.is-rest {
  color: #c8c8d0;
}

.action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  margin-top: 1.35rem;
  border: 0;
  border-radius: 16px;
  background: #5dba50;
  color: #061408;
  font: inherit;
  font-family: "Nexa", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(93, 186, 80, 0.35),
    0 0 36px rgba(93, 186, 80, 0.12);
  transition:
    background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.action:hover,
.action:active {
  background: #72d066;
  box-shadow:
    0 0 24px rgba(93, 186, 80, 0.5),
    0 0 48px rgba(94, 232, 255, 0.15);
}

.action:active { transform: scale(0.985); }

.quiz-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.35rem;
}

.quiz-nav form { flex: 1; margin: 0; }

.quiz-nav > .action,
.quiz-nav .action,
.quiz-nav form .action { flex: 1; margin-top: 0; }

.prompt-image,
.plate-image {
  display: block;
  width: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: #0a0a0f;
}

.prompt-image {
  max-height: min(46vh, 32rem);
  min-height: 10rem;
  margin: 0 auto 1.1rem;
  border: 1px solid #2a2a32;
}

.plate.has-image {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.plate-image {
  max-height: min(36vh, 22rem);
  min-height: 8rem;
  border-radius: 12px;
}

.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: #c8c8d0;
  font-weight: 700;
  font-size: 1.15rem;
}

.score-title {
  margin: 0 0 0.55rem;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.score-line {
  margin: 0;
  font-weight: 700;
  font-size: clamp(3.2rem, 9vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.score-hit { color: #5dba50; }

.score-read {
  margin: 0.8rem 0 0;
  color: #c8c8d0;
  font-size: 1.4rem;
}

.qr-card {
  align-self: center;
  width: fit-content;
  max-width: 100%;
  margin: 1.6rem auto 0;
  padding: 0.85rem 0.85rem 0.7rem;
  border-radius: 16px;
  background: #f7f7fa;
  color: #0a0a0f;
  text-align: center;
}

.qr-card img {
  display: block;
  width: 180px;
  height: 180px;
  margin-inline: auto;
}

.qr-card figcaption {
  margin-top: 0.4rem;
  font-size: 0.98rem;
  text-wrap: balance;
}

.stage-error,
.net-error {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #c62828;
  border-radius: 12px;
  background: #121218;
  color: #ffb4b4;
  text-align: center;
}

.net-error {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 4.5rem;
  width: min(100% - 2rem, 36rem);
  margin: 0;
  transform: translateX(-50%);
}

.idle {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 1.5rem;
  background: rgba(5, 5, 8, 0.88);
}

.idle.is-open { display: grid !important; }

.net-error[hidden] { display: none; }

.idle-card {
  width: min(100%, 36rem);
  padding: 2.4rem 1.6rem 2rem;
  border: 2px solid #5dba50;
  border-radius: 16px;
  background: #121218;
  color: #f7f7fa;
  text-align: center;
}

.idle-card [data-idle-copy] {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
  text-wrap: balance;
}

.idle-card .idle-count {
  margin: 0.7rem 0 0;
  color: #5dba50;
  font-weight: 700;
  font-size: clamp(5.5rem, 18vw, 8rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

button,
a.action,
.plate { touch-action: manipulation; }

@media (max-width: 720px) {
  .frame { width: min(100% - 1.5rem, 42rem); }
  .plate { font-size: 1.2rem; }
}
