* {
  box-sizing: border-box;
}

:root {
  --bg: #edf6ff;
  --bg-2: #dcecff;
  --ink: #091f32;
  --muted: #4a6478;
  --panel: rgba(246, 251, 255, 0.82);
  --panel-strong: #fbfdff;
  --line: rgba(9, 31, 50, 0.14);
  --green: #0f9d68;
  --green-soft: #d9f7e9;
  --gold: #f2bb2f;
  --rust: #cc3c63;
  --rust-soft: #ffe2eb;
  --blue: #245cff;
  --blue-soft: #dde8ff;
  --shadow: 0 22px 64px rgba(7, 30, 52, 0.16);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(36, 92, 255, 0.22), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(15, 157, 104, 0.2), transparent 36%),
    radial-gradient(circle at 50% 120%, rgba(13, 26, 38, 0.12), transparent 45%),
    linear-gradient(180deg, #f4f9ff 0%, #e7f1ff 55%, #f7fbff 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.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: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -10% -40% 45%;
  height: 320px;
  background: radial-gradient(circle, rgba(36, 92, 255, 0.22), transparent 64%);
  pointer-events: none;
}

.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: 18px;
  align-items: center;
  max-width: 760px;
  margin-bottom: 14px;
}

.hero-logo-icon {
  display: block;
  width: clamp(78px, 10vw, 108px);
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(17, 34, 58, 0.12));
}

.hero-brand-copy {
  display: grid;
  gap: 6px;
}

.hero-brand-copy h1 {
  font-size: clamp(40px, 5.8vw, 48px);
}

.hero-brand-subtitle {
  margin: 0;
  font-size: clamp(16px, 2.3vw, 24px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.hero-text {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  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(--blue), #2d7eff 62%, #0f9d68 100%);
  width: 4%;
  transition: width 0.45s ease;
}

.hero-actions {
  display: grid;
  gap: 14px;
  align-content: start;
}

.name-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  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: 14px;
  padding: 14px 16px;
  background: white;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, #0d3cda, #245cff 55%, #0f9d68);
  color: white;
  box-shadow: 0 16px 30px rgba(13, 60, 218, 0.24);
}

.button-secondary {
  background: linear-gradient(135deg, #f2f7ff, #dbe8ff);
  color: var(--ink);
}

.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.7fr) minmax(300px, 0.9fr);
  gap: 22px;
  margin-top: 22px;
}

.question-panel,
.rail-panel,
.achievement-panel,
.feed-panel,
.stat-panel,
.leaderboard-panel {
  border-radius: 24px;
  padding: 24px;
}

.question-panel {
  min-height: 520px;
}

.question-head h2,
.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.05;
}

.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: 22px;
}

.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-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;
}

.answer-option.selected {
  background: var(--green-soft);
  border-color: rgba(15, 106, 77, 0.34);
}

.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 {
  margin-top: 22px;
}

.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: none;
}

.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);
}

.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;
  gap: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  border-radius: 18px;
    background: var(--panel-strong);
    padding: 4px;
    border: 1px solid var(--line);
    text-align: center;
}

.stat-card.wide {
  grid-column: 1 / -1;
}

.stat-card span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 30px;
}

.leaderboard-columns {
  display: grid;
  gap: 18px;
}

.leaderboard-list {
  max-height: 255px;
  overflow-y: auto;
  padding-right: 6px;
}

.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);
}

.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);
}

.level-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.level-node {
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  background: white;
  min-height: 150px;
}

.level-node-top {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}

.level-node p {
  color: var(--muted);
  font-size: 14px;
}

.level-node.current {
  background: linear-gradient(180deg, #fff4d8, #ffe7b5);
  border-color: rgba(242, 187, 47, 0.46);
}

.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(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.achievement-card {
  background: white;
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 18px;
  min-height: 190px;
  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: 8px 0;
  font-size: clamp(20px, 2.2vw, 26px);
  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: 15px;
  overflow-wrap: anywhere;
}

.achievement-state {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 6px 10px;
  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: 12px;
}

.feed-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

.feed-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
}

.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); }
}

/* 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 > * {
    animation: none;
  }
}

.mascot-restore-btn.hidden {
  display: none;
}

/* 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 {
  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 #saveNameBtn,
body.mp-mode #resetRunBtn {
  display: none;
}

@media (max-width: 1080px) {
  .hero-panel,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .achievement-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .level-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
    margin-top: 10px;
  }

  .hero-panel,
  .question-panel,
  .rail-panel,
  .achievement-panel,
  .feed-panel,
  .stat-panel,
  .leaderboard-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-meta,
  .button-row,
  .answer-grid,
  .achievement-grid,
  .level-rail {
    grid-template-columns: 1fr;
  }

  .mp-row,
  .mp-join-wrap,
  .mp-join-code-row {
    flex-direction: column;
  }

  .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;
  }
}
