:root {
  color-scheme: light;
  --navy-950: #031e27;
  --navy-900: #07313d;
  --teal-900: #064955;
  --teal-800: #08606b;
  --teal-700: #087783;
  --teal-500: #22a0a3;
  --teal-200: #a9e2d8;
  --cream-50: #fffdf4;
  --cream-100: #fff8df;
  --cream-200: #f7e8bf;
  --cream-300: #e7d09b;
  --gold-100: #fff2b4;
  --gold-200: #ffe07c;
  --gold-300: #f5c653;
  --gold-500: #cf8d1e;
  --gold-700: #86530e;
  --coral-300: #ef8a69;
  --coral-500: #d6533d;
  --coral-700: #91352e;
  --ink: #19363d;
  --muted: #5d6b6d;
  --success: #1a765d;
  --danger: #9a3931;
  --paper-shadow: 0 20px 55px rgb(2 35 43 / 28%);
  --gold-shadow: 0 0 0 1px rgb(255 244 190 / 72%), 0 9px 26px rgb(71 42 7 / 24%);
  --courtyard-art: url("assets/backgrounds/school-courtyard.png");
  --holder-empty-art: url("assets/characters/holder-empty-atlas.png");
  --holder-holding-art: url("assets/characters/holder-holding-atlas.png");
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-ui: "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  overflow-x: hidden;
  background: var(--navy-950);
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--navy-950);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
output {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid #fff4a8;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgb(7 70 83 / 88%);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  font-family: var(--font-display);
  line-height: 1.2;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--gold-200);
  border-radius: 8px;
  color: var(--navy-950);
  background: var(--cream-50);
  font-weight: 900;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell,
.screen {
  width: 100%;
  min-width: 0;
}

/* Main menu */

.menu-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(28px, 6vw, 72px) 20px 66px;
  overflow: hidden;
  isolation: isolate;
  background-color: #315f60;
  background-image:
    linear-gradient(180deg, rgb(3 28 36 / 12%), rgb(2 26 34 / 64%)),
    radial-gradient(circle at 50% 28%, transparent 0 24%, rgb(4 35 42 / 16%) 62%, rgb(2 23 30 / 46%) 100%),
    var(--courtyard-art);
  background-position: center;
  background-size: cover;
}

.menu-screen::before,
.menu-screen::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}

.menu-screen::before {
  inset: 18px;
  border: 2px solid rgb(255 224 124 / 52%);
  border-radius: 42px 13px;
  box-shadow:
    inset 0 0 0 4px rgb(3 63 72 / 42%),
    inset 0 0 55px rgb(255 211 85 / 10%),
    0 0 0 1px rgb(255 255 255 / 25%);
}

.menu-screen::after {
  right: -12vw;
  bottom: -32vw;
  width: min(76vw, 950px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 222 115 / 24%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 8deg, rgb(255 224 123 / 8%) 0 8deg, transparent 8deg 18deg);
  animation: slow-turn 36s linear infinite;
}

.menu-atmosphere {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sun-halo {
  position: absolute;
  top: -24vmin;
  left: -18vmin;
  width: 72vmin;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 245 186 / 38%), rgb(255 213 99 / 13%) 40%, transparent 70%);
  animation: halo-breathe 7s ease-in-out infinite;
}

.light-ribbon {
  position: absolute;
  width: 74vw;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgb(255 235 153 / 68%), transparent);
  box-shadow: 0 0 16px rgb(255 220 106 / 40%);
  transform: rotate(-16deg);
}

.light-ribbon-one {
  top: 20%;
  left: -19%;
}

.light-ribbon-two {
  right: -24%;
  bottom: 24%;
  transform: rotate(14deg);
}

.floating-spark {
  position: absolute;
  width: 8px;
  aspect-ratio: 1;
  border: 1px solid #fff2a8;
  background: var(--gold-200);
  box-shadow: 0 0 14px var(--gold-100);
  transform: rotate(45deg);
  animation: sparkle 4.5s ease-in-out infinite;
}

.spark-one { top: 18%; right: 17%; }
.spark-two { bottom: 27%; left: 12%; animation-delay: 1.1s; }
.spark-three { top: 56%; right: 9%; animation-delay: 2.2s; }

.menu-stage {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 700px);
}

.menu-emblem {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 84px;
  margin-bottom: -34px;
}

.emblem-lens {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 65px;
  aspect-ratio: 1;
  border: 7px double var(--gold-500);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d6f2eb 28%, #70aeb1 65%, #174d5a 100%);
  box-shadow: 0 0 0 3px var(--cream-100), 0 10px 22px rgb(0 0 0 / 35%);
  transform: translateX(-50%);
}

.emblem-lens::after {
  position: absolute;
  top: 48px;
  left: 48px;
  width: 34px;
  height: 11px;
  border: 3px solid var(--gold-700);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-300), #fff0a8);
  content: "";
  transform: rotate(43deg);
  transform-origin: left center;
}

.emblem-card {
  position: absolute;
  top: 22px;
  width: 55px;
  aspect-ratio: 3 / 4;
  border: 4px double var(--gold-300);
  border-radius: 8px 3px;
  background: linear-gradient(145deg, #116778, #073b49);
  box-shadow: 0 7px 17px rgb(0 0 0 / 26%);
}

.emblem-card::after {
  position: absolute;
  inset: 9px;
  border: 1px solid rgb(255 236 169 / 58%);
  border-radius: 50%;
  content: "";
}

.emblem-card-left { left: 3px; transform: rotate(-14deg); }
.emblem-card-right { right: 3px; transform: rotate(14deg); }

.title-plaque {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(48px, 7vw, 68px) clamp(22px, 6vw, 62px) 28px;
  border: 4px double var(--gold-500);
  border-radius: 48px 13px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0, rgb(255 255 255 / 92%), transparent 48%),
    linear-gradient(135deg, rgb(255 254 245 / 96%), rgb(245 224 172 / 96%));
  box-shadow:
    0 0 0 4px rgb(4 58 68 / 86%),
    0 0 0 7px rgb(255 225 121 / 44%),
    0 28px 74px rgb(0 22 29 / 48%),
    inset 0 0 42px rgb(174 102 14 / 12%);
  text-align: center;
}

