* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f5ef;
  --bg-2: #e6f2f2;
  --ink: #061b42;
  --muted: #486078;
  --panel: rgba(255, 253, 246, 0.88);
  --panel-strong: #fffdf6;
  --line: rgba(6, 27, 66, 0.14);
  --green: #0aaeb2;
  --green-soft: #d7f5f3;
  --gold: #ffbb18;
  --rust: #ff4e45;
  --rust-soft: #ffe1de;
  --blue: #0a3f7a;
  --blue-soft: #dcebf5;
  --navy: #061b42;
  --teal: #0aaeb2;
  --coral: #ff4e45;
  --cream: #fff8e8;
  --shadow: 0 22px 64px rgba(6, 27, 66, 0.16);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(255, 78, 69, 0.16), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(10, 174, 178, 0.18), transparent 36%),
    radial-gradient(circle at 50% 120%, rgba(255, 187, 24, 0.15), transparent 45%),
    linear-gradient(180deg, #fffdf7 0%, #eaf5f4 58%, #f8f6ed 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 14px auto 32px;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(255, 78, 69, 0.15), transparent 34%),
    linear-gradient(240deg, rgba(10, 174, 178, 0.2), transparent 38%),
    linear-gradient(180deg, #fffdf8 0%, #e7f4f3 56%, #fff6dc 100%);
}

.splash-screen.is-hidden {
  display: none;
}

.splash-motion {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.splash-motion::before,
.splash-motion::after {
  content: '';
  position: absolute;
  inset: -20%;
  opacity: 0.48;
}

.splash-motion::before {
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.46) 44%, transparent 48% 100%),
    repeating-linear-gradient(90deg, rgba(36, 92, 255, 0.06) 0 2px, transparent 2px 88px),
    repeating-linear-gradient(0deg, rgba(15, 157, 104, 0.06) 0 2px, transparent 2px 88px);
  animation: splashGridDrift 18s linear infinite, splashBeamSweep 7s ease-in-out infinite alternate;
}

.splash-motion::after {
  background: conic-gradient(from 90deg at 50% 50%, rgba(242, 187, 47, 0.24), rgba(36, 92, 255, 0.12), rgba(15, 157, 104, 0.2), rgba(242, 187, 47, 0.24));
  filter: blur(70px);
  animation: splashGlowTurn 16s ease-in-out infinite alternate;
}

.splash-motion span {
  position: absolute;
  width: 220px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(9, 31, 50, 0.08);
  background: rgba(255, 255, 255, 0.24);
  transform: rotate(-12deg);
  animation: splashTileFloat 9s ease-in-out infinite;
}

.splash-motion span:nth-child(1) {
  left: 7%;
  top: 18%;
}

.splash-motion span:nth-child(2) {
  right: 9%;
  top: 12%;
  animation-delay: -3s;
  transform: rotate(10deg);
}

.splash-motion span:nth-child(3) {
  right: 18%;
  bottom: 13%;
  animation-delay: -5s;
}

.splash-float {
  position: absolute;
  z-index: 1;
  color: rgba(9, 31, 50, 0.72);
  box-shadow: 0 18px 45px rgba(7, 30, 52, 0.11);
  user-select: none;
}

.splash-float-card {
  min-width: 118px;
  padding: 14px 18px;
  border: 1px solid rgba(9, 31, 50, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 251, 255, 0.54)),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(36, 92, 255, 0.08) 21px 22px);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  animation: splashCardDrift 12s ease-in-out infinite;
}

.splash-float-chip {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 255, 0.16);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation: splashChipOrbit 10s ease-in-out infinite;
}

.splash-float:nth-of-type(1) {
  left: 9%;
  bottom: 18%;
  transform: rotate(-8deg);
}

.splash-float:nth-of-type(2) {
  left: 26%;
  top: 10%;
  animation-delay: -4s;
  transform: rotate(7deg);
}

.splash-float:nth-of-type(3) {
  right: 7%;
  bottom: 27%;
  animation-delay: -7s;
  transform: rotate(5deg);
}

.splash-float:nth-of-type(4) {
  left: 4%;
  top: 44%;
  animation-delay: -2s;
}

.splash-float:nth-of-type(5) {
  right: 14%;
  top: 31%;
  animation-delay: -5s;
}

.splash-float:nth-of-type(6) {
  left: 39%;
  bottom: 8%;
  animation-delay: -7s;
}

.splash-float:nth-of-type(7) {
  right: 31%;
  top: 8%;
  animation-delay: -3s;
}

.splash-card {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
  display: grid;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(6, 27, 66, 0.16);
  border-radius: 28px;
  background: rgba(255, 253, 246, 0.86);
  box-shadow: 0 28px 90px rgba(6, 27, 66, 0.22);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.splash-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.38) 44%, transparent 54% 100%);
  transform: translateX(-70%);
  animation: splashCardShine 7s ease-in-out infinite;
  pointer-events: none;
}

.splash-main {
  position: relative;
}

.splash-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.splash-logo {
  width: clamp(150px, 21vw, 215px);
  height: auto;
  border-radius: 23%;
  filter: drop-shadow(0 18px 28px rgba(6, 27, 66, 0.2));
}

.splash-card h1 {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--navy);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.splash-lede {
  max-width: 64ch;
  margin: 16px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.45;
}

.splash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.splash-actions .button {
  min-width: 170px;
  font-weight: 800;
}

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

.splash-mode-card,
.splash-join-card {
  width: 100%;
  border: 1px solid rgba(9, 31, 50, 0.11);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(7, 30, 52, 0.1);
}

.splash-mode-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.splash-mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 92, 255, 0.32);
  box-shadow: 0 22px 46px rgba(7, 30, 52, 0.15);
}

.splash-mode-primary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 76px;
  margin-bottom: 5px;
  border: 1px solid #067a82;
  border-bottom-width: 3px;
  background: linear-gradient(180deg, #17bdc0 0%, #07949d 100%);
  color: white;
  text-align: center;
  box-shadow:
    0 7px 0 #065c69,
    0 15px 30px rgba(6, 97, 107, 0.3);
  transform: translateY(0);
}

.splash-mode-primary:hover {
  border-color: #067a82;
  box-shadow:
    0 9px 0 #065c69,
    0 19px 34px rgba(6, 97, 107, 0.34);
  transform: translateY(-2px);
}

.splash-mode-primary:active {
  box-shadow:
    0 2px 0 #065c69,
    0 7px 16px rgba(6, 97, 107, 0.24);
  transform: translateY(5px);
}

.splash-mode-primary:focus-visible {
  outline: 4px solid rgba(10, 174, 178, 0.28);
  outline-offset: 5px;
}

.splash-mode-card.splash-mode-primary strong {
  margin: 0;
  font-size: clamp(21px, 3vw, 28px);
}

.splash-primary-arrow {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 24px;
  line-height: 1;
}

.splash-join-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border-color: rgba(255, 78, 69, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 225, 222, 0.58));
}

#hostMultiplayerBtn {
  border-color: rgba(255, 187, 24, 0.42);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 239, 190, 0.78));
}

.splash-join-card strong {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.splash-join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.splash-room-code {
  text-transform: uppercase;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mode-kicker {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.splash-mode-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.splash-mode-card small {
  display: block;
  color: inherit;
  opacity: 0.76;
  font-size: 13px;
  line-height: 1.35;
}

.splash-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.72fr);
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(215, 245, 243, 0.62);
  border: 1px solid rgba(10, 174, 178, 0.2);
}

.splash-focus h2 {
  margin: 0 0 7px;
  font-size: clamp(22px, 3vw, 30px);
}

.splash-focus p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.splash-teacher-note {
  margin: 10px 0 0;
  color: #38566e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.splash-focus-controls {
  display: grid;
  gap: 8px;
}

.splash-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.splash-tags span {
  border: 1px solid rgba(36, 92, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #294c76;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: panelRise 520ms ease both;
}

.hero-panel {
  border-radius: 20px;
  border-top: 5px solid var(--navy);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.hero-panel {
  animation-delay: 90ms;
}

.app-grid > * {
  animation: panelRise 560ms ease both;
}

.app-grid > *:nth-child(2) {
  animation-delay: 120ms;
}

.app-grid > *:nth-child(3) {
  animation-delay: 180ms;
}

.app-grid > *:nth-child(4) {
  animation-delay: 240ms;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--muted);
}

h1,
h2,
h3,
strong {
  font-family: 'Sora', sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 0.95;
}

.hero-brand-mark {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  max-width: 760px;
  margin-bottom: 8px;
}

.hero-logo-icon {
  display: block;
  width: clamp(74px, 8vw, 96px);
  height: auto;
  border-radius: 22%;
  filter: drop-shadow(0 14px 22px rgba(6, 27, 66, 0.2));
}

.hero-brand-copy {
  display: grid;
  gap: 6px;
}

.hero-brand-copy h1 {
  font-size: clamp(27px, 3.4vw, 38px);
}

.hero-brand-subtitle {
  margin: 0;
  font-size: clamp(13px, 1.6vw, 18px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.hero-mode-label {
  width: fit-content;
  margin: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green-soft);
  color: #076c73;
  font-size: 12px;
  font-weight: 800;
}

.hero-text {
  max-width: 62ch;
  margin: 6px 0 10px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: end;
}

.meta-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}

.xp-wrap p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.xp-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 32, 42, 0.08);
}

