/* ===== AI Literacy Challenge — Claymorphic Pastel ===== */

:root {
  --cream: #fff9f0;
  --cream-2: #fffdf5;
  --ink: #5a4030;
  --ink-soft: #6b5040;
  --muted: #8a6a55;
  --peach: #ffb07a;
  --peach-soft: #ffe0c4;
  --pink: #ff8fb8;
  --pink-soft: #ffd0e0;
  --mint: #6fd6a8;
  --mint-soft: #c8f0dc;
  --sky: #8ecbff;
  --sky-soft: #d6eeff;
  --lavender: #c9a8ff;
  --lavender-soft: #e8dcff;
  --gold: #ffc85a;
  --gold-soft: #ffe8b8;
  --white: #ffffff;
  --shadow: 0 10px 28px rgba(180, 120, 90, 0.16);
  --shadow-sm: 0 4px 14px rgba(180, 120, 90, 0.12);
  --shadow-inset: inset 0 2px 0 rgba(255, 255, 255, 0.88), inset 0 -3px 10px rgba(180, 120, 90, 0.07);
  --radius-panel: 22px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --display: "Fredoka", "Nunito", "Noto Sans SC", sans-serif;
  --body: "Fredoka", "Nunito", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body.clay-arena,
body.terra {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  background:
    linear-gradient(180deg, rgba(255, 253, 245, 0.78) 0%, rgba(255, 249, 240, 0.88) 100%),
    url("/assets/park/clay/island.png") center 65% / cover no-repeat,
    linear-gradient(180deg, #dff2ff 0%, #fff4e8 42%, #ffe8d4 100%);
  overflow-x: hidden;
  padding-bottom: 2rem;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ===== Hide Terraria world / chrome ===== */
.world-bg,
.ground-strip,
.ui-gem,
.ui-moss,
.ui-torch,
.vine-top,
.vine-drape,
.board-vines,
.gate-vines,
.gate-torch,
.gate-moss,
.lantern,
.panel-torch,
.board-torch,
.btn-vines,
.corner-moss {
  display: none !important;
}

/* ===== Clay surface primitives ===== */
.clay-surface,
.stone-frame,
.brick-mosaic,
.brick-panel,
.brick-inset,
.join-panel,
.join-gate,
.mascot-card,
.tips,
.room-board,
.qr-panel,
.meta-card,
.terra-panel,
.wood-panel,
.player-card,
.board-card,
.buff-card,
.q-card,
.reveal-stage,
.combo-bar,
.combo-box,
.stone-inset,
.timeline,
.player-pill,
.speech,
.speech-mini,
.toast,
.ui-frame,
.ui-frame--parchment,
.ui-frame--panel,
.ui-frame--board,
.ui-frame--banner,
.ui-frame--banner-wood,
.ui-frame--banner-stone,
.ui-frame--avatar,
.parchment-tile,
.parchment,
.dark-stone,
.stone-bar,
.reveal-cards .stone-frame,
.reveal-explain,
.podium-slot {
  border: none;
  border-image: none;
  image-rendering: auto;
}

.stone-frame,
.brick-mosaic,
.brick-panel,
.brick-inset,
.join-panel,
.join-gate,
.mascot-card,
.tips,
.room-board,
.qr-panel,
.meta-card,
.terra-panel,
.wood-panel,
.player-card,
.board-card,
.q-card,
.reveal-stage,
.combo-bar,
.combo-box,
.stone-inset,
.timeline,
.reveal-cards .stone-frame,
.reveal-explain,
.podium-slot,
.ui-frame--parchment,
.ui-frame--panel,
.ui-frame--board,
.parchment-tile {
  background: linear-gradient(180deg, var(--cream-2) 0%, var(--cream) 100%);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow), var(--shadow-inset);
  color: var(--ink);
}

.brick-inset,
.join-panel,
.parchment-tile,
.parchment,
.q-card,
.reveal-cards .parchment {
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(180, 120, 90, 0.03) 6px 7px),
    linear-gradient(180deg, var(--cream-2) 0%, #fff6ea 100%);
}

.dark-stone,
.tips.dark-stone {
  background: linear-gradient(180deg, #f5ebe0 0%, #ede0d4 100%);
  color: var(--ink);
}

.stone-bar,
.join-foot {
  background: rgba(255, 253, 245, 0.82);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.glass-panel, .tech-frame, .soft-glass { /* legacy no-op */ }

/* ===== Screens ===== */
.screen {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 100vh;
  padding: 0.85rem clamp(0.75rem, 2vw, 1.4rem) 1.1rem;
  animation: fadeIn 0.32s ease;
}
.screen.is-on { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ===== Top bars & actions ===== */
.topbar, .play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}

.brand-bot {
  border-radius: 12px;
  border: none;
  background: var(--cream-2);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.chip-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #fff8f0, #ffe8d8);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.48rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chip-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
.chip-btn.wood-danger {
  background: linear-gradient(180deg, #ffd0d8, #ffb0c0);
  color: #7a3040;
}
.chip-btn.cyan {
  background: linear-gradient(180deg, #d8eeff, #b8dcff);
  color: #3a5878;
}
.chip-btn.stone {
  background: linear-gradient(180deg, #f0e8e0, #e0d4c8);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #fff8f0, #ffe8d8);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  border-radius: 50%;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.15s ease;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.top-actions { display: flex; gap: 0.45rem; align-items: center; }

.btn-primary {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.5rem;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe898 0%, var(--gold) 48%, #f0b040 100%);
  box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.65), inset 0 -3px 0 rgba(180, 120, 40, 0.18);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.75); }
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(180, 120, 40, 0.15);
}
.btn-xl { min-width: min(340px, 80vw); font-size: 1.08rem; padding: 1rem 1.7rem; }
.btn-join { min-width: 200px; font-size: 1.05rem; }
.btn-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  font-weight: 800;
}

.wood-sign {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 253, 245, 0.92);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 700;
}
.wood-sign.compact { padding: 0.35rem 0.65rem; }
.wood-sign h1, .wood-sign strong {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  font-weight: 700;
  color: var(--ink);
}
.wood-trim::after { display: none; }

/* ===== JOIN ===== */
.pixel-sprite {
  image-rendering: auto;
  filter: drop-shadow(0 4px 8px rgba(180, 120, 90, 0.2));
}
.brand-bot.pixel-sprite {
  border: none;
  border-radius: 12px;
  background: var(--cream-2);
  box-shadow: var(--shadow-sm);
}

.join-top { max-width: 1100px; margin-left: auto; margin-right: auto; }
.join-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.join-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 3.2vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.join-gate {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1rem 1rem;
  background: rgba(255, 253, 245, 0.55);
  backdrop-filter: blur(6px);
  border-radius: calc(var(--radius-panel) + 4px);
  box-shadow: var(--shadow);
}

.join-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 1rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.join-panel {
  padding: 1.35rem 1.3rem 1.25rem;
  transition: box-shadow 0.2s ease;
  overflow: visible;
}
.join-panel.is-shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.join-panel .step h2 { color: var(--ink); }
.join-panel .hint-line { color: var(--muted); }

.step {
  margin-bottom: 1.15rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.step.is-active {
  border-color: rgba(255, 176, 122, 0.55);
  background: rgba(255, 224, 196, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 122, 0.25);
}
.step.is-done {
  border-color: rgba(111, 214, 168, 0.5);
  background: rgba(200, 240, 220, 0.35);
}
.step.is-done .step-num { background: linear-gradient(180deg, var(--mint), #4ec890); }
.step h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.step-num {
  min-width: 28px;
  height: 28px;
  padding: 0 0.2rem;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--peach), #f09860);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.step-status { margin: 0.45rem 0 0; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.step.is-done .step-status { color: #3a9870; }
.step.is-active .step-status { color: #c07030; }

.pin-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.pin-box {
  width: 52px;
  height: 58px;
  text-align: center;
  border: 0;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #fff8f0 0%, #f0e4d8 100%);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.pin-box.has-val {
  background: linear-gradient(180deg, #fff4d8, var(--gold-soft));
  color: var(--ink);
}
.pin-box.is-flash { animation: pinFlash 0.35s ease; }

@keyframes pinFlash {
  0% { transform: translateY(-4px); box-shadow: 0 0 0 3px rgba(255, 200, 90, 0.45), var(--shadow-sm); }
  100% { transform: none; }
}

.pin-box::placeholder { color: var(--muted); font-weight: 600; }
.pin-box:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 176, 122, 0.55), var(--shadow-sm), var(--shadow-inset);
}

.hint-line { margin: 0.5rem 0 0; font-size: 0.86rem; }
.linkish {
  appearance: none;
  border: none;
  background: none;
  color: var(--peach);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { color: #f09860; }

.nick-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.65);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-inset), inset 0 0 0 1px rgba(180, 120, 90, 0.12);
}
.nick-field.is-ok { box-shadow: 0 0 0 2px rgba(111, 214, 168, 0.45), var(--shadow-inset); }
.nick-ico { color: var(--muted); }
.nick-field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.8rem 0.2rem;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
}
.nick-field input::placeholder { color: var(--muted); }
.nick-field input:focus { outline: none; }
.nick-count { font-size: 0.72rem; color: var(--muted); font-weight: 700; min-width: 2.4rem; text-align: right; }

.identity-stage {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.avatar-preview,
.identity-stage .avatar-preview.ui-frame--avatar {
  width: min(176px, 46vw);
  aspect-ratio: 1;
  padding: 0;
  background: linear-gradient(160deg, var(--sky-soft), var(--cream-2));
  border: 0;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow), var(--shadow-inset);
  overflow: hidden;
}
.avatar-preview img,
.identity-stage .avatar-preview.ui-frame--avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.nick-field.nick-plate,
.identity-stage .nick-field.ui-frame--banner-wood {
  width: min(100%, 340px);
  margin-bottom: 0;
  padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  gap: 0.4rem;
  background: linear-gradient(180deg, #fff4d0, var(--gold-soft));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.nick-field.nick-plate.is-ok,
.identity-stage .nick-field.ui-frame--banner-wood.is-ok {
  box-shadow: 0 0 0 3px rgba(111, 214, 168, 0.4), var(--shadow-sm);
}
.nick-tag {
  flex: 0 0 auto;
  padding: 0.28rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-radius: var(--radius-pill);
}
.nick-field.nick-plate input,
.identity-stage .nick-field.ui-frame--banner-wood input {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.65rem 0.15rem;
}
.nick-field.nick-plate input::placeholder,
.identity-stage .nick-field.ui-frame--banner-wood input::placeholder { color: var(--muted); }
.nick-field.nick-plate .nick-count,
.identity-stage .nick-field.ui-frame--banner-wood .nick-count { color: var(--muted); }

.avatar-pick-label {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.avatar-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.15rem 0 0.35rem;
}
@media (max-width: 720px) {
  .avatar-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.avatar-opt,
.avatar-opt.ui-slot {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border: 3px solid transparent;
  border-image: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: linear-gradient(160deg, var(--sky-soft), var(--cream));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  filter: none;
}
.avatar-opt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
}
.avatar-opt:hover,
.avatar-opt.ui-slot:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 200, 90, 0.45);
  filter: none;
}
.avatar-opt:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 176, 122, 0.55), var(--shadow-sm);
}
.avatar-opt.is-on,
.avatar-opt.ui-slot.is-on {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 200, 90, 0.45), var(--shadow);
  transform: translateY(-3px);
  filter: none;
}
.avatar-opt.is-on::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, #ffe898, var(--gold));
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.round-pick.stone-block select,
.stone-block select,
.round-pick select {
  border: 0;
  background: linear-gradient(180deg, #fff8f0, #f0e4d8);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 700;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  cursor: pointer;
  max-width: min(240px, 70vw);
}

.btn-join.gold-block { /* inherits btn-primary clay */ }

.join-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.15rem;
}
.round-pick {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
}
.btn-join { position: relative; min-width: 210px; font-size: 1.08rem; overflow: visible; }
.btn-join:disabled {
  cursor: not-allowed;
  filter: grayscale(0.25) brightness(0.88);
  transform: none !important;
  opacity: 0.72;
}
.btn-join:not(:disabled) {
  box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 0 16px rgba(255, 200, 90, 0.25);
}

.join-ready { margin: 0.65rem 0 0; text-align: right; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.join-ready.is-ok { color: #3a9870; }

.join-side { display: grid; gap: 0.85rem; align-content: start; }
.mascot-card { padding: 0.9rem 0.9rem 0.85rem; text-align: center; }

.mascot-window,
.mascot-window.day-portal {
  margin: 0.35rem auto 0;
  width: min(240px, 90%);
  aspect-ratio: 1 / 1.05;
  border: 0;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-inset), inset 0 0 0 1px rgba(180, 120, 90, 0.1);
  background: linear-gradient(180deg, var(--sky-soft) 0%, var(--mint-soft) 55%, #b8e8c8 100%) !important;
  display: grid;
  place-items: end center;
  overflow: hidden;
  position: relative;
}
.mascot-window::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  opacity: 0.5;
  background: linear-gradient(180deg, transparent, rgba(111, 214, 168, 0.25));
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
.mascot-img,
.mascot-window .mascot-img.pixel-sprite {
  width: 88%;
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 14px rgba(180, 120, 90, 0.22));
  animation: floaty 2.8s ease-in-out infinite;
  image-rendering: auto;
}

.speech {
  margin: 0 0 0.55rem;
  padding: 0.75rem 0.9rem;
  background: var(--cream-2);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-card);
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  position: relative;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.speech::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -8px;
  border: 8px solid transparent;
  border-top-color: var(--cream-2);
  filter: drop-shadow(0 2px 2px rgba(180, 120, 90, 0.08));
}

.tips { padding: 0.95rem 1rem; }
.tips h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tip-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, var(--sky), #70b8f0);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.tips ul { margin: 0; padding: 0; list-style: none; color: var(--ink-soft); line-height: 1.7; }
.tips li { display: flex; gap: 0.4rem; align-items: flex-start; margin-bottom: 0.2rem; }
.tip-ico { color: var(--peach); font-weight: 800; }

.join-foot {
  max-width: 1100px;
  margin: 1rem auto 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.65rem 0.95rem;
}
.chest-ico { margin-right: 0.25rem; }
.foot-tag { color: var(--peach); font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.ai-chip {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-family: var(--display);
  font-weight: 700;
  background: linear-gradient(180deg, var(--lavender), #b090f0);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

/* ===== WAIT ===== */
.wait-top { max-width: 1200px; margin-left: auto; margin-right: auto; }
.wait-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 200px;
  gap: 0.95rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.qr-panel { padding: 1.1rem 0.7rem 0.85rem; text-align: center; }
.panel-gem { display: none; }

.qr-fake {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(0deg, #5a4030 0 6px, #fff9f0 6px 12px),
    repeating-linear-gradient(90deg, #5a4030 0 6px, #fffdf5 6px 12px);
  background-blend-mode: multiply;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm), inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}
.qr-caption {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.room-board {
  padding: 0;
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.room-code-block,
.topic-block {
  position: relative;
  padding: 0.9rem 1.1rem 0.95rem;
  background: transparent;
}
.board-divider {
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(180, 120, 90, 0.15), transparent);
  border: 0;
  box-shadow: none;
}

.label {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.label-orange { color: var(--peach); }
.label-green { color: #4ab880; }
.label-cyan { color: #5aabd8; }

.code-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.code-stone {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  line-height: 1.2;
}

.copy-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: linear-gradient(180deg, var(--sky-soft), var(--sky));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.12s ease;
}
.copy-btn:hover { transform: translateY(-2px); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn.is-copied { background: linear-gradient(180deg, var(--mint-soft), var(--mint)); }
.copy-ico { font-size: 0.95rem; line-height: 1; }

.board-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.topic-title {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  margin: 0.15rem 0;
  color: var(--ink);
}
.topic-crystals { display: none; }

.section-h {
  margin: 0.35rem 0 0.7rem;
  font-size: 1.05rem;
  font-family: var(--display);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
}
.section-h small { color: var(--muted); font-weight: 700; }
.trophy-ico { font-size: 1rem; }

.player-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 0.55rem;
  padding-top: 0.35rem;
}

.player-pill,
.player-pill.ui-chip {
  position: relative;
  background: linear-gradient(180deg, var(--cream-2), #fff6ea);
  color: var(--ink);
  border: 0;
  border-image: none;
  border-radius: var(--radius-card);
  padding: 0.6rem 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.player-pill::before,
.player-pill::after { display: none; }
.player-pill.is-host {
  box-shadow: 0 0 0 2px rgba(255, 200, 90, 0.55), var(--shadow), var(--shadow-inset);
  background: linear-gradient(180deg, #fff8e8, var(--gold-soft));
}
.player-pill .dot {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(111, 214, 168, 0.28);
}
.player-pill:nth-child(4n+1) .dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 90, 0.3); }
.player-pill:nth-child(4n+2) .dot { background: var(--sky); box-shadow: 0 0 0 3px rgba(142, 203, 255, 0.3); }
.player-pill:nth-child(4n+3) .dot { background: var(--lavender); box-shadow: 0 0 0 3px rgba(201, 168, 255, 0.3); }
.player-pill:nth-child(4n+4) .dot { background: var(--pink); box-shadow: 0 0 0 3px rgba(255, 143, 184, 0.3); }
.player-pill .av {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: linear-gradient(160deg, var(--sky-soft), var(--cream));
  flex-shrink: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.player-pill .av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  image-rendering: auto;
}
.player-pill .idx {
  color: var(--muted);
  font-size: 0.68rem;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1;
}
.player-pill .name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.2;
  width: 100%;
  padding: 0.25rem 0.35rem;
  color: var(--ink);
  background: linear-gradient(180deg, #fff4d0, var(--gold-soft));
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.meta-card {
  padding: 0.85rem 0.9rem;
  text-align: center;
  margin-bottom: 0.65rem;
}
.meta-card strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 0.2rem;
  color: var(--peach);
  font-family: var(--display);
  font-weight: 700;
}

.cat-stack { display: grid; gap: 0.45rem; }
.cat {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cat:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.cat:active { transform: translateY(1px); }
.cat.is-on {
  border-color: currentColor;
  box-shadow: 0 0 0 2px currentColor, var(--shadow-sm);
}
.cat-ico { width: 1.35rem; text-align: center; flex-shrink: 0; }
.cat.is-cyan { color: #4a98c8; background: linear-gradient(180deg, var(--sky-soft), #e8f4ff); }
.cat.is-violet { color: #9070c8; background: linear-gradient(180deg, var(--lavender-soft), #f0e8ff); }
.cat.is-orange { color: #c87840; background: linear-gradient(180deg, var(--peach-soft), #fff0e0); }
.cat.is-green { color: #3a9870; background: linear-gradient(180deg, var(--mint-soft), #e8f8f0); }

.wait-bottom {
  max-width: 1200px;
  margin: 1.15rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.95rem;
  flex-wrap: wrap;
  position: relative;
}
.wait-mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.wait-mascot img {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.speech-mini {
  background: var(--cream-2);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-card);
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 160px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

/* ===== PLAY ===== */
.screen-play .play-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto 0.85rem;
  padding: 0 0.4rem;
}
.screen-play .play-brand { justify-self: start; }
.screen-play .play-center-meta { justify-self: center; }
.screen-play .play-score-meta { justify-self: end; }
.play-top.compact { margin-bottom: 0.45rem; }
.play-center-meta { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; }

.stone-capsule,
.meta-plaque,
.meta-plaque.ui-chip,
.timer-plaque,
.timer-plaque.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
  border: 0;
  border-image: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  image-rendering: auto;
}
.meta-plaque.stone-capsule {
  background: linear-gradient(180deg, #fff4e8, var(--peach-soft));
}

.trophy-plaque {
  color: var(--ink);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.2rem 0;
  font-weight: 700;
}
.trophy-plaque strong { color: var(--peach); font-family: var(--display); }

.timer-plaque.stone-capsule,
.timer-plaque.is-timer {
  position: relative;
  min-width: 108px;
  justify-content: center;
  gap: 0.35rem;
  color: #c85868;
  background: linear-gradient(180deg, #ffe8ec, #ffd0d8);
}
.timer-plaque .timer-ico { font-size: 0.95rem; }
.timer-plaque strong {
  position: static;
  display: inline;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #c85868;
}
.timer-ring-svg {
  position: absolute;
  width: 18px;
  height: 18px;
  right: 6px;
  bottom: 5px;
  transform: rotate(-90deg);
  opacity: 0.75;
  pointer-events: none;
}
.timer-plaque .track { fill: none; stroke: rgba(200, 88, 104, 0.2); stroke-width: 8; }
.timer-plaque .prog {
  fill: none;
  stroke: #ff7090;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 188.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
}

.play-score-meta { color: var(--ink); font-weight: 700; }
.play-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 0.85rem;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 210px);
}

.terra-panel,
.wood-panel {
  position: relative;
  padding: 0.95rem 0.9rem 1rem;
  overflow: visible;
}

.player-card, .buff-card, .board-card { padding: 0.9rem; }
.player-card {
  display: grid;
  gap: 0.4rem;
  justify-items: stretch;
  margin-bottom: 0;
}
.player-card.mini { margin-bottom: 0; }

.you-head {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 0.55rem;
  align-items: center;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(160deg, var(--sky-soft), var(--cream));
  border: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.avatar-lg.gold-ring,
.avatar-lg.ui-frame--avatar {
  width: 76px;
  height: 76px;
  border: 3px solid var(--gold);
  border-image: none;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm), 0 0 0 2px rgba(255, 200, 90, 0.35);
  background: linear-gradient(160deg, var(--sky-soft), var(--cream));
}
.avatar-lg img,
.avatar-lg.ui-frame--avatar img { border-radius: calc(var(--radius-card) - 4px); }

.you-nickplate,
.you-meta.ui-frame--banner-stone {
  padding: 0.4rem 0.5rem;
  min-width: 0;
  border: 0 !important;
  border-image: none !important;
  border-radius: var(--radius-card) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  box-shadow: var(--shadow-inset) !important;
}
.you-nickplate .pixel-name { font-size: 0.95rem; }
.you-nickplate .score-line { margin-top: 0.2rem; }
.you-nickplate .streak-line { font-size: 0.7rem; }

.stat-rails { display: grid; gap: 0.28rem; margin-top: 0.35rem; }
.stat-rail {
  height: 12px;
  border: 0;
  border-image: none;
  border-radius: var(--radius-pill);
  background: rgba(180, 120, 90, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(180, 120, 90, 0.15);
}
.stat-rail i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.stat-rail.is-hp i { background: linear-gradient(90deg, #ffb0a0, var(--pink)); }
.stat-rail.is-mp i { background: linear-gradient(90deg, var(--sky-soft), var(--sky)); }
.stat-rail.is-xp i { background: linear-gradient(90deg, var(--mint-soft), var(--mint)); }

.hotbar-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 2px solid rgba(180, 120, 90, 0.12);
  box-shadow: none;
}
.hotbar-slots i {
  aspect-ratio: 1;
  display: block;
  border: 0;
  border-image: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-inset);
}

.buff-inset,
.buff-inset.ui-frame {
  margin-top: 0.5rem;
  padding: 0.55rem;
  border: 0;
  border-image: none;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-inset);
}
.buff-inset h3,
.buff-card h3,
.board-card h3,
.board-title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.gem-ico {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: var(--sky);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(142, 203, 255, 0.6);
}
.gem-ico.green {
  background: var(--mint);
  box-shadow: 0 0 6px rgba(111, 214, 168, 0.6);
}
.buff-inset ul,
.buff-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.buff-inset li,
.buff-card li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.3rem 0.4rem;
  background: rgba(255, 255, 255, 0.5);
  border: 0;
  border-radius: 10px;
}
.buff-inset b, .buff-card b { margin-left: auto; color: var(--ink); font-weight: 700; }
.ico-book, .ico-shield, .ico-clock {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 4px;
}
.ico-book { background: linear-gradient(180deg, var(--sky), #70b8f0); }
.ico-shield { background: linear-gradient(180deg, #c8d0d8, #8898a8); clip-path: polygon(50% 0, 100% 20%, 100% 70%, 50% 100%, 0 70%, 0 20%); }
.ico-clock { background: radial-gradient(circle at 50% 50%, var(--gold) 0 40%, #d0a840 42% 70%, transparent 72%); border-radius: 50%; }

.play-main { position: relative; }
.play-main::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: -10px;
  height: 36px;
  background:
    radial-gradient(ellipse 48px 18px at 18% 60%, rgba(255, 255, 255, 0.65) 0 60%, transparent 62%),
    radial-gradient(ellipse 56px 20px at 48% 40%, rgba(255, 255, 255, 0.55) 0 60%, transparent 62%),
    radial-gradient(ellipse 42px 16px at 78% 55%, rgba(255, 255, 255, 0.5) 0 60%, transparent 62%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}
.play-main .q-card,
.play-main .answers { position: relative; z-index: 1; }

.q-card,
.q-card.gold-brick,
.q-card.ui-frame--parchment {
  position: relative;
  padding: 1.2rem 1.25rem 1.35rem;
  min-height: 158px;
  margin-bottom: 0.85rem;
  color: var(--ink);
  overflow: visible;
}
.q-corner-bl, .q-corner-br { display: none; }
.cloud-top::before { display: none; }

.q-tag,
.pixel-tag {
  display: inline-block;
  background: linear-gradient(180deg, var(--sky-soft), var(--sky));
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  box-shadow: var(--shadow-sm);
}
.q-card h2,
.q-stem {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.02rem, 2.1vw, 1.32rem);
  font-weight: 700;
  line-height: 1.55;
  max-width: 88%;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.q-mascot {
  position: absolute;
  right: 0.75rem;
  bottom: 0.45rem;
  opacity: 0.95;
  filter: drop-shadow(0 4px 8px rgba(180, 120, 90, 0.2));
  image-rendering: auto;
}

/* ===== Answer clay cards ===== */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.answer,
.answer.opt-banner {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 98px;
  padding: 0.75rem 1rem 0.75rem 0.85rem;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.5vw, 1.05rem);
  line-height: 1.35;
  border-radius: var(--radius-card);
  position: relative;
  overflow: visible;
  background-image: none !important;
  background-repeat: no-repeat;
  background-size: cover;
  image-rendering: auto;
  box-shadow: var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.2s ease, filter 0.15s ease;
}
.answer:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 20px rgba(255, 255, 255, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.answer:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(0, 0, 0, 0.08);
}
.answer:disabled { cursor: default; }

.opt-letter {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.55);
  clip-path: polygon(
    50% 0%, 62% 32%, 98% 32%, 68% 52%,
    80% 88%, 50% 68%, 20% 88%, 32% 52%, 2% 32%, 38% 32%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 1;
}
.opt-letter em {
  font-style: normal;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.opt-deco {
  position: absolute;
  right: 0.55rem;
  bottom: 0.45rem;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  opacity: 0.35;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  display: block;
}
.answer.is-red .opt-deco { background: radial-gradient(circle, #fff 20%, transparent 70%); }
.answer.is-blue .opt-deco { border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.answer.is-yellow .opt-deco { border-radius: 40%; background: rgba(255, 255, 255, 0.35); }
.answer.is-green .opt-deco { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); background: rgba(255, 255, 255, 0.4); }

.answer.is-red {
  background: linear-gradient(145deg, #ffc0d8 0%, var(--pink) 42%, #f07098 100%) !important;
  color: #fff;
}
.answer.is-red .opt-letter {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.answer.is-blue {
  background: linear-gradient(145deg, #c0e4ff 0%, var(--sky) 42%, #70b8f0 100%) !important;
  color: #fff;
}
.answer.is-blue .opt-letter {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.answer.is-yellow {
  background: linear-gradient(145deg, #b8f0d8 0%, var(--mint) 42%, #50c890 100%) !important;
  color: #fff;
}
.answer.is-yellow .opt-letter {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}
.answer.is-yellow .opt-text { color: #fff; }

.answer.is-green {
  background: linear-gradient(145deg, #ddd0ff 0%, var(--lavender) 42%, #b090f0 100%) !important;
  color: #fff;
}
.answer.is-green .opt-letter {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.answer.is-picked {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
  filter: brightness(1.06);
}
.answer.is-correct {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
  filter: brightness(1.08);
  box-shadow: var(--shadow), 0 0 22px rgba(111, 214, 168, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.answer.is-wrong,
.answer.is-miss {
  opacity: 0.42;
  filter: grayscale(0.2) brightness(0.92);
}
.answer.is-dim {
  opacity: 0.35;
  filter: grayscale(0.3);
}
.answer.is-pressed {
  transform: translateY(2px) !important;
  filter: brightness(0.96);
}

@media (max-width: 720px) {
  .answer {
    min-height: 88px;
    padding: 0.6rem 0.75rem 0.6rem 0.65rem;
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .opt-letter { width: 44px; height: 44px; font-size: 0.88rem; }
}

.live-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.live-board li {
  display: grid;
  grid-template-columns: 26px 28px 1fr auto;
  gap: 0.35rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-image: none !important;
  border-radius: 12px;
  padding: 0.38rem 0.48rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-inset);
}
.live-board li.is-you {
  background: linear-gradient(90deg, rgba(142, 203, 255, 0.25), rgba(255, 255, 255, 0.65));
  box-shadow: 0 0 0 2px rgba(142, 203, 255, 0.45), var(--shadow-inset);
}
.live-board .rank {
  color: var(--peach);
  text-align: center;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
}
.live-board .av {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--sky-soft), var(--cream));
  font-size: 0.85rem;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
}
.live-board .av img,
.avatar-lg img,
.player-pill .av img,
.podium-slot .av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  image-rendering: auto;
}
.live-board .pts {
  color: var(--peach);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
}
.live-board.final {
  width: min(480px, 100%);
  margin: 0 auto 1.15rem;
}
.live-board.final li {
  background: var(--cream-2);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.pixel-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: 0.01em;
}
.score-line {
  margin: 0.15rem 0 0;
  font-weight: 700;
  color: var(--peach);
  font-family: var(--display);
  font-size: 0.82rem;
}
.streak-line {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.hearts { display: flex; gap: 4px; margin-top: 0.25rem; }
.hearts i {
  width: 14px;
  height: 12px;
  position: relative;
  display: inline-block;
}
.hearts i::before,
.hearts i::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 12px;
  background: var(--pink);
  border-radius: 8px 8px 0 0;
  top: 0;
}
.hearts i::before { left: 0; transform: rotate(-45deg); transform-origin: bottom right; }
.hearts i::after { right: 0; transform: rotate(45deg); transform-origin: bottom left; }
.hearts.mini i { width: 11px; height: 10px; }
.hearts.mini i::before,
.hearts.mini i::after { width: 6px; height: 10px; }

.xp-bar,
.pixel-bar {
  width: 100%;
  height: 12px;
  background: rgba(180, 120, 90, 0.12);
  border: 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 0.35rem;
  box-shadow: inset 0 1px 3px rgba(180, 120, 90, 0.15);
}
.xp-bar i {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--sky-soft), var(--sky));
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.35s ease;
}
.pixel-lv {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.play-foot {
  max-width: 1280px;
  margin: 0.85rem auto 0;
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 0.7rem;
  align-items: center;
}
.combo-box,
.combo-box.ui-frame {
  padding: 0.7rem 0.8rem;
  text-align: center;
  background: linear-gradient(180deg, #ffe8f0, #ffd0e0) !important;
  border: 0;
  border-image: none;
  border-radius: var(--radius-card);
}
.combo-box strong {
  font-family: var(--display);
  color: var(--pink);
  font-size: 0.88rem;
  font-weight: 700;
}
.timeline,
.timeline.ui-frame {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-card);
}
.timeline-track {
  height: 12px;
  background: rgba(180, 120, 90, 0.12);
  border: 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(180, 120, 90, 0.15);
}
.timeline-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--gold));
  border-radius: inherit;
  transition: width 0.35s ease;
}
.timeline-tip {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.items { display: flex; gap: 0.45rem; justify-content: flex-end; }
.item-btn,
.item-btn.pixel-slot,
.item-btn.ui-slot {
  appearance: none;
  border: 0;
  border-image: none;
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
  color: var(--ink);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  position: relative;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  image-rendering: auto;
  transition: transform 0.12s ease;
}
.item-btn small {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 0.62rem;
  background: var(--lavender);
  color: #fff;
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 800;
}
.item-btn:disabled { opacity: 0.38; cursor: default; }
.item-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }

.crystal-top::before,
.crystal-corners::before { display: none; }

/* ===== REVEAL ===== */
.reveal-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 230px;
  gap: 0.8rem;
  max-width: 1200px;
  margin: 0 auto;
}
.reveal-center { text-align: center; position: relative; padding: 0.4rem 0 1rem; }

.reveal-stage {
  padding: 1rem 1rem 1.1rem;
  margin: 0 auto 0.85rem;
  max-width: 520px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(142, 203, 255, 0.2), transparent 65%),
    linear-gradient(180deg, var(--cream-2), var(--cream)) !important;
}

.reveal-bot {
  width: min(170px, 38vw);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(180, 120, 90, 0.22));
  animation: floaty 2.4s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.reveal-title {
  margin: 0.3rem 0;
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--mint);
  line-height: 1.4;
}
.reveal-center.is-bad .reveal-title { color: var(--pink); }
.reveal-sub { margin: 0; color: var(--muted); font-weight: 600; }

.reveal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  max-width: 560px;
  margin: 0 auto 0.8rem;
  text-align: left;
}
.reveal-cards .label { display: block; margin-bottom: 0.3rem; color: var(--muted); font-weight: 700; }
.reveal-cards p { margin: 0; font-weight: 700; color: var(--ink); }
.reveal-cards .stone-frame,
.reveal-cards .parchment {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-card);
}

.big-gold {
  color: var(--peach);
  font-size: 1.45rem;
  font-family: var(--display);
  font-weight: 700;
}

.reveal-explain {
  max-width: 560px;
  margin: 0 auto 0.8rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-radius: var(--radius-card);
  padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow-inset);
}

.combo-bar {
  max-width: 560px;
  margin: 0 auto 1rem;
  padding: 0.8rem 0.95rem;
  text-align: left;
  border-radius: var(--radius-card);
}
.combo-bar strong {
  color: var(--peach);
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
}
.gold { color: var(--gold); font-weight: 700; }

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 20% 20%, var(--pink) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 15%, var(--gold) 0 3px, transparent 4px),
    radial-gradient(circle at 40% 40%, var(--sky) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 35%, var(--lavender) 0 3px, transparent 4px);
  opacity: 0.65;
  animation: confettiDrift 2s ease-in-out infinite;
}
.confetti.is-off { display: none; }

@keyframes confettiDrift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ===== PODIUM ===== */
#screen-podium {
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#screen-podium.is-on { display: flex; }

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  color: var(--sky);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
#screen-podium h2 {
  margin: 0.35rem 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.2rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--ink);
}

.podium {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  min-height: 200px;
}

.podium-slot {
  border: 0;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 0.8rem 0.45rem;
  color: var(--ink);
  box-shadow: var(--shadow), var(--shadow-inset);
  background: linear-gradient(180deg, var(--cream-2), #f0e4d8);
}
.podium-slot.is-1 {
  height: 200px;
  order: 2;
  background: linear-gradient(180deg, var(--gold-soft), #f0d880);
  box-shadow: var(--shadow), 0 0 0 2px rgba(255, 200, 90, 0.45), var(--shadow-inset);
}
.podium-slot.is-2 { height: 150px; order: 1; background: linear-gradient(180deg, var(--sky-soft), #c8e4ff); }
.podium-slot.is-3 { height: 120px; order: 3; background: linear-gradient(180deg, var(--peach-soft), #ffd8b8); }

.podium-slot strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-family: var(--display);
  font-weight: 700;
  margin-top: 0.3rem;
}
.podium-slot .av-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.podium-slot span {
  color: var(--peach);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
}

.podium-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 4.2rem;
  transform: translateX(-50%) translateY(120%);
  background: var(--cream-2);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  z-index: 30;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
}
.toast.is-on { transform: translateX(-50%) translateY(0); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .screen, .mascot-img, .reveal-bot, .confetti, .pin-box.is-flash { animation: none; }
  .btn-primary, .chip-btn, .icon-btn, .answer, .cat, .item-btn { transition: none; }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .join-layout,
  .wait-layout,
  .play-grid,
  .reveal-layout {
    grid-template-columns: 1fr;
  }
  .screen-play .play-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .screen-play .play-brand,
  .screen-play .play-center-meta,
  .screen-play .play-score-meta { justify-self: center; }
  .join-gate { padding: 0.85rem 0.7rem; }
  .wait-left,
  .wait-right { display: none; }
  .room-board { margin-bottom: 0.75rem; }
  .play-foot { grid-template-columns: 1fr; }
  .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-left,
  .side-right { display: none; }
  .reveal-layout .side-left,
  .reveal-layout .side-right { display: none; }
  .wait-mascot { position: static; justify-content: center; margin-top: 0.5rem; }
  .answers { grid-template-columns: 1fr; }
  .reveal-cards { grid-template-columns: 1fr; }
}