.title-plaque::before,
.title-plaque::after {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 84px;
  border: 3px double var(--gold-500);
  background: linear-gradient(160deg, #0a6975, #063641);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.title-plaque::before { left: -26px; }
.title-plaque::after { right: -26px; }

.title-kicker,
.panel-kicker,
.section-kicker {
  margin-bottom: 7px;
  color: var(--gold-700);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.title-plaque h1 {
  color: var(--teal-900);
  font-size: clamp(2.7rem, 8vw, 5.1rem);
  font-weight: 900;
  letter-spacing: .09em;
  text-shadow: 0 3px 0 #fff, 0 6px 12px rgb(70 42 7 / 22%);
}

.title-subtitle {
  margin: 9px 0 0;
  color: #4d5c5e;
  font-size: clamp(.94rem, 2.4vw, 1.3rem);
  font-weight: 800;
  letter-spacing: .06em;
}

.language-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 15px 0 0;
  padding: 5px 12px;
  border: 1px solid #75aa94;
  border-radius: 999px;
  color: #205e4f;
  background: rgb(233 252 242 / 86%);
  font-size: .72rem;
  font-weight: 800;
}

.menu-actions {
  z-index: 2;
  display: grid;
  gap: 12px;
  width: min(92%, 555px);
  margin-top: 22px;
}

.ornate-button {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  padding: 10px 25px;
  overflow: hidden;
  border: 3px double var(--gold-300);
  border-radius: 18px 5px;
  color: var(--cream-50);
  box-shadow: 0 0 0 2px var(--navy-900), 0 12px 26px rgb(0 21 28 / 36%), inset 0 1px 0 rgb(255 255 255 / 20%);
  text-align: left;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ornate-button::before {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 22%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 30%), transparent);
  content: "";
  transform: rotate(24deg);
  transition: left 450ms ease;
}

.ornate-button:hover:not(:disabled),
.ornate-button:focus-visible {
  filter: brightness(1.12) saturate(1.08);
  transform: translateY(-2px);
}

.ornate-button:hover::before,
.ornate-button:focus-visible::before {
  left: 112%;
}

.ornate-button-primary { background: linear-gradient(145deg, #1a8690, #075261 70%); }
.ornate-button-secondary { background: linear-gradient(145deg, #d96349, #9f372f 70%); }
.ornate-button-tertiary { background: linear-gradient(145deg, #318069, #145644 70%); }

.button-jewel {
  display: grid;
  place-items: center;
  width: 36px;
  aspect-ratio: 1;
  border: 4px double #9c6413;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9c3, #ffd254 42%, #b66c13 72%);
  box-shadow: 0 0 13px rgb(255 223 101 / 50%);
}

.button-jewel::after {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 3px;
  background: #fff5b4;
  content: "";
  transform: rotate(45deg);
}

.button-copy {
  display: grid;
  min-width: 0;
}

.button-copy strong {
  font-family: var(--font-display);
  font-size: 1.24rem;
  letter-spacing: .06em;
}

.button-copy small {
  color: rgb(255 255 235 / 76%);
  font-size: .72rem;
  font-weight: 700;
}

.menu-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 8px 16px;
  border: 1px solid rgb(255 227 126 / 55%);
  border-radius: 999px;
  color: #fff8d7;
  background: rgb(3 48 57 / 74%);
  box-shadow: 0 7px 20px rgb(0 0 0 / 24%);
}

.menu-feature > span {
  color: var(--gold-200);
}

.menu-feature p {
  display: grid;
  margin: 0;
  line-height: 1.25;
}

.menu-feature strong { font-size: .78rem; }
.menu-feature small { color: rgb(255 255 235 / 73%); font-size: .65rem; }

.menu-footnote {
  position: absolute;
  right: 22px;
  bottom: 18px;
  left: 22px;
  margin: 0 auto;
  color: rgb(255 252 224 / 86%);
  font-size: .68rem;
  font-weight: 750;
  text-align: center;
  text-shadow: 0 2px 5px rgb(0 0 0 / 65%);
}

/* Game shell */

.game-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 14px clamp(10px, 2.2vw, 34px) 34px;
  isolation: isolate;
  background: #dfd0ac;
}

.game-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  background-color: #7faaa5;
  background-image:
    linear-gradient(180deg, rgb(0 43 52 / 15%), rgb(0 32 40 / 58%)),
    var(--courtyard-art);
  background-position: center;
  background-size: cover;
  filter: saturate(.82) brightness(.86);
  transform: scale(1.025);
}

.game-backdrop::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, transparent, rgb(1 28 35 / 38%));
  content: "";
}

.game-header {
  position: sticky;
  z-index: 40;
  top: 10px;
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(420px, 1.55fr) auto;
  align-items: center;
  gap: 16px;
  max-width: 1480px;
  min-width: 0;
  margin: 0 auto 16px;
  padding: 10px 13px;
  border: 3px double var(--gold-300);
  border-radius: 22px 7px;
  color: var(--cream-50);
  background: linear-gradient(135deg, rgb(5 58 70 / 97%), rgb(3 35 45 / 97%));
  box-shadow: 0 8px 30px rgb(0 22 28 / 40%), inset 0 1px 0 rgb(255 255 255 / 13%);
  backdrop-filter: blur(10px);
}

.compact-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.compact-brand > span:last-child {
  display: grid;
  min-width: 0;
}

.compact-brand small {
  color: var(--gold-200);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.compact-brand strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.13rem;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-seal {
  display: grid;
  flex: 0 0 46px;
  place-items: center;
  width: 46px;
  aspect-ratio: 1;
  border: 4px double var(--gold-300);
  border-radius: 50%;
  color: var(--navy-900);
  background: radial-gradient(circle at 38% 30%, #fff, #ffe388 50%, #d29626 100%);
  box-shadow: 0 0 12px rgb(255 220 97 / 38%);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  color: rgb(255 255 235 / 60%);
}

.progress-step:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 16px;
  left: 58%;
  width: 84%;
  height: 2px;
  background: rgb(255 228 130 / 25%);
  content: "";
}

.step-number {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 2px solid rgb(255 231 139 / 42%);
  border-radius: 50%;
  background: #244f57;
  font-size: .73rem;
  font-weight: 900;
}

.step-label {
  overflow: hidden;
  font-size: .68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-step.is-current,
.progress-step.is-complete {
  color: #fffbdc;
}

.progress-step.is-current .step-number {
  color: var(--navy-950);
  border-color: #fff6bd;
  background: linear-gradient(145deg, #ffe99b, #e9ad37);
  box-shadow: 0 0 0 4px rgb(255 222 99 / 18%), 0 0 16px rgb(255 222 99 / 40%);
}

.progress-step.is-complete .step-number {
  color: #fff;
  border-color: var(--teal-200);
  background: var(--teal-700);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-button,
.round-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid rgb(255 231 145 / 72%);
  color: #fff9d9;
  background: rgb(255 255 255 / 8%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%);
  font-weight: 900;
}

.header-button {
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
}

.round-button {
  width: 46px;
  padding: 0;
  border-radius: 50%;
}

.header-button:hover,
.round-button:hover {
  background: rgb(255 255 255 / 17%);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(260px, 315px) minmax(0, 1fr);
  align-items: start;
  gap: 17px;
  width: min(100%, 1480px);
  min-width: 0;
  margin: 0 auto;
}

.play-column {
  display: grid;
  gap: 17px;
  min-width: 0;
}

.ornate-panel {
  position: relative;
  min-width: 0;
  border: 3px double var(--gold-500);
  border-radius: 25px 8px;
  background:
    radial-gradient(circle at 50% 0, rgb(255 255 255 / 78%), transparent 38%),
    linear-gradient(135deg, rgb(255 253 243 / 96%), rgb(239 221 176 / 96%));
  box-shadow: var(--paper-shadow), inset 0 0 32px rgb(165 94 9 / 9%);
}

.ornate-panel::after {
  position: absolute;
  z-index: 0;
  inset: 6px;
  border: 1px solid rgb(160 105 24 / 26%);
  border-radius: 18px 4px;
  content: "";
  pointer-events: none;
}

.mission-panel {
  position: sticky;
  top: 102px;
  display: grid;
  gap: 11px;
  padding: 35px 20px 20px;
  overflow: hidden;
  text-align: center;
}

.mission-panel > * {
  position: relative;
  z-index: 1;
}

.panel-crown {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 100px;
  height: 26px;
  transform: translateX(-50%);
}

.panel-crown::before,
.panel-crown::after,
.panel-crown span {
  position: absolute;
  top: -7px;
  width: 32px;
  aspect-ratio: 1;
  border: 4px double var(--gold-500);
  background: linear-gradient(145deg, #fff0a3, #d89a27);
  box-shadow: 0 3px 10px rgb(80 43 5 / 25%);
  content: "";
  transform: rotate(45deg);
}

.panel-crown::before { left: 10px; }
.panel-crown::after { right: 10px; }
.panel-crown span { z-index: 1; left: 34px; width: 34px; background: linear-gradient(145deg, #e8fff4, #3f9884); }

.mission-panel h2 {
  color: var(--teal-900);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.mission-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 164px;
  padding: 18px 12px;
  border: 1px solid #d1b574;
  border-radius: 17px 5px;
  background: rgb(255 255 255 / 48%);
}

.mission-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 750;
}

.mission-reveal {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.mission-story {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 9px;
  overflow: hidden;
  border: 1px solid #d1b574;
  border-radius: 17px 5px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 78%), rgb(255 246 218 / 74%)),
    #fff8e7;
  box-shadow: inset 0 0 22px rgb(170 112 22 / 8%);
  text-align: left;
}

.mission-story-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgb(133 91 24 / 30%);
  border-radius: 12px 4px;
  background: #f4ead5;
  box-shadow: 0 6px 14px rgb(79 49 8 / 16%);
}

.mission-story-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 1px 3px 3px;
}

.mission-story h3 {
  margin: 0;
  color: var(--coral-700);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
}

.mission-story p {
  margin: 0;
  color: #4f432d;
  font-size: .79rem;
  font-weight: 680;
  line-height: 1.65;
  text-wrap: pretty;
}

.mystery-orb {
  display: grid;
  place-items: center;
  width: 78px;
  aspect-ratio: 1;
  border: 5px double var(--gold-500);
  border-radius: 50%;
  color: #fff8cf;
  background: radial-gradient(circle at 35% 28%, #31a4a5, #075765 65%, #053442);
  box-shadow: 0 0 0 4px rgb(255 225 126 / 24%), 0 10px 22px rgb(3 55 64 / 27%);
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
}

.mission-clues {
  display: grid;
  gap: 9px;
  margin: 0;
}

.mission-clue {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 10px 12px;
  border: 1px solid #d4b76e;
  border-radius: 14px 5px;
  background: rgb(255 255 255 / 56%);
  text-align: left;
}

.mission-clue dt {
  color: #6f5d36;
  font-size: .73rem;
  font-weight: 900;
}

.mission-clue dd {
  margin: 0;
  color: var(--teal-900);
  font-family: var(--font-display);
  font-size: 1.03rem;
  font-weight: 900;
  text-align: right;
}

.mission-explanation {
  margin: 0;
  padding: 9px 10px;
  border-left: 4px solid var(--teal-700);
  border-radius: 7px;
  color: #2f625b;
  background: #e8f7ed;
  font-size: .7rem;
  font-weight: 750;
  text-align: left;
}

.mission-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.action-button,
.submit-question-button,
.guess-button,
.primary-dialog-button,
.secondary-button,
.quiet-button {
  border: 2px solid var(--gold-300);
  border-radius: 14px 5px;
  box-shadow: 0 0 0 1px var(--gold-700), 0 7px 15px rgb(3 39 45 / 22%), inset 0 1px 0 rgb(255 255 255 / 20%);
  font-weight: 900;
  transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.action-button {
  min-height: 52px;
  padding: 9px 13px;
  color: #fffef0;
}

.action-button-gold { color: var(--navy-950); background: linear-gradient(145deg, #ffe99a, #dfa736); }
.action-button-coral { background: linear-gradient(145deg, var(--coral-300), var(--coral-700)); }

.action-button:hover:not(:disabled),
.submit-question-button:hover:not(:disabled),
.guess-button:hover:not(:disabled),
.primary-dialog-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.quiet-button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.action-button:disabled,
.submit-question-button:disabled,
.guess-button:disabled,
.secondary-button:disabled {
  color: rgb(255 255 255 / 72%);
  border-color: #aaa080;
  background: #7f8986;
  box-shadow: none;
  opacity: .7;
}

/* Holder grid */

.holders-section {
  padding: 18px;
}

.holders-section > *,
.question-workbench > * {
  position: relative;
  z-index: 1;
}

.section-heading-row,
.workbench-heading,
.subheading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading-row {
  margin-bottom: 13px;
}

.section-heading-row h2,
.workbench-heading h2 {
  color: var(--teal-900);
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
}

.section-hint {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 750;
  text-align: right;
}

.holder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.holder-card {
  position: relative;
  min-width: 0;
  border: 2px solid #b8872e;
  border-radius: 18px 6px;
  background: linear-gradient(150deg, #fffaf0, #e5cc91);
  box-shadow: 0 0 0 1px #fff7d0, 0 8px 18px rgb(4 43 49 / 23%);
  transition: box-shadow 170ms ease, transform 170ms ease;
}

.holder-card::before {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  width: 15px;
  height: 15px;
  border-top: 2px solid var(--gold-500);
  border-left: 2px solid var(--gold-500);
  content: "";
  pointer-events: none;
}

.holder-card:hover:has(.holder-select-button:not(:disabled)) {
  transform: translateY(-2px);
}

.holder-card.is-selected {
  border-color: #fff3a8;
  box-shadow: 0 0 0 4px var(--teal-700), 0 0 0 7px rgb(255 228 118 / 80%), 0 12px 25px rgb(3 39 46 / 36%);
}

.holder-card.is-wrong {
  animation: wrong-shake 420ms ease both;
}

.holder-card.is-solved {
  border-color: #fff0a2;
  box-shadow: 0 0 0 4px var(--success), 0 0 30px rgb(255 220 91 / 55%);
}

.holder-select-button {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 16px 5px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.holder-select-button:disabled {
  color: inherit;
  opacity: .84;
}

.holder-frame {
  position: relative;
  display: block;
  margin: 5px 5px 0;
  overflow: hidden;
  border: 1px solid rgb(255 236 178 / 68%);
  border-radius: 14px 4px 8px 4px;
  background: radial-gradient(circle at 50% 24%, #fff9eb, #e8dcc2 65%, #c9a45a);
}

.holder-portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.holder-art {
  position: absolute;
  inset: 0;
  display: block;
  background-color: #f7eee0;
  background-repeat: no-repeat;
  background-position: var(--sprite-x) var(--sprite-y);
  background-size: 300% auto;
  filter: saturate(1.02) contrast(1.02);
  transition: opacity 280ms ease, transform 280ms ease, filter 280ms ease;
}

.holder-art-empty {
  z-index: 1;
  background-image: var(--holder-empty-art);
  opacity: 1;
}

.holder-art-holding {
  z-index: 2;
  background-image: var(--holder-holding-art);
  opacity: 0;
}

.holder-card[data-visual-state="holding"] .holder-art-empty,
.holder-card[data-visual-state="revealed"] .holder-art-empty {
  opacity: 0;
}

.holder-card[data-visual-state="holding"] .holder-art-holding,
.holder-card[data-visual-state="revealed"] .holder-art-holding {
  opacity: 1;
}

.holder-select-button:hover:not(:disabled) .holder-art,
.holder-card.is-selected .holder-art {
  filter: saturate(1.09) contrast(1.03);
  transform: scale(1.025);
}

.holder-visual-a { --sprite-x: 0%; --sprite-y: 6%; }
.holder-visual-b { --sprite-x: 50%; --sprite-y: 6%; }
.holder-visual-c { --sprite-x: 100%; --sprite-y: 6%; }
.holder-visual-d { --sprite-x: 0%; --sprite-y: 67%; }
.holder-visual-e { --sprite-x: 50%; --sprite-y: 67%; }
.holder-visual-f { --sprite-x: 100%; --sprite-y: 67%; }

.selection-badge {
  position: absolute;
  z-index: 8;
  top: 8px;
  right: 8px;
  min-height: 27px;
  padding: 4px 8px;
  border: 2px solid #fff2a7;
  border-radius: 999px;
  color: #fff;
  background: var(--teal-800);
  box-shadow: 0 4px 10px rgb(0 0 0 / 28%);
  font-size: .64rem;
  font-weight: 900;
}

.face-up-layer {
  position: absolute;
  z-index: 6;
  top: 64%;
  right: 33%;
  bottom: 3%;
  left: 33%;
  pointer-events: none;
}

.face-up-card {
  display: grid;
  align-content: center;
  gap: 1px;
  position: absolute;
  top: 0;
  width: 43%;
  min-width: 0;
  height: 100%;
  padding: 4px;
  overflow: hidden;
  border: 3px double var(--gold-500);
  border-radius: 7px 2px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 12%, #fff, transparent 30%),
    linear-gradient(150deg, #fffdf2, #efcf79);
  box-shadow: 0 4px 9px rgb(0 0 0 / 32%), inset 0 0 10px rgb(143 82 5 / 14%);
  font-size: clamp(.42rem, .75vw, .62rem);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  animation: reveal-card 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.face-up-card-first {
  left: 3%;
  transform: rotate(-5deg);
}

.face-up-card-second {
  right: 3%;
  animation-delay: 130ms;
  transform: rotate(5deg);
}

.holder-meta {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  text-align: center;
}

.holder-meta strong {
  overflow: hidden;
  color: var(--teal-900);
  font-family: var(--font-display);
  font-size: .93rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holder-state {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 750;
  line-height: 1.35;
}

.holder-card[data-visual-state="holding"] .holder-state {
  color: #865515;
}

.holder-card[data-visual-state="revealed"] .holder-state {
  color: var(--success);
}

/* Sentence builder */

.question-workbench {
  display: grid;
  gap: 15px;
  padding: 18px;
}

.workbench-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid #d5bb78;
}

.selected-holder-display {
  display: grid;
  justify-items: end;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #c8a85a;
  border-radius: 12px 4px;
  background: rgb(255 255 255 / 52%);
}

.selected-holder-display span {
  color: #725d2e;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.selected-holder-display strong {
  color: var(--teal-900);
  font-size: .78rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(360px, 1.18fr);
  gap: 14px;
  min-width: 0;
}

.word-bank-panel,
.sentence-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #cfb36e;
  border-radius: 16px 5px;
  background: rgb(255 255 255 / 52%);
}

.subheading-row h3,
.answer-panel h3 {
  color: var(--teal-900);
  font-size: 1rem;
}

.token-count {
  padding: 3px 8px;
  border-radius: 999px;
  color: #6a572b;
  background: #f4e4b7;
  font-size: .63rem;
  font-weight: 900;
}

.builder-instructions {
  margin: 0;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
}

.word-bank {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 128px;
  padding: 10px;
  border: 1px dashed #9b884f;
  border-radius: 12px;
  background: rgb(245 232 194 / 58%);
}

.word-bank.is-drag-over,
.sentence-dropzone.is-drag-over {
  border-color: var(--teal-700);
  background: #e6f6ee;
  box-shadow: inset 0 0 0 3px rgb(7 122 129 / 17%);
}

.word-token {
  min-height: 44px;
  padding: 7px 12px;
  border: 2px solid #c28a24;
  border-radius: 999px;
  color: #fffdf1;
  background: linear-gradient(145deg, #16818b, #075462);
  box-shadow: 0 3px 0 #073d49, 0 6px 12px rgb(2 43 49 / 19%), inset 0 1px 0 rgb(255 255 255 / 22%);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .015em;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: filter 140ms ease, transform 140ms ease;
}

.word-token:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.word-token:active {
  cursor: grabbing;
  transform: translateY(2px);
}

.word-token[aria-pressed="true"],
.word-token.is-used {
  display: none;
}

.text-button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #9b7d3d;
  border-radius: 9px;
  color: var(--teal-900);
  background: #fff9e8;
  font-size: .7rem;
  font-weight: 900;
}

.text-button:disabled {
  color: #7f8380;
  border-color: #b7b2a4;
  background: #e8e3d5;
  opacity: .7;
}

.sentence-dropzone {
  position: relative;
  min-height: 128px;
  padding: 10px;
  border: 2px dashed #9d8142;
  border-radius: 12px 4px;
  background: linear-gradient(135deg, rgb(255 253 244 / 78%), rgb(242 224 178 / 68%));
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.sentence-token-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sentence-token-list:not(:empty) + .sentence-empty-hint {
  display: none;
}

.sentence-empty-hint {
  position: absolute;
  top: 50%;
  right: 12px;
  left: 12px;
  margin: 0;
  color: #857c62;
  font-size: .78rem;
  font-weight: 750;
  text-align: center;
  pointer-events: none;
  transform: translateY(-50%);
}

.sentence-token-item {
  display: grid;
  grid-template-columns: auto auto;
  align-items: stretch;
  min-width: 0;
  border: 2px solid var(--gold-500);
  border-radius: 13px 4px;
  background: #fff9e5;
  box-shadow: 0 4px 10px rgb(63 40 8 / 16%);
}

.sentence-token-label {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--teal-900);
  font-weight: 900;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.app-shell.is-pointer-dragging {
  cursor: grabbing;
  user-select: none;
}

.sentence-token-controls {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  border-left: 1px solid #d1b66e;
}

.sentence-token-controls button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-left: 1px solid #dcc684;
  color: var(--teal-900);
  background: #f5e6b9;
  font-weight: 900;
}

.sentence-token-controls button:first-child {
  border-left: 0;
}

.sentence-token-controls button:hover:not(:disabled) {
  background: #fff1b9;
}

.sentence-token-controls button:disabled {
  color: #8e918a;
  background: #e9e3d3;
}

.sentence-preview-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 11px;
  border: 1px solid #c7aa64;
  border-radius: 11px;
  background: #f7eed4;
}

.preview-label {
  color: #755f2e;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.sentence-preview {
  min-width: 0;
  color: var(--teal-900);
  font-size: clamp(.84rem, 1.5vw, 1.08rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.submit-question-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px;
  min-height: 61px;
  padding: 9px 15px;
  color: #fffdf1;
  background: linear-gradient(145deg, #d96147, #98342d);
  text-align: left;
}

.submit-question-button > span:first-child {
  display: grid;
  place-items: center;
  width: 35px;
  aspect-ratio: 1;
  border: 2px solid #fff0a8;
  border-radius: 50%;
  color: #fff3aa;
}

.submit-question-button > span:last-child {
  display: grid;
}

.submit-question-button strong {
  font-size: .94rem;
}

.submit-question-button small {
  color: rgb(255 255 235 / 76%);
  font-size: .63rem;
}

.answer-and-guess {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(245px, .65fr);
  gap: 14px;
  min-width: 0;
}

.answer-panel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-height: 112px;
  padding: 13px;
  border: 1px solid #c9ad68;
  border-radius: 15px 5px;
  background: rgb(255 255 255 / 58%);
}

.answer-icon {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 3px double var(--gold-500);
  border-radius: 50%;
  color: #fff8cc;
  background: var(--teal-800);
  font-weight: 900;
}

.asked-question,
.answer-amis,
.answer-zh {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.asked-question {
  color: #6b5b38;
  font-size: .72rem;
  font-weight: 800;
}

.answer-amis {
  color: var(--teal-900);
  font-size: clamp(.93rem, 1.7vw, 1.2rem);
  font-weight: 900;
}

.answer-zh {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}

.guess-panel {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid #c6aa64;
  border-radius: 15px 5px;
  background: linear-gradient(145deg, rgb(237 249 240 / 80%), rgb(221 235 216 / 80%));
}

.guess-panel p {
  margin: 0;
  color: #49625d;
  font-size: .7rem;
  font-weight: 750;
}

.guess-actions {
  display: grid;
  gap: 8px;
}

.guess-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 55px;
  padding: 9px 13px;
  color: #fffbea;
  background: linear-gradient(145deg, #2a876e, #155442);
}

.guess-button > span:first-child {
  font-size: 1.45rem;
}

.guess-button[aria-pressed="true"] {
  color: var(--navy-950);
  border-color: #fff3a7;
  background: linear-gradient(145deg, #ffe897, #e5ae39);
  box-shadow: 0 0 0 4px rgb(255 224 103 / 28%), 0 8px 20px rgb(3 39 45 / 28%);
}

.secondary-button,
.quiet-button {
  min-height: 48px;
  padding: 8px 13px;
  color: var(--teal-900);
  background: #fff9e8;
}

.feedback-toast {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  max-width: min(410px, calc(100vw - 36px));
  min-height: 0;
  padding: 0;
  border-radius: 14px 5px;
  color: #fff;
  background: var(--teal-900);
  box-shadow: 0 14px 34px rgb(0 0 0 / 38%);
  font-weight: 800;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.feedback-toast:not(:empty) {
  min-height: 50px;
  padding: 12px 16px;
  opacity: 1;
  transform: translateY(0);
}

.feedback-toast[data-feedback="wrong"],
.feedback-toast[data-feedback="error"] {
  border: 2px solid #ffd69c;
  background: var(--danger);
}

.feedback-toast[data-feedback="success"] {
  border: 2px solid #ffe68a;
  background: var(--success);
}

/* Dialogs */

.game-dialog {
  width: min(92vw, 720px);
  max-height: min(90vh, 850px);
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.game-dialog::backdrop {
  background: rgb(1 24 31 / 80%);
  backdrop-filter: blur(6px);
}

.dialog-frame {
  position: relative;
  max-height: min(90vh, 850px);
  overflow: auto;
  border: 4px double var(--gold-500);
  border-radius: 28px 9px;
  background:
    radial-gradient(circle at 50% 0, #fff 0, transparent 42%),
    linear-gradient(135deg, #fffdf4, #f1ddaa 65%, #fff8df);
  box-shadow: 0 0 0 3px var(--teal-900), 0 30px 82px rgb(0 0 0 / 52%), inset 0 0 40px rgb(176 104 14 / 11%);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px 14px;
  border-bottom: 1px solid #d2b66f;
}

.dialog-header h2,
.pause-body h2,
.success-heading h2 {
  color: var(--teal-900);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.dialog-close-button {
  flex: 0 0 48px;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 2px solid var(--gold-300);
  border-radius: 50%;
  color: #fff;
  background: var(--teal-900);
  box-shadow: 0 0 0 1px var(--gold-700);
  font-size: 1.65rem;
}

.dialog-close-button:hover {
  background: var(--teal-700);
}

.dialog-body {
  padding: 20px 24px;
}

.rule-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-steps li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #d5ba77;
  border-radius: 14px 5px;
  background: rgb(255 255 255 / 54%);
}

.rule-steps li > span {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 2px solid var(--gold-300);
  border-radius: 50%;
  color: #fff;
  background: var(--teal-800);
  font-weight: 900;
}

.rule-steps strong {
  color: var(--teal-900);
}

.rule-steps p,
.interaction-callout p,
.review-callout {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.6;
}

.interaction-callout,
.review-callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
}

.interaction-callout {
  border: 1px solid #d0b36d;
  background: #fff8df;
}

.interaction-callout h3 {
  color: var(--teal-900);
  font-size: 1rem;
}

.review-callout {
  border: 1px solid #73a88f;
  border-left: 5px solid var(--success);
  color: #285e50;
  background: #e9f8ef;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 22px;
  border-top: 1px solid #d2b66f;
}

.dialog-footer-split {
  justify-content: space-between;
}

.primary-dialog-button {
  min-height: 48px;
  padding: 8px 18px;
  color: #fffef1;
  background: linear-gradient(145deg, #16808a, #075360);
}

.compact-dialog {
  width: min(92vw, 500px);
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #d3b873;
  border-radius: 14px 5px;
  background: rgb(255 255 255 / 58%);
  cursor: pointer;
}

.setting-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.setting-row strong {
  color: var(--teal-900);
}

.setting-row small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.45;
}

.setting-row input {
  position: relative;
  flex: 0 0 60px;
  width: 60px;
  height: 44px;
  margin: 0;
  border: 2px solid #81744e;
  border-radius: 999px;
  appearance: none;
  background: #8f9692;
  cursor: pointer;
  transition: background 150ms ease;
}

.setting-row input::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
  content: "";
  transition: transform 150ms ease;
}

.setting-row input:checked {
  border-color: var(--teal-900);
  background: var(--teal-700);
}

.setting-row input:checked::before {
  transform: translateX(18px);
}

.settings-note {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #61583e;
  background: #eee2c3;
  font-size: .72rem;
  font-weight: 750;
}

.pause-frame {
  padding-top: 46px;
  text-align: center;
}

.pause-medallion {
  display: grid;
  place-items: center;
  width: 78px;
  aspect-ratio: 1;
  margin: 0 auto -7px;
  border: 5px double var(--gold-500);
  border-radius: 50%;
  color: #fff6c7;
  background: radial-gradient(circle, #2c8d8b, #07505d 72%);
  box-shadow: 0 0 24px rgb(255 219 96 / 34%);
  font-size: 1.6rem;
  font-weight: 900;
}

.pause-body p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.success-dialog {
  width: min(92vw, 640px);
  text-align: center;
}

.success-dialog .dialog-frame {
  padding-top: 53px;
  overflow: hidden auto;
}

.success-rays {
  position: absolute;
  z-index: 0;
  top: -165px;
  left: 50%;
  width: 500px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 205 60 / 20%) 0 10deg, transparent 10deg 20deg);
  animation: slow-turn 18s linear infinite;
  pointer-events: none;
  transform: translateX(-50%);
}

.success-medal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 88px;
  aspect-ratio: 1;
  margin: 0 auto 13px;
  border: 5px double #9f6410;
  border-radius: 50%;
  color: #fff8c5;
  background: radial-gradient(circle, #ffdf69 0 45%, #e9a12a 47% 70%, #925410 72%);
  box-shadow: 0 8px 20px rgb(102 54 4 / 30%), 0 0 30px rgb(255 206 52 / 50%);
  font-size: 2.4rem;
  animation: medal-arrive 620ms cubic-bezier(.15, .9, .25, 1.25) both;
}

.success-heading,
.success-reveal,
.success-dialog .language-note,
.success-dialog .dialog-footer {
  position: relative;
  z-index: 1;
}

.success-heading > p:last-child {
  margin: 8px 22px 0;
  color: var(--muted);
  font-weight: 700;
}

.success-reveal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 24px 5px;
}

.success-result {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-height: 105px;
  padding: 15px;
  border: 2px solid var(--gold-500);
  border-radius: 15px 5px;
  background: linear-gradient(145deg, #fffef5, #f0d683);
  box-shadow: var(--gold-shadow);
  overflow-wrap: anywhere;
}

.success-dialog .dialog-footer {
  margin-top: 16px;
}

.noscript-message {
  position: fixed;
  z-index: 4000;
  right: 12px;
  bottom: 12px;
  left: 12px;
  margin: 0;
  padding: 13px 18px;
  border: 2px solid #fff1a8;
  border-radius: 10px;
  color: #fff;
  background: var(--danger);
  box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
  font-weight: 800;
  text-align: center;
}

/* Controller state hooks */

.app-shell[data-game-state="guessing"] .holder-card:not(.is-locked) {
  animation: guess-pulse 1.55s ease-in-out infinite;
}

.app-shell.is-dealing .holder-card {
  animation: deal-arrive 480ms cubic-bezier(.2, .8, .25, 1) both;
}

.app-shell.is-dealing .holder-card:nth-child(2) { animation-delay: 55ms; }
.app-shell.is-dealing .holder-card:nth-child(3) { animation-delay: 110ms; }
.app-shell.is-dealing .holder-card:nth-child(4) { animation-delay: 165ms; }
.app-shell.is-dealing .holder-card:nth-child(5) { animation-delay: 220ms; }
.app-shell.is-dealing .holder-card:nth-child(6) { animation-delay: 275ms; }

.app-shell.is-revealing-mission .mission-panel {
  animation: mission-reveal 560ms cubic-bezier(.2, .85, .3, 1) both;
}

@keyframes slow-turn {
  from { transform: translateX(-50%) rotate(0); }
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes halo-breathe {
  0%, 100% { opacity: .7; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes sparkle {
  0%, 100% { opacity: .25; transform: translateY(0) rotate(45deg) scale(.7); }
  50% { opacity: 1; transform: translateY(-14px) rotate(135deg) scale(1.15); }
}

@keyframes reveal-card {
  from { opacity: 0; transform: rotateY(78deg) scale(.86); }
  to { opacity: 1; }
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px) rotate(-1deg); }
  50% { transform: translateX(6px) rotate(1deg); }
  75% { transform: translateX(-3px); }
}

@keyframes guess-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #88550e, 0 9px 20px rgb(0 25 31 / 30%); }
  50% { box-shadow: 0 0 0 5px #ffe17e, 0 12px 25px rgb(0 25 31 / 38%), 0 0 22px rgb(255 225 111 / 42%); }
}

@keyframes deal-arrive {
  0% { opacity: .3; transform: translateY(18px) rotate(-1deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes mission-reveal {
  0% { opacity: .4; transform: rotateY(65deg) scale(.95); }
  100% { opacity: 1; transform: rotateY(0) scale(1); }
}

@keyframes medal-arrive {
  from { opacity: 0; transform: translateY(-28px) rotate(-18deg) scale(.5); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

/* Responsive */

@media (max-width: 1160px) {
  .game-header {
    grid-template-columns: minmax(175px, .75fr) minmax(360px, 1.45fr) auto;
  }

  .header-button-text {
    display: none;
  }

  .header-button {
    width: 46px;
    padding: 0;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .mission-panel {
    position: relative;
    top: 0;
    grid-template-columns: minmax(175px, .6fr) minmax(290px, 1fr) minmax(200px, .72fr);
    align-items: center;
    gap: 14px;
    padding: 32px 18px 17px;
    text-align: left;
  }

  .mission-panel > .panel-kicker,
  .mission-panel > h2,
  .mission-explanation {
    grid-column: 1;
  }

  .mission-placeholder,
  .mission-reveal {
    grid-column: 2;
    grid-row: 1 / span 3;
    min-height: 0;
  }

  .mission-story {
    grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.2fr);
    align-items: center;
  }

  .mission-clues {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mission-placeholder {
    grid-template-columns: 58px 1fr;
    align-items: center;
    justify-items: start;
  }

  .mystery-orb {
    width: 58px;
    font-size: 1.7rem;
  }

  .mission-actions {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
}

@media (max-width: 850px) {
  .menu-screen {
    align-items: end;
    padding-bottom: 72px;
  }

  .game-header {
    position: relative;
    top: 0;
    grid-template-columns: 1fr auto;
    gap: 9px;
  }

  .progress-steps {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .mission-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .mission-panel > .panel-kicker,
  .mission-panel > h2,
  .mission-explanation,
  .mission-placeholder,
  .mission-reveal,
  .mission-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .mission-placeholder {
    grid-template-columns: 58px 1fr;
    text-align: left;
  }

  .mission-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .holder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-grid,
  .answer-and-guess {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .menu-screen {
    padding-right: 14px;
    padding-left: 14px;
    background-position: 50% center;
  }

  .menu-screen::before {
    inset: 9px;
    border-radius: 26px 8px;
  }

  .title-plaque {
    padding-right: 20px;
    padding-left: 20px;
    border-radius: 30px 9px;
  }

  .title-plaque::before,
  .title-plaque::after {
    width: 31px;
    height: 62px;
  }

  .title-plaque::before { left: -17px; }
  .title-plaque::after { right: -17px; }

  .menu-actions {
    width: min(94%, 500px);
  }

  .ornate-button {
    min-height: 64px;
    padding: 8px 15px;
  }

  .game-screen {
    padding: 8px 7px 26px;
  }

  .game-header {
    border-radius: 15px 5px;
  }

  .compact-brand small {
    font-size: .54rem;
  }

  .step-label {
    font-size: .6rem;
  }

  .mission-panel,
  .holders-section,
  .question-workbench {
    border-radius: 18px 6px;
  }

  .mission-actions {
    grid-template-columns: 1fr;
  }

  .section-heading-row,
  .workbench-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .section-hint {
    text-align: left;
  }

  .selected-holder-display {
    width: 100%;
    justify-items: start;
  }

  .holders-section,
  .question-workbench {
    padding: 11px;
  }

  .holder-grid {
    gap: 9px;
  }

  .holder-meta {
    padding: 7px 6px 9px;
  }

  .holder-meta strong {
    font-size: .83rem;
  }

  .holder-state {
    font-size: .59rem;
  }

  .word-bank-panel,
  .sentence-panel {
    padding: 11px;
  }

  .sentence-token-item {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sentence-token-label {
    justify-content: start;
  }

  .sentence-preview-wrap {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .game-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .dialog-frame {
    max-height: calc(100dvh - 18px);
    border-radius: 20px 7px;
  }

  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-right: 15px;
    padding-left: 15px;
  }

  .rule-steps {
    grid-template-columns: 1fr;
  }

  .dialog-footer-split {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-footer button {
    width: 100%;
  }

  .success-reveal {
    grid-template-columns: 1fr;
    margin-right: 15px;
    margin-left: 15px;
  }
}

@media (max-width: 420px) {
  .menu-stage {
    width: calc(100% - 8px);
  }

  .title-plaque h1 {
    letter-spacing: .04em;
  }

  .button-copy strong {
    font-size: 1.08rem;
  }

  .button-copy small,
  .menu-feature small {
    display: none;
  }

  .ornate-button {
    min-height: 58px;
  }

  .brand-seal {
    display: none;
  }

  .compact-brand strong {
    font-size: 1rem;
  }

  .mission-placeholder {
    grid-template-columns: 50px 1fr;
  }

  .mission-story,
  .mission-clues {
    grid-template-columns: 1fr;
  }

  .mystery-orb {
    width: 50px;
  }

  .face-up-layer {
    right: 32%;
    left: 32%;
  }

  .setting-row {
    align-items: flex-start;
  }
}

@media (max-width: 340px) {
  .holder-grid {
    grid-template-columns: 1fr;
  }

  .holder-card {
    width: min(100%, 310px);
    margin-inline: auto;
  }

  .sentence-token-controls {
    grid-template-columns: repeat(3, 42px);
  }

  .sentence-token-controls button {
    min-width: 42px;
  }
}

@media (max-height: 720px) and (min-width: 851px) {
  .menu-screen {
    padding-top: 18px;
    padding-bottom: 52px;
  }

  .menu-emblem {
    transform: scale(.84);
    transform-origin: bottom center;
  }

  .title-plaque {
    padding-top: 39px;
    padding-bottom: 20px;
  }

  .title-plaque h1 {
    font-size: clamp(2.4rem, 7vh, 3.9rem);
  }

  .language-note {
    margin-top: 9px;
  }

  .menu-actions {
    gap: 8px;
    margin-top: 14px;
  }

  .ornate-button {
    min-height: 58px;
  }

  .menu-feature {
    margin-top: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.app-shell[data-motion="reduced"] *,
.app-shell[data-motion="reduced"] *::before,
.app-shell[data-motion="reduced"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

@media (forced-colors: active) {
  .menu-screen,
  .game-backdrop,
  .holder-art {
    background-image: none;
  }

  .title-plaque,
  .ornate-panel,
  .holder-card,
  .game-header,
  .dialog-frame,
  .ornate-button,
  .word-token,
  .action-button,
  .submit-question-button,
  .guess-button {
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .holder-card.is-selected {
    outline: 5px solid Highlight;
  }
}
