:root {
  color-scheme: dark;
  --bg: #11100e;
  --bg-2: #171412;
  --panel: #1f1b18;
  --panel-2: #28221d;
  --text: #f7efe2;
  --muted: #b9ad9d;
  --line: rgba(247, 239, 226, 0.14);
  --gold: #f0c85a;
  --red: #ff5a5f;
  --teal: #38d6aa;
  --violet: #9d7cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 58%, #0d0f0e 100%);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  padding: 22px;
  transition: background 260ms ease, color 260ms ease;
}

.topbar,
.game-shell,
.systems-panel {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.sigil {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 26px rgba(240, 200, 90, 0.18));
}

.eyebrow,
.panel-label,
.choice-label,
.hud-label,
.result-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 1px 0 0;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hud-item {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(31, 27, 24, 0.74);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.hud-item strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  margin-top: 32px;
}

.question-stage {
  position: relative;
  min-height: 590px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 44%),
    rgba(31, 27, 24, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.question-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(240, 200, 90, 0.16), transparent 18%, transparent 82%, rgba(56, 214, 170, 0.12)),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, 0.018) 18px 19px);
  opacity: 0.55;
}

.question-stage > * {
  position: relative;
  z-index: 1;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.category-chip,
.rarity-chip,
.answered-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(15, 14, 12, 0.58);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.category-chip {
  border-color: color-mix(in srgb, var(--accent, var(--gold)) 46%, transparent);
  color: var(--accent, var(--gold));
}

.question-text {
  min-height: 148px;
  margin: 42px 0 30px;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

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

.choice-card {
  position: relative;
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  color: var(--text);
  text-align: left;
  background: rgba(22, 18, 16, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.choice-card:hover,
.choice-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--card-accent) 72%, white 10%);
  outline: none;
}

.choice-a {
  --card-accent: var(--red);
}

.choice-b {
  --card-accent: var(--teal);
}

.choice-card.selected {
  border-color: var(--card-accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 18%, transparent), transparent),
    rgba(22, 18, 16, 0.9);
}

.choice-card.locked {
  pointer-events: none;
}