.xp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold) 52%, var(--teal) 100%);
  width: 4%;
  transition: width 0.45s ease;
}

.hero-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.profile-drawer {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  animation: profileDrawerIn 220ms ease both;
}

.profile-drawer.hidden {
  display: none;
}

.name-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.name-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.name-card input {
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button-row-main {
  grid-template-columns: 1.25fr 1fr 1fr;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button {
  border: 0;
  border-radius: 12px;
  padding: 10px 13px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.ui-press {
  animation: uiPress 180ms ease;
}

.ui-pop {
  animation: uiPop 260ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, #07356c, #0a4b88 55%, #0aaeb2);
  color: white;
  box-shadow: 0 16px 30px rgba(6, 27, 66, 0.24);
}

.button-secondary {
  background: linear-gradient(135deg, #fffdf7, #e4eff2);
  color: var(--ink);
}

.button-menu {
  border-bottom: 3px solid #00102b;
  background: linear-gradient(180deg, #0b2d5c, #061b42);
  color: white;
  box-shadow: 0 7px 16px rgba(6, 27, 66, 0.22);
  font-weight: 800;
}

.button-menu:hover {
  box-shadow: 0 9px 20px rgba(6, 27, 66, 0.28);
}

.button-reset {
  border: 1px solid rgba(255, 78, 69, 0.24);
  background: var(--rust-soft);
  color: #8e241f;
}

.button.is-muted {
  background: linear-gradient(135deg, #f7f8fa, #e6ebf2);
  color: var(--muted);
}

.button.mp-ready-reminder {
  background: linear-gradient(135deg, #ff7a59, #dd2f6e);
  color: #fff;
  box-shadow: 0 16px 30px rgba(221, 47, 110, 0.3);
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.app-grid:not(.mp-mode) {
  grid-template-columns: minmax(0, 1fr);
}

.app-grid:not(.mp-mode) .question-panel,
.app-grid.progress-open:not(.mp-mode) .sidebar-stack {
  width: min(1100px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.app-grid:not(.mp-mode) .sidebar-stack,
.app-grid:not(.mp-mode) .rail-panel {
  display: none;
}

.app-grid.progress-open:not(.mp-mode) .sidebar-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-grid.progress-open:not(.mp-mode) .rail-panel {
  display: block;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, auto)) minmax(220px, 1fr) 58px auto;
  gap: 9px;
  align-items: stretch;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hud-stat {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
}

.hud-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hud-stat strong {
  margin-top: 2px;
  color: var(--navy);
  font-size: 21px;
}

.hud-stat-lives strong {
  color: var(--coral);
}

.hud-stat-lives strong::after {
  content: ' ♥';
  font-size: 0.72em;
}

.hud-stat-streak.is-hot {
  border-color: rgba(255, 187, 24, 0.5);
  background: #fff5cf;
}

.hud-stat-streak.is-hot strong::after {
  content: ' 🔥';
  font-family: 'Manrope', sans-serif;
}

.hud-xp {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px 4px;
}

.hud-xp p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-toggle {
  min-height: 58px;
  font-weight: 900;
}

.scoreboard-toggle {
  display: grid;
  place-items: center;
  width: 58px;
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  color: #8a5a00;
  background: #fff5cf;
}

.scoreboard-toggle:hover {
  background: #ffe9a1;
  color: #634000;
}

.scoreboard-toggle svg {
  width: 26px;
  height: 26px;
  fill: rgba(255, 187, 24, 0.28);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.progress-toggle[aria-expanded="true"] {
  background: var(--green-soft);
  color: #076c73;
}

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

.question-panel,
.rail-panel,
.achievement-panel,
.feed-panel,
.stat-panel,
.leaderboard-panel {
  border-radius: 18px;
  padding: 16px;
}

.question-panel {
  min-height: 0;
  border-top: 5px solid var(--teal);
}

.study-mode-select {
  width: 100%;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}

.question-head h2,
.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.08;
}

.question-head p,
.section-head p,
#questionHelper {
  color: var(--muted);
}

.question-hint {
  margin-top: 8px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.question-stage {
  margin-top: 14px;
      padding: 35px;
}
.question-head{
      padding-left: 35px;
    padding-right: 35px;
}
#submitAnswerBtn{
      margin-left: auto;
    margin-right: auto;
    display: block;
}

.run-summary-card {
  border-radius: 24px;
  border: 1px solid rgba(23, 32, 42, 0.14);
  background: linear-gradient(160deg, #f8fbff, #e9f2ff 60%, #dce9ff);
  padding: 22px;
  box-shadow: 0 18px 36px rgba(17, 50, 82, 0.12);
}

.run-summary-kicker {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #516f89;
}

.run-summary-card h3 {
  margin: 8px 0 14px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.02;
}

.run-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.run-summary-stat {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(23, 32, 42, 0.1);
  padding: 12px;
}

.run-summary-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 8px;
}

.run-summary-stat strong {
  font-size: 30px;
  line-height: 1;
}

.run-summary-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.run-summary-actions {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.summary-name-card {
  display: grid;
  gap: 8px;
}

.summary-name-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.summary-name-card input {
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
}

.summary-buttons {
  grid-template-columns: 1.2fr 1fr;
}

#gameOverSaveNameBtn {
  background: linear-gradient(135deg, #d8e6ff, #bcd3ff);
  border: 1px solid rgba(36, 92, 255, 0.34);
  color: #0b2f7f;
  box-shadow: 0 10px 22px rgba(36, 92, 255, 0.14);
}

#gameOverSaveNameBtn:hover {
  background: linear-gradient(135deg, #cfe0ff, #aec9ff);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer-option,
.sequence-item {
  border: 1px solid rgba(23, 32, 42, 0.1);
  background: white;
  border-radius: 20px;
  padding: 18px;
  font-size: 18px;
  text-align: left;
  box-shadow: 0 12px 24px rgba(17, 50, 82, 0.08);
}

.answer-option {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.answer-option.selected {
  background: var(--green-soft);
  border-color: rgba(15, 106, 77, 0.34);
  animation: selectedPulse 340ms ease;
}

.question-ready {
  animation: questionReady 620ms ease;
}

.sequence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.sequence-item {
  display: flex;
  gap: 16px;
  align-items: center;
  cursor: grab;
}

.sequence-item.dragging {
  opacity: 0.45;
}

.sequence-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--blue-soft);
  color: var(--blue);
}

.sequence-controls {
  display: flex;
  gap: 6px;
}

.seq-btn {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

#submitAnswerBtn {
  min-width: 190px;
  min-height: 48px;
  font-weight: 900;
}

.rail-panel {
  margin-top: 32px;
}

.text-answer-wrap {
  max-width: 520px;
}

.typed-answer {
  width: 100%;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 20px;
  background: white;
}

.result-banner {
  display: block;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid currentColor;
  border-radius: 18px;
}

.result-banner.hidden {
  display: none;
}

.result-banner strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.result-good {
  background: var(--green-soft);
  color: var(--green);
}

.result-bad {
  background: var(--rust-soft);
  color: var(--rust);
}

.answer-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-review-option {
  display: grid;
  gap: 6px;
  min-height: 68px;
  align-content: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.answer-review-option span {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.answer-review-option small {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer-review-option.is-correct,
.answer-review-comparison .is-correct {
  border-color: rgba(10, 174, 178, 0.48);
  background: var(--green-soft);
  color: #076c73;
  box-shadow: 0 10px 24px rgba(10, 174, 178, 0.12);
}

.answer-review-option.is-incorrect {
  border-color: rgba(255, 78, 69, 0.4);
  background: var(--rust-soft);
  color: #9d2c25;
}

.answer-review-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-review-comparison > div {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.answer-review-comparison span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.answer-review-gains {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.answer-review-gains span {
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff3c4;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.answer-review-detail {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.question-panel.is-answer-review {
  border-top-color: var(--gold);
}

.question-panel.is-boss-question {
  border-top-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(255, 187, 24, 0.12),
    var(--shadow);
}

.question-panel.is-boss-question .question-head .eyebrow {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff0b4;
  color: #745100;
  font-weight: 900;
}

.boss-arena {
  position: relative;
  margin: 18px 0 8px;
  border: 1px solid rgba(126, 78, 8, 0.2);
  border-radius: 22px;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 210, 91, 0.28), transparent 42%),
    linear-gradient(145deg, #fff7d7, #f8e5aa 56%, #efd18a);
  box-shadow: inset 0 -10px 26px rgba(126, 78, 8, 0.08);
  isolation: isolate;
}

.boss-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .34;
  background-image:
    linear-gradient(115deg, transparent 28%, rgba(255,255,255,.62) 42%, transparent 56%),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(126,78,8,.05) 43px 44px);
  transform: translateX(-35%);
  animation: bossArenaShimmer 7s ease-in-out infinite;
}

.boss-arena-head,
.boss-arena-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.boss-arena-head h3 {
  margin: 2px 0 0;
  color: #4e3005;
  font-family: var(--display-font);
  font-size: clamp(20px, 3vw, 28px);
}

.boss-arena-head .eyebrow {
  margin: 0;
  color: #8a5c08;
}

.boss-health-wrap {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: #745100;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.boss-health {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.boss-hit-pip {
  display: block;
  width: 30px;
  height: 12px;
  border: 2px solid rgba(120, 71, 4, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 2px 4px rgba(120, 71, 4, 0.12);
}

.boss-hit-pip.is-hit {
  border-color: #c53d30;
  background: #e45c46;
  box-shadow: 0 0 0 3px rgba(197, 61, 48, 0.13);
}

.boss-hit-pip.is-fresh-hit {
  animation: bossHealthHit 760ms cubic-bezier(.2, .8, .2, 1) 760ms both;
}

.boss-arena-body {
  min-height: 318px;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.boss-battlefield {
  position: relative;
  width: 100%;
  min-height: 274px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), transparent 58%),
    linear-gradient(0deg, rgba(167,112,25,.12), transparent 38%);
}

.boss-sun {
  position: absolute;
  top: 22px;
  right: 12%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 242, 167, .85);
  box-shadow: 0 0 34px 16px rgba(255, 218, 94, .26);
  animation: bossSunPulse 3.4s ease-in-out infinite;
}

.boss-ground {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -24px;
  height: 76px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #d1a452, #aa7429);
  box-shadow: inset 0 8px 0 rgba(255,255,255,.15);
}

.boss-ground::before,
.boss-ground::after {
  content: "";
  position: absolute;
  width: 78px;
  height: 12px;
  border-radius: 50%;
  background: rgba(94, 57, 11, .2);
}

.boss-ground::before { left: 12%; top: 18px; }
.boss-ground::after { right: 18%; top: 30px; transform: scale(.72); }

.boss-dust {
  position: absolute;
  z-index: 1;
  bottom: 36px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 236, 176, .74);
  box-shadow: 14px 4px 0 rgba(255, 236, 176, .56), 27px -2px 0 rgba(255, 236, 176, .46);
}

.boss-dust-one { left: 18%; animation: bossDustDrift 4.8s ease-in infinite; }
.boss-dust-two { right: 24%; animation: bossDustDrift 5.6s ease-in 1.7s infinite; }

.boss-player {
  position: absolute;
  left: 12%;
  bottom: 44px;
  z-index: 3;
  width: 66px;
  height: 112px;
  transform-origin: 50% 100%;
  animation: bossPlayerReady 2.2s ease-in-out infinite;
}

.boss-player-head,
.boss-player-body,
.boss-player-arm,
.boss-player-sling {
  position: absolute;
  display: block;
}

.boss-player-head {
  top: 6px;
  left: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 45% 45%;
  background: #6b3f18;
  box-shadow: inset -5px -2px rgba(40, 22, 8, .18);
}

.boss-player-head::before {
  content: "";
  position: absolute;
  inset: -5px -3px 12px;
  border-radius: 50% 50% 30% 30%;
  background: #184f75;
}

.boss-player-body {
  top: 31px;
  left: 20px;
  width: 31px;
  height: 59px;
  border-radius: 12px 12px 7px 7px;
  background: linear-gradient(90deg, #1c6c91, #2e8fb2);
  transform: rotate(4deg);
  box-shadow: inset -8px 0 rgba(10, 50, 74, .14);
}

.boss-player-body::after {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  bottom: 7px;
  height: 9px;
  border-radius: 4px;
  background: #744719;
}

.boss-player-arm {
  top: 36px;
  left: 35px;
  width: 42px;
  height: 9px;
  border-radius: 999px;
  background: #805226;
  transform: rotate(-27deg);
  transform-origin: 0 50%;
}

.boss-player-sling {
  top: 13px;
  left: 67px;
  width: 24px;
  height: 46px;
  border: 2px solid #684116;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(23deg);
}

.boss-player-label {
  position: absolute;
  left: 13px;
  bottom: -18px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #173e5c;
  color: white;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .12em;
}

.boss-figure {
  position: absolute;
  left: 52%;
  bottom: 36px;
  z-index: 2;
  width: min(42vw, 220px);
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: crosshair;
  transform-origin: 50% 92%;
  transform: translateX(-50%);
  transition: transform 500ms cubic-bezier(.2, .8, .2, 1), filter 500ms ease, opacity 500ms ease;
  filter: drop-shadow(0 16px 10px rgba(67, 45, 10, 0.24));
}

.boss-figure:disabled {
  opacity: 1;
  cursor: default;
}

.boss-figure:not(:disabled):hover img {
  filter: brightness(1.04) drop-shadow(0 0 8px rgba(255, 236, 168, .7));
}

.boss-figure:focus-visible {
  outline: 3px solid #245cff;
  outline-offset: 5px;
  border-radius: 20px;
}

.boss-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.boss-figure-wounded {
  transform: translateX(calc(-50% - 7px)) rotate(-6deg) translateY(4px);
}

.boss-figure-wounded img {
  filter: saturate(.82) brightness(.92);
}

.boss-figure-defeated {
  transform: translateX(-42%) rotate(86deg) translate(12px, 26px);
  opacity: .72;
  filter: grayscale(.3) drop-shadow(0 8px 8px rgba(67, 45, 10, 0.2));
}

.boss-aim-marker,
.boss-impact-flash {
  position: absolute;
  left: var(--boss-aim-x);
  top: var(--boss-aim-y);
  width: 34px;
  height: 34px;
  border: 2px solid rgba(197, 61, 48, .94);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.boss-aim-marker::before,
.boss-aim-marker::after {
  content: "";
  position: absolute;
  background: #c53d30;
}

.boss-aim-marker::before {
  left: 50%;
  top: -7px;
  bottom: -7px;
  width: 2px;
  transform: translateX(-50%);
}

.boss-aim-marker::after {
  top: 50%;
  left: -7px;
  right: -7px;
  height: 2px;
  transform: translateY(-50%);
}

.boss-figure.is-aimed .boss-aim-marker {
  opacity: 1;
  animation: bossAimLock 540ms cubic-bezier(.2, .8, .2, 1) both, bossAimBreathe 1.8s ease-in-out 540ms infinite;
}

.boss-projectile {
  position: absolute;
  z-index: 6;
  left: -56%;
  top: 92%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  opacity: 0;
  background: #3e2b18;
  box-shadow: -9px 5px 0 -4px rgba(255,255,255,.8), -18px 10px 0 -5px rgba(255,255,255,.5);
  pointer-events: none;
}

.boss-impact-flash {
  z-index: 7;
  width: 20px;
  height: 20px;
  border: 0;
  background: #fff7d1;
  box-shadow: 0 0 0 8px rgba(255,187,24,.75), 0 0 28px 16px rgba(255,255,255,.8);
}

.boss-impact-word,
.boss-counter-blow {
  position: absolute;
  z-index: 8;
  left: var(--boss-aim-x);
  top: var(--boss-aim-y);
  border-radius: 999px;
  padding: 7px 11px;
  background: #c53d30;
  color: #fff8e5;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg);
}

.boss-counter-blow {
  left: 14%;
  top: 64%;
  background: #64421c;
}

.boss-wound-mark {
  position: absolute;
  display: block;
  width: 42px;
  height: 9px;
  border-radius: 999px;
  background: #c53d30;
  box-shadow: 0 0 0 3px rgba(255, 236, 186, 0.66);
  transform: rotate(-35deg);
  animation: bossWoundFlash 520ms ease both;
}

.boss-wound-mark-one {
  top: 33%;
  left: 35%;
}

.boss-wound-mark-two {
  top: 38%;
  left: 39%;
  width: 28px;
  transform: rotate(45deg);
}

.boss-defeat-burst {
  position: absolute;
  top: 28%;
  left: 44%;
  padding: 8px 12px;
  border-radius: 999px;
  background: #c53d30;
  color: #fff8e5;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  transform: rotate(-8deg);
  box-shadow: 0 6px 14px rgba(126, 37, 25, .24);
  animation: bossDefeatPop 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.boss-arena-hit .boss-player,
.boss-arena-victory .boss-player {
  animation: bossPlayerThrow 820ms cubic-bezier(.2, .8, .2, 1) both;
}

.boss-arena-hit .boss-projectile,
.boss-arena-victory .boss-projectile {
  animation: bossStoneFlight 680ms cubic-bezier(.28, .72, .42, 1) 260ms both;
}

.boss-arena-hit .boss-impact-flash,
.boss-arena-victory .boss-impact-flash {
  animation: bossImpactFlash 420ms ease-out 880ms both;
}

.boss-arena-hit .boss-impact-word {
  animation: bossImpactWord 660ms cubic-bezier(.2, .8, .2, 1) 900ms both;
}

.boss-arena-hit .boss-figure img {
  animation: bossTakesHit 700ms ease 860ms both;
}

.boss-arena-victory .boss-figure-defeated {
  animation: bossFalls 1.12s cubic-bezier(.2, .75, .24, 1) 880ms both;
}

.boss-arena-counter .boss-figure img {
  animation: bossCounterLunge 780ms cubic-bezier(.2, .8, .2, 1) both;
}

.boss-arena-counter .boss-player {
  animation: bossPlayerRecoil 620ms ease 330ms both;
}

.boss-arena-counter .boss-counter-blow {
  animation: bossImpactWord 620ms cubic-bezier(.2, .8, .2, 1) 360ms both;
}

.boss-arena-status {
  max-width: 480px;
  margin: -2px 0 4px;
  color: #60420e;
  font-weight: 850;
  text-align: center;
}

.boss-aim-help {
  margin: -1px 0 2px;
  color: rgba(96, 66, 14, .75);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-align: center;
}

.boss-outcome {
  margin-top: 14px;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff0b4;
  color: var(--navy);
  font-weight: 900;
  text-align: center;
}

.boss-outcome-passed {
  background: var(--green-soft);
  color: #076c73;
}

.boss-outcome-failed {
  background: var(--rust-soft);
  color: #8e241f;
}

@keyframes bossWoundFlash {
  from { opacity: 0; transform: scale(.6) rotate(-35deg); }
  to { opacity: 1; transform: scale(1) rotate(-35deg); }
}

@keyframes bossDefeatPop {
  from { opacity: 0; transform: scale(.6) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(-8deg); }
}

@keyframes bossArenaShimmer {
  0%, 100% { transform: translateX(-35%); }
  50% { transform: translateX(45%); }
}

@keyframes bossSunPulse {
  0%, 100% { transform: scale(.94); opacity: .7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes bossDustDrift {
  0% { opacity: 0; transform: translate(0, 8px) scale(.5); }
  25% { opacity: .72; }
  100% { opacity: 0; transform: translate(60px, -20px) scale(1.5); }
}

@keyframes bossPlayerReady {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(1deg); }
}

@keyframes bossPlayerThrow {
  0% { transform: rotate(0); }
  30% { transform: translateX(-5px) rotate(-9deg); }
  58% { transform: translateX(7px) rotate(13deg); }
  100% { transform: rotate(0); }
}

@keyframes bossPlayerRecoil {
  0% { transform: translateX(0) rotate(0); }
  35% { transform: translateX(-16px) rotate(-12deg); }
  60% { transform: translateX(5px) rotate(4deg); }
  100% { transform: translateX(0) rotate(0); }
}

@keyframes bossAimLock {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(30deg); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes bossAimBreathe {
  0%, 100% { transform: translate(-50%, -50%) scale(.92); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes bossStoneFlight {
  0% { left: -56%; top: 92%; opacity: 0; transform: scale(.5); }
  12% { opacity: 1; }
  48% { top: calc(var(--boss-aim-y) - 24%); transform: scale(1.18); }
  100% { left: var(--boss-aim-x); top: var(--boss-aim-y); opacity: 1; transform: scale(.78); }
}

@keyframes bossImpactFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.25); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}

@keyframes bossImpactWord {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45) rotate(-8deg); }
  34%, 72% { opacity: 1; transform: translate(-50%, -75%) scale(1.12) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -125%) scale(.9) rotate(-8deg); }
}

@keyframes bossTakesHit {
  0% { transform: translateX(0); filter: brightness(1); }
  18% { transform: translateX(13px) rotate(3deg); filter: brightness(1.8); }
  38% { transform: translateX(-9px) rotate(-2deg); }
  62% { transform: translateX(5px) rotate(1deg); }
  100% { transform: translateX(0); filter: brightness(.92) saturate(.82); }
}

@keyframes bossCounterLunge {
  0%, 100% { transform: translate(0, 0) scale(1); }
  38% { transform: translate(-18%, 5%) scale(1.08) rotate(-2deg); filter: brightness(.86) contrast(1.14); }
  62% { transform: translate(-12%, 3%) scale(1.04); }
}

@keyframes bossFalls {
  0% { transform: translateX(-50%) rotate(0) translate(0, 0); opacity: 1; }
  28% { transform: translateX(-52%) rotate(-10deg) translate(-8px, -3px); opacity: 1; }
  100% { transform: translateX(-42%) rotate(86deg) translate(12px, 26px); opacity: .72; }
}

@keyframes bossHealthHit {
  0% { transform: scale(.55); background: white; }
  45% { transform: scale(1.3); box-shadow: 0 0 18px 8px rgba(228,92,70,.42); }
  100% { transform: scale(1); background: #e45c46; }
}

.toast-banner {
  position: fixed;
  right: 18px;
  top: 14px;
  z-index: 9999;
  width: min(520px, calc(100vw - 24px));
  border-radius: 20px;
  padding: 18px 20px;
  border: 2px solid rgba(23, 32, 42, 0.16);
  box-shadow: 0 20px 46px rgba(23, 32, 42, 0.28);
  backdrop-filter: blur(8px);
  animation: toastIn 200ms ease;
}

.toast-banner.hidden {
  display: none;
}

.toast-banner strong {
  display: block;
  font-size: 23px;
  margin-bottom: 6px;
}

.toast-banner p {
  margin: 0;
  line-height: 1.5;
  font-size: 16px;
}

.toast-good {
  background: linear-gradient(135deg, rgba(219, 243, 230, 0.96), rgba(197, 236, 220, 0.98));
  color: #0f6a4d;
}

.toast-bad {
  background: linear-gradient(135deg, rgba(245, 221, 212, 0.96), rgba(244, 200, 183, 0.98));
  color: #ad4d2c;
}

.toast-info {
  background: linear-gradient(135deg, rgba(220, 236, 244, 0.97), rgba(201, 227, 239, 0.98));
  color: #295e7a;
}

.toast-level {
  background: linear-gradient(135deg, rgba(255, 220, 129, 0.98), rgba(255, 174, 87, 0.98));
  color: #563100;
}

.toast-large {
  transform-origin: top right;
  animation: toastIn 220ms ease, toastPulse 600ms ease 1;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}

.disciple-companion {
  --disciple-x: 0px;
  --disciple-y: 0px;
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 9988;
  width: 160px;
  display: grid;
  justify-items: center;
  gap: 8px;
  transform: translate(var(--disciple-x), var(--disciple-y));
  transition: transform 1.8s steps(8, end), filter 220ms ease;
  pointer-events: auto;
}

.disciple-companion.is-hidden {
  display: none;
}

.disciple-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border: 2px solid #1f160f;
  border-radius: 2px;
  padding: 0;
  background: #e9f1ff;
  color: #1f3a78;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 3px 8px rgba(23, 32, 42, 0.25);
  touch-action: manipulation;
}

.disciple-close-btn:hover {
  background: #d7e6ff;
}

.disciple-close-btn:focus-visible {
  outline: 2px solid #245cff;
  outline-offset: 1px;
}

.disciple-sprite {
  position: relative;
  width: 98px;
  height: 122px;
  z-index: 1;
  image-rendering: pixelated;
  animation: discipleHover 2.4s steps(8, end) infinite;
  filter: drop-shadow(0 10px 22px rgba(23, 32, 42, 0.22));
}

.disciple-head {
  position: absolute;
  left: 23px;
  top: 0;
  width: 52px;
  height: 46px;
  border: 4px solid #1f160f;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, #f4d8b6 0 8px, #eac89f 8px 16px),
    repeating-linear-gradient(180deg, #f0d1a9 0 8px, #e8c196 8px 16px);
}

.disciple-companion.variant-boy-a .disciple-head::before {
  content: '';
  position: absolute;
  left: 2px;
  top: -4px;
  width: 39px;
  height: 11px;
  background: repeating-linear-gradient(90deg, #5f3d28 0 6px, #4f3322 6px 12px);
}

.disciple-companion.variant-boy-a .disciple-head::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 6px;
  width: 10px;
  height: 18px;
  background: repeating-linear-gradient(180deg, #5f3d28 0 6px, #4f3322 6px 12px);
}

.disciple-companion.variant-boy-b .disciple-head::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 36px;
  height: 9px;
  background: repeating-linear-gradient(90deg, #3a281d 0 6px, #4a3425 6px 12px);
}

.disciple-companion.variant-boy-b .disciple-head::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  width: 8px;
  height: 10px;
  background: #3d2a1f;
}

.disciple-companion.variant-boy-c .disciple-head::before {
  content: '';
  position: absolute;
  left: 2px;
    top: -4px;
    width: 43px;
    height: 14px;
  background: repeating-linear-gradient(90deg, #6a4a2f 0 6px, #5a3f29 6px 12px);
  clip-path: polygon(0% 55%, 8% 10%, 16% 65%, 24% 18%, 34% 72%, 46% 15%, 56% 68%, 66% 20%, 76% 70%, 88% 14%, 100% 58%, 100% 100%, 0% 100%);
}

.disciple-companion.variant-boy-c .disciple-head::after {
  content: '';
  position: absolute;
  right: 1px;
  top: 9px;
  width: 11px;
  height: 15px;
  background: #5c412a;
}

.disciple-companion.variant-girl-a .disciple-head::before {
  content: '';
  position: absolute;
  left: -4px;
    top: -10px;
    width: 52px;
    height: 16px;
  background: repeating-linear-gradient(90deg, #3e241f 0 7px, #4c2d25 7px 14px);
}

.disciple-companion.variant-girl-a .disciple-head::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 5px;
  width: 14px;
  height: 26px;
  background: repeating-linear-gradient(180deg, #4c2d25 0 7px, #3e241f 7px 14px);
}

.disciple-companion.variant-girl-a .disciple-body {
  background:
    repeating-linear-gradient(90deg, #b0507a 0 8px, #944462 8px 16px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 8px, rgba(0, 0, 0, 0.06) 8px 16px);
}

.disciple-eye {
  position: absolute;
  top: 16px;
  width: 7px;
  height: 7px;
  background: #191919;
}

.disciple-eye-left {
  left: 11px;
}

.disciple-eye-right {
  right: 11px;
}

.disciple-mouth {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 14px;
  height: 4px;
  transform: translateX(-50%);
  background: #743f31;
}

.disciple-body {
  position: absolute;
  left: 18px;
  top: 42px;
  width: 62px;
  height: 70px;
  border: 4px solid #1f160f;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, #2f73a6 0 8px, #2b6693 8px 16px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0 8px, rgba(0, 0, 0, 0.06) 8px 16px);
}

.disciple-hand {
  position: absolute;
  top: 52px;
  width: 14px;
  height: 24px;
  border: 4px solid #1f160f;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, #f4d8b6 0 8px, #eac89f 8px 16px);
}

.disciple-hand-left {
  left: 0;
}

.disciple-hand-right {
  right: 0;
}

.disciple-status {
  position: relative;
  margin: 0;
  border-radius: 2px;
  border: 3px solid #1f160f;
  background:
    repeating-linear-gradient(90deg, #fffaf0 0 6px, #f4ebda 6px 12px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0 6px, rgba(0, 0, 0, 0.03) 6px 12px);
  color: #3b2a1f;
  text-align: center;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  padding: 6px 7px;
  min-height: 36px;
  width: 100%;
  box-shadow: 0 8px 16px rgba(23, 32, 42, 0.18);
  image-rendering: pixelated;
  pointer-events: none;
}

.disciple-status::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -10px;
  width: 10px;
  height: 10px;
  border-left: 3px solid #1f160f;
  border-top: 3px solid #1f160f;
  background: #f7efdf;
  transform: translateX(-50%) rotate(45deg);
}

.disciple-companion.mood-excited {
  filter: saturate(1.1);
}

.disciple-companion.mood-excited .disciple-sprite {
  animation-duration: 0.82s;
}

.disciple-companion.mood-excited .disciple-mouth {
  width: 16px;
  height: 8px;
  border-radius: 0 0 8px 8px;
  background: #0f6a4d;
}

.disciple-companion.mood-excited .disciple-eye {
  height: 8px;
}

.disciple-companion.mood-sad {
  filter: saturate(0.82) brightness(0.94);
}

.disciple-companion.mood-sad .disciple-sprite {
  animation-duration: 3.1s;
}

.disciple-companion.mood-sad .disciple-mouth {
  width: 14px;
  height: 2px;
  top: 31px;
  background: #7f3c36;
}

.disciple-companion.mood-sad .disciple-eye {
  top: 18px;
  height: 6px;
}

.disciple-companion.mood-bored {
  filter: saturate(0.72);
}

.disciple-companion.mood-bored .disciple-sprite {
  animation-duration: 4s;
}

.disciple-companion.mood-bored .disciple-mouth {
  width: 10px;
  top: 30px;
  background: #6e5b56;
}

.disciple-companion.mood-bored .disciple-eye {
  top: 19px;
  height: 4px;
}

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

@keyframes toastIn {
  from {
    transform: translateY(-12px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 223, 133, 0.55), 0 20px 46px rgba(23, 32, 42, 0.28); }
  70% { box-shadow: 0 0 0 18px rgba(255, 223, 133, 0), 0 20px 46px rgba(23, 32, 42, 0.28); }
  100% { box-shadow: 0 0 0 0 rgba(255, 223, 133, 0), 0 20px 46px rgba(23, 32, 42, 0.28); }
}

.sidebar-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.sidebar-stack .stat-panel,
.sidebar-stack .leaderboard-panel,
.sidebar-stack .multiplayer-panel {
  grid-column: 1 / -1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  border-radius: 12px;
  background: var(--panel-strong);
  padding: 8px 6px;
  border: 1px solid var(--line);
  text-align: center;
}

.stat-card.wide {
  grid-column: auto;
}

.stat-card span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-card strong {
  font-size: 22px;
}

.leaderboard-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.leaderboard-list {
  max-height: 190px;
  overflow-y: auto;
  padding-right: 6px;
}

.scoreboard-dialog {
  position: fixed;
  inset: 0;
  width: min(760px, calc(100% - 28px));
  max-height: min(82vh, 720px);
  margin: auto;
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 30px 90px rgba(6, 27, 66, 0.34);
}

.scoreboard-dialog::backdrop {
  background: rgba(6, 27, 66, 0.58);
  backdrop-filter: blur(5px);
}

.scoreboard-dialog-card {
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(6, 27, 66, 0.12);
  border-top: 6px solid var(--gold);
  border-radius: 24px;
  background: var(--panel-strong);
}

.scoreboard-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.scoreboard-dialog-head .eyebrow {
  margin: 0 0 5px;
}

.scoreboard-dialog-head h2 {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: clamp(25px, 4vw, 34px);
}

.scoreboard-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.scoreboard-close:hover {
  background: var(--rust-soft);
  color: #8e241f;
}

.scoreboard-dialog-summary {
  margin: 16px 0 0;
  padding: 13px 16px;
  border: 1px solid rgba(255, 187, 24, 0.42);
  border-radius: 14px;
  background: #fff5cf;
  font-weight: 900;
}

.scoreboard-dialog-columns {
  margin-top: 20px;
}

.scoreboard-dialog-columns h3 {
  margin-top: 0;
}

.scoreboard-dialog-columns .leaderboard-list {
  max-height: min(42vh, 320px);
}

.multiplayer-panel {
  border-radius: 24px;
  padding: 24px;
  display: none;
  gap: 10px;
}

.multiplayer-panel > .section-head {
  order: 0;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(23, 32, 42, 0.09);
}

.mp-form-grid {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.mp-top-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.mp-top-row .button {
  padding: 10px 14px;
  border-radius: 12px;
}

.mp-hidden {
  display: none !important;
}

.mp-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mp-mode-row .button {
  flex: 0 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 12px;
}

.mp-join-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-join-code-row {
  display: none;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 4px;
}

.mp-row .button {
  padding: 10px 13px;
  border-radius: 12px;
}

.mp-input {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.mp-theme-select {
  min-width: 230px;
}

.mp-code {
  width: 88px;
  text-transform: uppercase;
  text-align: center;
}

.mp-open-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

/* ── Match history ─────────────────────────────────────────── */
.mp-match-history {
  margin-top: 20px;
}

.mph-section {}

.mph-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.mph-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mph-match-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
}

.mph-match-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.mph-room-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mph-theme-tag {
  background: var(--green-soft, #e6f4ef);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
}

.mph-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.mph-rounds {
  font-size: 12px;
  color: var(--muted);
}

.mph-players {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mph-player-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-radius: 6px;
}

.mph-player-row.is-winner {
  font-weight: 600;
}

.mph-winner-badge {
  font-size: 15px;
  line-height: 1;
}

.mph-rank {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.mph-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mph-player-score {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

.mph-player-correct {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .mph-match-meta {
    gap: 4px;
  }
  .mph-player-row {
    grid-template-columns: 24px 1fr auto;
  }
  .mph-player-correct {
    display: none;
  }
}
/* ── end match history ──────────────────────────────────────── */

.mp-open-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.mp-open-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.mp-open-room-item button {
  flex-shrink: 0;
}

.mp-status {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed rgba(23, 32, 42, 0.2);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.6);
}

.result-banner p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.mp-invite-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 157, 104, 0.22);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(232, 247, 239, 0.92), rgba(255, 255, 255, 0.76));
}

.mp-invite-copy {
  display: grid;
  gap: 4px;
}

.mp-invite-eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mp-invite-copy strong {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.mp-invite-copy p,
.mp-invite-copy small {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.mp-invite-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.mp-invite-link {
  min-width: 0;
}

.mp-social-tools {
  display: grid;
  gap: 6px;
}

.mp-emote-picker {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.mp-emote-btn {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 5px 3px;
  display: grid;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.mp-emote-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 106, 77, 0.36);
  background: var(--green-soft);
}

.mp-emote-emoji {
  font-size: 22px;
  line-height: 1;
}

.mp-emote-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mp-quickchat-picker {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mp-chat-btn {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 999px;
  background: #fff;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.mp-chat-btn:hover {
  border-color: rgba(15, 106, 77, 0.36);
  background: var(--green-soft);
}

.mp-players {
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.mp-player-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.mp-kick-btn {
  border: 1px solid rgba(159, 22, 41, 0.25);
  border-radius: 8px;
  background: #fff;
  color: #9f1629;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.mp-kick-btn:hover {
  background: rgba(253, 230, 235, 0.8);
}

.mp-kick-spacer {
  width: 1px;
  height: 1px;
}

.mp-player-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.mp-player-emote-lane {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: min(52vw, 320px);
  overflow: hidden;
  padding: 1px 0 2px;
  scrollbar-width: none;
}

.mp-player-emote-lane::-webkit-scrollbar {
  display: none;
}

.mp-player-emote {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(23, 32, 42, 0.16);
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: mpEmoteLifecycle 10s linear both;
  animation-delay: calc(var(--mp-emote-age, 0) * -1s);
}

.mp-player-emote.is-fresh {
  animation: mpEmotePop 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mp-player-emote::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 2px solid rgba(15, 106, 77, 0.45);
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.mp-player-emote.is-fresh::after {
  animation: mpEmoteSplash 520ms ease-out;
}

.mp-player-chat-lane {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: min(52vw, 340px);
  overflow: hidden;
  padding: 1px 0 2px;
}

.mp-player-chat {
  display: inline-flex;
  align-items: center;
  max-width: 200px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  background: #fff;
  box-shadow: 0 6px 14px rgba(23, 32, 42, 0.16);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: mpEmoteLifecycle 10s linear both;
  animation-delay: calc(var(--mp-chat-age, 0) * -1s);
}

.mp-player-chat.is-fresh {
  animation: mpEmotePop 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes mpEmotePop {
  0% {
    transform: translateY(-2px) scale(0.55);
  }
  55% {
    transform: translateY(-2px) scale(1.18);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes mpEmoteSplash {
  0% {
    opacity: 0.65;
    transform: scale(0.86);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes mpEmoteLifecycle {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
}

.mp-player-round-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 3px 7px;
  border: 1px solid rgba(23, 32, 42, 0.2);
}

.mp-player-round-pill.is-correct {
  color: var(--green);
  border-color: rgba(15, 106, 77, 0.34);
  background: var(--green-soft);
}

.mp-player-round-pill.is-wrong {
  color: #9f1629;
  border-color: rgba(159, 22, 41, 0.34);
  background: rgba(253, 230, 235, 0.7);
}

.mp-player-row-correct {
  border-color: rgba(15, 106, 77, 0.34);
  background: rgba(222, 247, 236, 0.7);
}

.mp-player-row-wrong {
  border-color: rgba(159, 22, 41, 0.34);
  background: rgba(253, 230, 235, 0.7);
}

.mp-player-row-flash-good {
  animation: mpRowFlashGood 360ms ease;
}

.mp-player-row-flash-bad {
  animation: mpRowFlashBad 360ms ease;
}

.mp-player-score {
  color: var(--green);
  font-weight: 700;
}

.mp-ready-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid rgba(23, 32, 42, 0.2);
  color: var(--muted);
}

.mp-ready-pill.is-ready {
  border-color: rgba(15, 106, 77, 0.34);
  color: var(--green);
  background: var(--green-soft);
}

.mp-round-card {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.multiplayer-panel .mp-round-card {
  order: 0;
  min-height: 280px;
}

.multiplayer-panel.is-live-focus .mp-round-card {
  border-color: rgba(15, 106, 77, 0.36);
  box-shadow: 0 14px 28px rgba(36, 92, 255, 0.18);
  background: rgba(255, 255, 255, 0.95);
}

.multiplayer-panel.is-live-focus .mp-status,
.multiplayer-panel.is-live-focus .mp-players,
.multiplayer-panel.is-live-focus .mp-social-tools,
.multiplayer-panel.is-live-focus .mp-form-grid {
  opacity: 0.84;
}

.mp-round-meta {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mp-theme-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 106, 77, 0.3);
  background: rgba(222, 247, 236, 0.7);
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.mp-round-prompt {
  margin: 0 0 10px;
  line-height: 1.45;
}

.mp-option-grid {
  display: grid;
  gap: 8px;
}

.mp-option-btn {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.mp-option-btn.is-selected {
  background: var(--green-soft);
  border-color: rgba(15, 106, 77, 0.36);
}

.mp-round-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
}

.mp-sequence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.mp-sequence-item {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mp-sequence-label {
  flex: 1;
}

.mp-sequence-controls {
  display: flex;
  gap: 6px;
}

.mp-seq-btn {
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.mp-answer-input {
  width: 100%;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.mp-feedback-card {
  margin-bottom: 10px;
  border: 1px solid rgba(15, 106, 77, 0.26);
  border-radius: 12px;
  padding: 10px;
  background: rgba(222, 247, 236, 0.6);
}

.mp-feedback-card.mp-feedback-own {
  border: 2px solid var(--green);
  background: rgba(213, 239, 228, 0.5);
  padding: 16px;
  text-align: center;
}

.mp-feedback-own .mp-feedback-title {
  font-size: 18px;
  margin: 0 0 6px;
}

.mp-feedback-own .mp-feedback-title.is-correct {
  color: var(--green);
}

.mp-feedback-own .mp-feedback-title.is-wrong {
  color: var(--rust);
}

.mp-feedback-own .mp-feedback-points {
  font-size: 16px;
  margin: 0;
  color: var(--green);
}

.mp-feedback-wait {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.mp-correct-splash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  animation: mpCorrectSplashFade 1200ms ease forwards;
}

.mp-correct-splash-badge {
  background: rgba(15, 106, 77, 0.94);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 40px rgba(15, 106, 77, 0.32);
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: clamp(16px, 2.1vw, 24px);
  letter-spacing: 0.02em;
}

.mp-correct-fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@keyframes mpCorrectSplashFade {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }
  18% {
    opacity: 1;
    transform: scale(1.04);
  }
  72% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
  }
}

.mp-feedback-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.mp-feedback-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}

.mp-feedback-row.is-correct .mp-feedback-state {
  color: var(--green);
  font-weight: 700;
}

.mp-feedback-row.is-wrong .mp-feedback-state {
  color: #9f1629;
  font-weight: 700;
}

.mp-feedback-points {
  font-weight: 700;
}

.mp-feedback-answer {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.mp-final-card {
  display: grid;
  gap: 10px;
}

.mp-winner-splash {
  position: relative;
  background: linear-gradient(135deg, #1023a3 0%, #245cff 58%, #0f9d68 100%);
  border-radius: 16px;
  padding: 32px 20px 28px;
  text-align: center;
  overflow: hidden;
}

.mp-fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mp-winner-label {
  position: relative;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffe06e;
}

.mp-winner-name {
  position: relative;
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  line-height: 1.1;
  word-break: break-word;
}

.mp-final-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.mp-final-winner {
  margin: 0;
  font-weight: 600;
}

.mp-final-list {
  display: grid;
  gap: 8px;
}

.mp-final-actions {
  display: flex;
  justify-content: center;
}

.mp-final-actions .button {
  min-width: 220px;
}

.mp-final-note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.mp-final-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.mp-final-rank,
.mp-final-score,
.mp-final-correct {
  font-weight: 700;
}

.mp-final-badge {
  font-size: 12px;
  color: var(--muted);
}

@keyframes mpRowFlashGood {
  from {
    transform: scale(1);
  }
  40% {
    transform: scale(1.015);
  }
  to {
    transform: scale(1);
  }
}

@keyframes mpRowFlashBad {
  from {
    transform: scale(1);
  }
  40% {
    transform: scale(1.015);
  }
  to {
    transform: scale(1);
  }
}

.leader-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(23, 32, 42, 0.08);
}

.leader-rank {
  color: var(--muted);
}

.leader-score {
  font-weight: 700;
  color: var(--green);
}

.progress-panel {
  border-radius: 18px;
  padding: 14px;
  transition: padding 0.24s ease, opacity 0.24s ease, transform 0.24s ease;
}

.goals-panel {
  display: grid;
  gap: 12px;
}

.progress-panel.is-collapsed-progress {
  padding: 11px 12px;
}

.daily-card,
.mission-list,
.collection-grid {
  display: grid;
  gap: 12px;
}

.goals-panel .daily-card {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 32, 42, 0.09);
}

.goals-panel .daily-card:empty {
  display: none;
}

.completion-burst {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 157, 104, 0.24);
  border-radius: 16px;
  padding: 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(242, 187, 47, 0.3), transparent 32%),
    linear-gradient(135deg, #ebf7f0, #d9f7e9);
  animation: completionPop 720ms ease both, completionTuck 620ms ease 1600ms forwards;
}

.completion-burst::before,
.completion-burst::after {
  content: '';
  position: absolute;
  inset: auto auto 12px 14px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow:
    38px -42px 0 rgba(36, 92, 255, 0.58),
    92px -18px 0 rgba(15, 157, 104, 0.72),
    148px -52px 0 rgba(204, 60, 99, 0.58),
    190px -8px 0 rgba(242, 187, 47, 0.78);
  animation: completionConfetti 900ms ease-out both;
}

.completion-burst::after {
  left: auto;
  right: 18px;
  animation-delay: 120ms;
  transform: rotate(22deg);
}

.completion-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.completion-burst strong {
  display: block;
  font-size: 20px;
  line-height: 1.12;
}

.completion-burst p {
  max-width: 36ch;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.completed-compact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 157, 104, 0.18);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(235, 247, 240, 0.78);
}

.completed-compact strong {
  color: var(--green);
  font-size: 13px;
}

.completed-compact span,
.mission-tucked-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.completed-compact-full {
  border-radius: 14px;
}

.daily-topline,
.daily-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.daily-topline span,
.daily-meta {
  color: var(--muted);
  font-size: 13px;
}

.mini-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(9, 31, 50, 0.1);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.mission-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.mission-card p,
.collection-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.mission-card > span {
  color: var(--muted);
  font-weight: 800;
}

.mission-card .mini-progress {
  grid-column: 1 / -1;
}

.mission-card.is-complete,
.collection-card.is-unlocked {
  background: linear-gradient(180deg, #ebf7f0, #d9f7e9);
  border-color: rgba(15, 157, 104, 0.26);
}

.mission-card.is-celebrating {
  position: relative;
  overflow: hidden;
  animation: missionCompletePop 680ms ease both, missionTuckAway 620ms ease 1600ms forwards;
}

.mission-card.is-celebrating::after {
  content: 'Complete';
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-tucked-note {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(23, 32, 42, 0.16);
}

.collection-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.collection-card {
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  opacity: 0.72;
}

.collection-card.is-unlocked {
  opacity: 1;
}

.level-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.level-node {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
  min-height: 0;
}

.level-node-top {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 7px;
}

.level-node p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 0;
}

.level-node .level-goal {
  margin-top: 8px;
  font-weight: 700;
  color: var(--ink);
}

.level-node .level-boss {
  margin-bottom: 0;
  font-size: 12px;
}

.level-node.current {
  background: linear-gradient(180deg, #fff4d8, #ffe7b5);
  border-color: rgba(242, 187, 47, 0.46);
}

.level-node.boss {
  background: linear-gradient(180deg, #fff8e7, #ffe3a1);
  border-color: rgba(181, 113, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.level-node.boss .level-node-top {
  color: #855000;
  font-weight: 800;
}

.level-node.cleared {
  background: linear-gradient(180deg, #ebf7f0, #d5efe4);
  border-color: rgba(15, 106, 77, 0.24);
}

.level-node.locked {
  opacity: 0.68;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.achievement-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-card.is-unlocked {
  background: linear-gradient(180deg, #fff4d8, #ffecc2);
  border-color: rgba(242, 187, 47, 0.36);
}

.achievement-card h3 {
  margin: 3px 0;
  font-size: 16px;
  line-height: 1.12;
}

.achievement-card p,
.feed-item p,
.empty-state {
  color: var(--muted);
  line-height: 1.55;
}

.achievement-card p {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.achievement-state {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  background: rgba(23, 32, 42, 0.08);
}

.feed-list {
  display: grid;
  gap: 8px;
}

.feed-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
}

.feed-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.tone-success {
  background: var(--green-soft);
}

.tone-danger {
  background: var(--rust-soft);
}

.tone-info {
  background: var(--blue-soft);
}

.glow-success {
  box-shadow: 0 0 0 1px rgba(15, 106, 77, 0.12), 0 20px 60px rgba(15, 106, 77, 0.18);
}

.glow-danger {
  box-shadow: 0 0 0 1px rgba(204, 60, 99, 0.16), 0 20px 60px rgba(204, 60, 99, 0.2);
}

.shake {
  animation: v3shake 0.35s ease;
}

@keyframes v3shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

@keyframes uiPress {
  0% { transform: scale(1); }
  45% { transform: scale(0.975); }
  100% { transform: scale(1); }
}

@keyframes uiPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

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

@keyframes splashGridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(88px, 88px, 0); }
}

@keyframes splashBeamSweep {
  from { background-position: -120px 0, 0 0, 0 0; }
  to { background-position: 240px 0, 88px 88px, 88px 88px; }
}

@keyframes splashGlowTurn {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(14deg) scale(1.08); }
}

@keyframes splashTileFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-12deg); opacity: 0.58; }
  50% { transform: translate3d(0, -18px, 0) rotate(-7deg); opacity: 0.86; }
}

@keyframes splashCardDrift {
  0%, 100% { translate: 0 0; opacity: 0.72; }
  35% { translate: 26px -18px; opacity: 0.94; }
  70% { translate: -16px 16px; opacity: 0.82; }
}

@keyframes splashChipOrbit {
  0%, 100% { translate: 0 0; scale: 1; opacity: 0.68; }
  45% { translate: -18px -22px; scale: 1.06; opacity: 0.94; }
  75% { translate: 16px 12px; scale: 0.98; opacity: 0.78; }
}

@keyframes splashCardShine {
  0%, 45% { transform: translateX(-75%); opacity: 0; }
  55% { opacity: 1; }
  78%, 100% { transform: translateX(85%); opacity: 0; }
}

@keyframes completionPop {
  0% { opacity: 0; transform: scale(0.94) translateY(10px); }
  45% { opacity: 1; transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes completionConfetti {
  0% { opacity: 0; transform: translateY(12px) scale(0.7); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scale(1); }
}

@keyframes completionTuck {
  to { opacity: 0.08; transform: scale(0.98) translateY(-8px); }
}

@keyframes missionCompletePop {
  0% { transform: scale(1); }
  38% { transform: scale(1.025); box-shadow: 0 0 0 5px rgba(15, 157, 104, 0.16); }
  100% { transform: scale(1); }
}

@keyframes missionTuckAway {
  to { opacity: 0.12; transform: translateX(8px) scale(0.98); }
}

@keyframes selectedPulse {
  0% { box-shadow: 0 0 0 rgba(15, 157, 104, 0); }
  45% { box-shadow: 0 0 0 5px rgba(15, 157, 104, 0.16), 0 14px 28px rgba(17, 50, 82, 0.09); }
  100% { box-shadow: 0 12px 24px rgba(17, 50, 82, 0.08); }
}

@keyframes questionReady {
  0% { box-shadow: var(--shadow); }
  35% { box-shadow: 0 0 0 4px rgba(36, 92, 255, 0.12), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}

/* Mascot restore button */
.mascot-restore-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 10px 14px;
  background: #e9f1ff;
  border: 2px solid #1f160f;
  border-radius: 8px;
  color: #1f3a78;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(23, 32, 42, 0.22);
  z-index: 1000;
  transition: background 0.2s ease;
}

.mascot-restore-btn:hover {
  background: #d7e6ff;
}

.mascot-restore-btn:focus-visible {
  outline: 2px solid #245cff;
  outline-offset: 2px;
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .app-grid > *,
  .ui-press,
  .ui-pop,
  .answer-option.selected,
  .question-ready,
  .splash-motion::before,
  .splash-motion::after,
  .splash-motion span,
  .splash-float,
  .splash-card::before,
  .completion-burst,
  .completion-burst::before,
  .completion-burst::after,
  .mission-card.is-celebrating,
  .boss-arena::before,
  .boss-sun,
  .boss-dust,
  .boss-player,
  .boss-figure,
  .boss-figure img,
  .boss-aim-marker,
  .boss-projectile,
  .boss-impact-flash,
  .boss-impact-word,
  .boss-counter-blow,
  .boss-hit-pip {
    animation: none;
    transition: none;
  }
}

.mascot-restore-btn.hidden {
  display: none;
}

.mascot-feature-disabled {
  display: none !important;
}

/* Multiplayer mode toggle */
.app-grid.mp-mode {
  grid-template-columns: 1fr;
}

.app-grid.mp-mode .question-panel,
.app-grid.mp-mode .achievement-panel,
.app-grid.mp-mode .feed-panel,
.app-grid.mp-mode .progress-panel {
  display: none;
}

.app-grid.mp-mode .stat-panel,
.app-grid.mp-mode .leaderboard-panel {
  display: none;
}

.app-grid.mp-mode .sidebar-stack {
  grid-template-columns: 1fr;
}

.app-grid.mp-mode .multiplayer-panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 600px;
}

body.mp-mode .hero-meta,
body.mp-mode .name-card,
body.mp-mode .profile-drawer,
body.mp-mode #profileToggleBtn,
body.mp-mode #saveNameBtn,
body.mp-mode #resetRunBtn {
  display: none;
}

body.mp-mode .button-row-main {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .game-hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hud-xp {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  .progress-toggle {
    grid-column: 1 / 4;
    grid-row: 3;
  }

  .scoreboard-toggle {
    grid-column: 4 / 5;
    grid-row: 2 / 4;
    width: 100%;
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .splash-card,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .splash-mode-grid {
    grid-template-columns: 1fr;
  }

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

  .sidebar-stack .stat-panel,
  .sidebar-stack .leaderboard-panel,
  .sidebar-stack .multiplayer-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .answer-review-grid,
  .answer-review-comparison {
    grid-template-columns: 1fr;
  }

  .question-actions,
  #submitAnswerBtn {
    width: 100%;
  }

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

  .hud-xp {
    grid-column: 1 / -1;
    grid-row: 3;
  }

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

  .scoreboard-toggle {
    grid-column: 2 / 3;
    grid-row: 4;
    width: 100%;
  }

  .app-grid.progress-open:not(.mp-mode) .sidebar-stack {
    grid-template-columns: 1fr;
  }

  body.mp-mode .button-row-main {
    grid-template-columns: 1fr;
  }

  .splash-screen {
    padding: 12px;
    align-items: start;
  }

  .splash-card {
    border-radius: 22px;
    padding: 18px;
  }

  .splash-focus {
    grid-template-columns: 1fr;
  }

  .splash-mode-grid {
    grid-template-columns: 1fr;
  }

  .splash-actions .button {
    width: 100%;
  }

  .page-shell {
    width: min(100% - 20px, 1320px);
    margin-top: 10px;
  }

  .hero-panel,
  .question-panel,
  .rail-panel,
  .achievement-panel,
  .feed-panel,
  .stat-panel,
  .leaderboard-panel,
  .progress-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .hero-meta,
  .button-row,
  .answer-grid,
  .achievement-grid,
  .level-rail,
  .sidebar-stack,
  .leaderboard-columns {
    grid-template-columns: 1fr;
  }

  .scoreboard-dialog-columns {
    grid-template-columns: 1fr;
  }

  .scoreboard-dialog-columns .leaderboard-list {
    max-height: 220px;
  }

  .question-stage {
    padding: 18px 0;
  }

  .question-head {
    padding-left: 0;
    padding-right: 0;
  }

  .mp-row,
  .mp-join-wrap,
  .mp-join-code-row {
    flex-direction: column;
  }

  .mp-invite-card,
  .mp-invite-actions {
    grid-template-columns: 1fr;
  }

  .mp-mode-row {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  #mpActionRow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
  }

  #mpActionRow #mpThemeSelect,
  #mpActionRow #mpThemeApplyBtn,
  #mpActionRow #mpJoinPolicyWrap {
    grid-column: 1 / -1;
  }

  .mp-top-row {
    grid-template-columns: 1fr auto;
  }

  .mp-row .button {
    width: 100%;
  }

  .mp-mode-row .button {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .mp-emote-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
  }

  .mp-emote-btn {
    padding: 4px 2px;
  }

  .mp-emote-emoji {
    font-size: 20px;
  }

  .mp-emote-label {
    font-size: 8px;
  }

  .mp-chat-btn {
    font-size: 10px;
    padding: 4px 8px;
  }

  .mp-player-chat {
    max-width: 140px;
  }

  .mp-code {
    width: 100%;
  }

  .mp-feedback-row,
  .mp-final-row {
    grid-template-columns: 1fr auto auto;
    gap: 6px;
  }

  .run-summary-grid,
  .summary-buttons {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .hero-brand-mark {
    grid-template-columns: 68px 1fr;
    gap: 12px;
    margin-bottom: 10px;
  }

  .hero-logo-icon {
    width: 68px;
  }

  .hero-brand-copy {
    gap: 4px;
  }

  .hero-brand-copy h1 {
    font-size: clamp(34px, 9vw, 46px);
  }

  .hero-brand-subtitle {
    font-size: 13px;
    letter-spacing: 0.1em;
  }

  .question-head h2,
  .section-head h2 {
    font-size: 30px;
  }

  .disciple-companion {
    right: 12px;
    bottom: 10px;
    width: 124px;
  }

  .disciple-status {
    font-size: 9px;
    min-height: 32px;
    padding: 5px 6px;
  }

  .disciple-close-btn {
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .disciple-sprite {
    transform: scale(0.88);
    transform-origin: bottom right;
  }
}