.choice-copy {
  display: block;
  margin-top: 20px;
  font-size: 31px;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.vote-bar {
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: linear-gradient(0deg, color-mix(in srgb, var(--card-accent) 56%, transparent), transparent);
  opacity: 0;
  transition: height 760ms cubic-bezier(0.22, 1, 0.36, 1), opacity 260ms ease;
}

.choice-card.revealed .vote-bar {
  opacity: 1;
}

.percent {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  min-height: 42px;
  font-size: 36px;
  font-weight: 950;
  color: var(--card-accent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.choice-card.revealed .percent {
  opacity: 1;
  transform: translateY(0);
}

.prediction-panel,
.result-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(11, 10, 9, 0.54);
  animation: panelIn 220ms ease both;
}

.prediction-panel[hidden],
.result-panel[hidden],
.reward-pop[hidden] {
  display: none;
}

.prediction-panel p,
.result-panel p,
.result-panel h3 {
  margin: 0;
}

.prediction-actions {
  display: flex;
  gap: 10px;
}

.primary-action,
.danger-action,
.next-button,
.ghost-button,
.buy-button,
.mini-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-weight: 850;
  background: rgba(247, 239, 226, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-action {
  border-color: color-mix(in srgb, var(--teal) 58%, transparent);
  background: rgba(56, 214, 170, 0.13);
}

.danger-action {
  border-color: color-mix(in srgb, var(--red) 62%, transparent);
  background: rgba(255, 90, 95, 0.13);
}

.next-button,
.buy-button {
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  background: rgba(240, 200, 90, 0.13);
}

.primary-action:hover,
.danger-action:hover,
.next-button:hover,
.ghost-button:hover,
.buy-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
  border-color: currentColor;
}

.result-panel h3 {
  margin-top: 4px;
  font-size: 26px;
}

.result-panel p:last-child {
  margin-top: 4px;
  color: var(--muted);
}

.reward-pop {
  position: absolute;
  right: 28px;
  top: 86px;
  z-index: 5;
  max-width: min(360px, calc(100% - 56px));
  border: 1px solid color-mix(in srgb, var(--gold) 44%, transparent);
  border-radius: 14px;
  padding: 15px 16px;
  background: rgba(18, 15, 12, 0.94);
  box-shadow: var(--shadow);
  animation: rewardIn 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reward-pop strong {
  display: block;
  color: var(--gold);
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.status-card,
.event-log {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(31, 27, 24, 0.74);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.status-card strong {
  display: block;
  margin-top: 6px;
  line-height: 1.2;
}

.event-log {
  display: grid;
  gap: 8px;
}

.event-item {
  border-left: 2px solid var(--accent, var(--gold));
  padding-left: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tabbar {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 1240px;
  margin: 18px auto 0;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: rgba(17, 16, 14, 0.88);
  backdrop-filter: blur(16px);
}

.tab {
  flex: 1 0 auto;
  min-width: 108px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.tab.active {
  border-color: var(--line);
  color: var(--text);
  background: rgba(247, 239, 226, 0.08);
}

.systems-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: rgba(31, 27, 24, 0.74);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

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

.system-card {
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(12, 11, 10, 0.42);
}

.system-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.15;
}

.system-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.price {
  color: var(--gold);
  font-weight: 900;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  background: rgba(8, 8, 7, 0.62);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

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

.tiny-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.flash-legendary {
  animation: legendaryPulse 1100ms ease both;
}

[data-theme="moon"] {
  --bg: #101114;
  --bg-2: #1a1b22;
  --panel: #202027;
  --panel-2: #292937;
  --gold: #d9e7ff;
  --red: #d26b8c;
  --teal: #8cd7ff;
  --violet: #b7a7ff;
}

[data-theme="divine"] {
  --bg: #15120a;
  --bg-2: #221b0c;
  --panel: #251f13;
  --gold: #ffd66f;
  --red: #ff7864;
  --teal: #bfe899;
  --violet: #f4f0c8;
}

[data-theme="glitch"] {
  --bg: #0f1110;
  --bg-2: #171d19;
  --panel: #171c19;
  --gold: #dbff66;
  --red: #ff4f93;
  --teal: #4df1da;
  --violet: #b879ff;
}

[data-theme="flesh"] {
  --bg: #15100f;
  --bg-2: #211716;
  --panel: #241a19;
  --gold: #ffd1a3;
  --red: #ff6b70;
  --teal: #7fd5b7;
  --violet: #d49ba7;
}

[data-theme="mirror"] {
  --bg: #111314;
  --bg-2: #171a1b;
  --panel: #202324;
  --gold: #e7eef1;
  --red: #ff697d;
  --teal: #7ee7d5;
  --violet: #c3c7d8;
}

[data-theme="cathedral"] {
  --bg: #120f11;
  --bg-2: #1f191b;
  --panel: #241d20;
  --gold: #e8c36c;
  --red: #c86d62;
  --teal: #79b69b;
  --violet: #b9a0d6;
}

[data-theme="wet"] {
  --bg: #0f1212;
  --bg-2: #141e1d;
  --panel: #182321;
  --gold: #aee8d2;
  --red: #ff7887;
  --teal: #62e6bd;
  --violet: #9fb8ff;
}

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

@keyframes rewardIn {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  18%,
  82% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@keyframes legendaryPulse {
  0% {
    box-shadow: var(--shadow);
  }
  35% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent), 0 0 70px rgba(240, 200, 90, 0.22);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 980px) {
  .game-shell {
    grid-template-columns: 1fr;
  }

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

  .event-log {
    grid-column: 1 / -1;
  }

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

  .question-text {
    min-height: 120px;
    font-size: 38px;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
  }

  .sigil {
    width: 44px;
    height: 44px;
  }

  h1 {
    max-width: 280px;
    font-size: 20px;
  }

  .hud {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .hud-item {
    min-width: 0;
  }

  .hide-small {
    display: none;
  }

  .question-stage {
    min-height: auto;
    padding: 22px;
  }

  .question-text {
    min-height: auto;
    margin: 28px 0 22px;
    font-size: 30px;
  }

  .choice-grid,
  .side-panel,
  .panel-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 168px;
  }

  .choice-copy {
    font-size: 25px;
  }

  .prediction-panel,
  .result-panel,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .reward-pop {
    left: 18px;
    right: 18px;
    top: 66px;
  }
}

/* Split-screen edition: simple, elegant, and answer-first. */
body {
  background: #050505;
}

.app {
  min-height: 100dvh;
  padding: 0;
  background: #050505;
  overflow-x: hidden;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  max-width: none;
  height: 96px;
  margin: 0;
  padding: 22px 30px;
  pointer-events: none;
}

.brand,
.hud,
.question-mini,
.systems-toggle {
  pointer-events: auto;
}

.brand {
  gap: 10px;
  color: #fff;
}

.brand::before {
  content: "↪";
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.sigil,
.brand .eyebrow {
  display: none;
}

h1 {
  display: none;
}

.question-mini {
  position: fixed;
  top: 24px;
  left: 50%;
  display: grid;
  min-width: 220px;
  transform: translateX(-50%);
  justify-items: center;
  gap: 2px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.question-mini span {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.82;
}

.question-mini strong {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
}

.hud {
  position: fixed;
  right: auto;
  bottom: 20px;
  left: 26px;
  z-index: 24;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
}

.hud-item:not(:nth-child(2)) {
  display: none;
}

.hud-item {
  min-width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.hud-label {
  display: none;
}

.hud-item strong {
  display: inline;
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.hud-item:first-child::before {
  content: "◒";
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 900;
}

.hud-item:nth-child(2)::before {
  content: "♨";
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 900;
}

.hud-item:nth-child(3)::before {
  content: "✓";
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 900;
}

.hud-item.hide-small {
  display: none;
}

.systems-toggle {
  position: fixed;
  top: 23px;
  right: 28px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.game-shell {
  display: block;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
}

.question-stage {
  display: block;
  min-height: 100dvh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #050505;
  box-shadow: none;
  overflow: hidden;
}

.question-stage::before {
  display: none;
}

.question-meta {
  display: none;
}

.category-chip,
.rarity-chip,
.answered-chip {
  min-height: 27px;
  border: 0;
  padding: 5px 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.question-text {
  display: none;
}

.choice-grid {
  position: absolute;
  inset: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  min-height: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 34px;
  padding: clamp(26px, 5vw, 76px);
  text-align: center;
  box-shadow: none;
  isolation: isolate;
}

.choice-a {
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.16), transparent 22%),
    linear-gradient(150deg, #ff5147 0%, #ff2f58 44%, #fa005f 100%);
}

.choice-b {
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.15), transparent 22%),
    linear-gradient(150deg, #10c9f2 0%, #0499ef 48%, #0873ff 100%);
}

.choice-card:hover,
.choice-card:focus-visible {
  transform: none;
  border-color: transparent;
  filter: brightness(1.03);
}

.choice-card.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    var(--selected-bg);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.48);
}

.choice-a.selected {
  --selected-bg: linear-gradient(150deg, #ff5147 0%, #ff2f58 44%, #fa005f 100%);
}

.choice-b.selected {
  --selected-bg: linear-gradient(150deg, #10c9f2 0%, #0499ef 48%, #0873ff 100%);
}

.choice-label {
  display: none;
}

.choice-copy {
  width: min(100%, 780px);
  max-width: 780px;
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4.2vw, 66px);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.14);
  text-transform: lowercase;
}

.vote-bar {
  background: rgba(255, 255, 255, 0.18);
  mix-blend-mode: soft-light;
}

.percent {
  position: absolute;
  right: 34px;
  bottom: 30px;
  min-height: 0;
  color: #fff;
  font-size: clamp(36px, 4.8vw, 76px);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.18);
}

.choice-a .percent {
  right: auto;
  left: 34px;
}

.prediction-panel,
.result-panel {
  position: fixed;
  right: auto;
  bottom: 34px;
  left: 50%;
  z-index: 26;
  width: min(620px, calc(100vw - 52px));
  margin: 0;
  transform: translateX(-50%);
  border: 0;
  border-radius: 24px;
  padding: 18px 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
  animation: splitOverlayIn 220ms ease both;
}

.prediction-panel p,
.result-panel p:last-child {
  color: rgba(255, 255, 255, 0.78);
}

.result-kicker {
  color: rgba(255, 255, 255, 0.68);
}

.result-panel h3 {
  color: #fff;
}

.primary-action,
.danger-action,
.next-button,
.ghost-button,
.buy-button,
.mini-button {
  border: 0;
  border-radius: 999px;
  color: #111;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.danger-action {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.next-button,
.buy-button {
  color: #111;
  background: #fff;
}

.reward-pop {
  position: fixed;
  top: 92px;
  right: auto;
  left: 50%;
  z-index: 32;
  max-width: min(420px, calc(100vw - 52px));
  transform: translateX(-50%);
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  animation: splitRewardIn 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reward-pop strong {
  color: #fff;
}

.side-panel {
  position: fixed;
  right: 28px;
  bottom: 22px;
  z-index: 22;
  width: min(340px, calc(100vw - 56px));
  display: none;
}

.status-card,
.event-log {
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.panel-label,
.event-item,
.status-card strong {
  color: rgba(255, 255, 255, 0.86);
}

.tabbar,
.systems-panel {
  display: none;
}

.app.systems-open .tabbar {
  --drawer-h: min(42vh, 380px);
  position: fixed;
  right: 28px;
  bottom: calc(28px + var(--drawer-h));
  left: 28px;
  z-index: 36;
  display: flex;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: rgba(9, 9, 9, 0.72);
  backdrop-filter: blur(20px);
}

.app.systems-open .systems-panel {
  --drawer-h: min(42vh, 380px);
  position: fixed;
  right: 28px;
  bottom: 28px;
  left: 28px;
  z-index: 35;
  display: block;
  max-width: none;
  height: var(--drawer-h);
  max-height: var(--drawer-h);
  margin: 0;
  overflow: auto;
  border: 0;
  border-radius: 0 0 22px 22px;
  background: rgba(9, 9, 9, 0.72);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
}

.tab.active {
  background: rgba(255, 255, 255, 0.16);
}

.system-card {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 820px) {
  .topbar {
    height: 78px;
    padding: 18px 20px;
  }

  .question-mini span,
  .question-meta {
    display: none;
  }

  .brand::before {
    width: 34px;
    height: 34px;
    font-size: 29px;
  }

  .systems-toggle {
    top: 15px;
    right: 18px;
  }

  .question-mini {
    top: 18px;
    min-width: 190px;
  }

  .question-mini strong {
    font-size: 21px;
  }

  .question-text {
    top: 66px;
    width: min(330px, calc(100vw - 48px));
    font-size: 13px;
  }

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

  .choice-card {
    border-radius: 26px;
    padding: 28px;
  }

  .choice-copy {
    width: min(100%, 320px);
    font-size: clamp(30px, 9vw, 44px);
  }

  .hud {
    bottom: 13px;
    left: 18px;
    grid-template-columns: none;
  }

  .hud-item strong {
    font-size: 18px;
  }

  .prediction-panel,
  .result-panel {
    bottom: 54px;
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
  }

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

  .app.systems-open .tabbar {
    right: 10px;
    left: 10px;
    --drawer-h: min(58vh, 520px);
    bottom: calc(10px + var(--drawer-h));
    overflow-x: auto;
  }

  .app.systems-open .systems-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    --drawer-h: min(58vh, 520px);
    height: var(--drawer-h);
    max-height: var(--drawer-h);
  }

  .panel-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes splitOverlayIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes splitRewardIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.96);
  }
  18%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
}
