/* ==========================================================================
   Daily Quiz Arcade — 100% Full 8-bit/16-bit Pixel Art Overhaul
   ========================================================================== */

@font-face {
  font-family: "Fusion Pixel";
  src: url("/fonts/fusion-pixel-12px-sc.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --px-cjk: "Fusion Pixel", "Silkscreen", "Press Start 2P", monospace;
  --px-font: "Press Start 2P", "Silkscreen", "Fusion Pixel", monospace;
  --px-ink: #140f26;
  --px-border: #3a2d5c;
  --px-neon-lime: #dafa88;
  --px-neon-gold: #ffd95a;
  --px-neon-cyan: #67e8f9;
  --px-neon-pink: #ff6b9d;
  --px-neon-violet: #b98cff;
  --ease-arcade: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--px-cjk);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

/* Crisp pixel rendering for pixel sprites & icons */
img, canvas {
  image-rendering: pixelated;
}

/* Deep arcade night sky + crisp pixel grid (all sky dots are now animated in #arcade-bg-particles!) */
body {
  background-color: #131026;
  background-image:
    linear-gradient(90deg, rgba(160, 128, 224, 0.11) 2px, transparent 2px),
    linear-gradient(rgba(160, 128, 224, 0.11) 2px, transparent 2px),
    linear-gradient(180deg, #131026 0%, #231c44 58%, var(--horizon, #523b7a) 100%);
  background-size: 24px 24px, 24px 24px, cover;
  background-attachment: fixed;
}

/* Header — chunky 8-bit arcade bezel with pixel checkerboard trim */
header, .pk-page header {
  position: relative;
  background: #1b1533;
  border-bottom: 4px solid #100c20;
  box-shadow:
    inset 0 -4px 0 #8d6ac9,
    0 6px 0 rgba(10, 7, 20, 0.75);
}

header::after, .pk-page header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--px-neon-lime) 0 8px, var(--px-neon-violet) 8px 16px, var(--px-neon-cyan) 16px 24px, var(--px-neon-pink) 24px 32px);
  opacity: 0.85;
  pointer-events: none;
}

.brand {
  letter-spacing: 0.5px;
  text-shadow: 3px 3px 0 #0d091c;
}

/* Zero border-radius everywhere for strict pixel silhouette */
.card, .timer, dialog, .editorial, .site-footer, .banner,
.quiet, .action, .item, .key, .option, input, select,
.leaderboard-shortcuts a, .mode-links a, .back-hall, .info-actions a,
.pk-page #pk-app, .pk-page #rank-dialog {
  border-radius: 0 !important;
}

/* Heavy double-outlined 8-bit pixel cards */
.card.stats, .card.shop, dialog, .editorial, .site-footer {
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.75),
    inset -4px -4px 0 rgba(78, 58, 114, 0.32),
    6px 6px 0 #0f0b1f;
}

.card.stats h2, .card.shop h2, .editorial h2 {
  text-shadow: 2px 2px 0 rgba(124, 92, 180, 0.2);
}

.timer {
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.7),
    inset -4px -4px 0 rgba(70, 96, 36, 0.35),
    6px 6px 0 #0f0b1f;
}

#timer, .points strong, .counter b, .key, .pk-page #pk-clock, .category {
  font-family: var(--px-font);
}

.category {
  font-size: 10px;
  letter-spacing: 0.5px;
  border: 2px solid #593b94;
  box-shadow: 2px 2px 0 rgba(26, 21, 48, 0.25);
}

#timer {
  font-size: 16px;
  letter-spacing: 1px;
}

.points strong {
  font-size: 22px;
  line-height: 1.5;
}

.counter b {
  font-size: 14px;
}

/* Chunky physical 8-bit arcade push buttons */
.quiet, .action, .item, .mode-links a, .leaderboard-shortcuts a, .back-hall, .info-actions a {
  border: 3px solid var(--px-ink);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.42),
    inset -3px -3px 0 rgba(26, 21, 48, 0.28),
    0 5px 0 #1c1333;
  transition: transform 130ms var(--ease-arcade), box-shadow 130ms var(--ease-arcade), filter 130ms ease-out;
}

.quiet:enabled:hover, .action:enabled:hover, .item:enabled:hover,
.mode-links a:hover, .leaderboard-shortcuts a:hover, .back-hall:hover, .info-actions a:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.52),
    inset -3px -3px 0 rgba(26, 21, 48, 0.28),
    0 7px 0 #1c1333;
}

button:enabled:active, .mode-links a:active, .leaderboard-shortcuts a:active, .back-hall:active {
  transform: translateY(4px) !important;
  box-shadow:
    inset 3px 3px 0 rgba(26, 21, 48, 0.25),
    0 1px 0 #1c1333 !important;
}

.back-hall {
  display: inline-block;
  padding: 9px 14px;
  border-color: #b494de;
  background: #2d2348;
  color: #f4ecff;
  box-shadow: inset 3px 3px 0 #4c3b73, 4px 4px 0 #0e0a1d;
}

.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.info-actions a {
  padding: 10px 14px;
  border-color: var(--px-ink);
  background: #ebe0fa;
  font-weight: 800;
  text-decoration: none;
  color: var(--px-ink);
}

.rank-card h2 {
  font-size: 20px;
}

/* Lobby Banner — Heavy Pixel Arcade Marquee */
.banner {
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 0 0 0 4px #6b4fa6,
    inset 0 0 0 8px #241b40,
    8px 8px 0 #0d091c;
}

.banner-text::before {
  content: "★ INSERT COIN · CREDIT 01 ★";
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 10px;
  font: 700 10px/1.3 var(--px-font);
  letter-spacing: 1px;
  color: #161129;
  background: var(--px-neon-lime);
  border: 3px solid var(--px-ink);
  box-shadow: 3px 3px 0 #0d091c;
}

html[lang="zh-CN"] .banner-text::before {
  content: "★ 投币开玩 · CREDIT 01 ★";
}

.banner h1 {
  text-shadow: 5px 5px 0 #140d29, -2px -2px 0 #7b5bb8;
}

/* ==========================================================================
   Arcade Cabinet (Daily / Practice / Hard Mode)
   ========================================================================== */
.machine {
  position: relative;
  box-shadow:
    inset 8px 8px 0 #e4ccff,
    inset -8px -8px 0 #2e1f45,
    inset -16px -16px 0 #62438f,
    0 12px 0 #0e0a1d;
}

.machine h1 {
  position: relative;
  padding: 0.48em 1.3em;
  border: 4px solid var(--px-ink);
  background:
    repeating-linear-gradient(0deg, #271b3e 0 4px, #372654 4px 8px);
  box-shadow:
    inset 4px 4px 0 #8968b3,
    inset -4px -4px 0 #171029,
    0 5px 0 #4a336e;
  text-shadow: 4px 4px 0 #140d26, 0 0 14px rgba(218, 250, 136, 0.42);
}

.machine h1::before,
.machine h1::after {
  content: "■ ■ ■";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font: 700 10px/1 monospace;
  letter-spacing: 4px;
  color: var(--px-neon-lime);
  text-shadow: 0 0 8px var(--px-neon-lime);
}

.machine h1::before { left: 12px; }
.machine h1::after { right: 8px; }

@media (max-width: 560px) {
  .machine h1::before,
  .machine h1::after { content: "■"; }
}

/* CRT Bezel & Phosphor Scanline Screen */
.machine #machine-screen {
  position: relative;
  overflow: hidden;
  border-color: #161129;
  background-image:
    repeating-linear-gradient(0deg, rgba(22, 16, 44, 0.08) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.45) 0%, transparent 72%),
    linear-gradient(145deg, var(--panel, #e4d8f6), var(--glass, #f3ecff) 52%, var(--panel, #e4d8f6));
  box-shadow:
    inset 0 0 0 4px #8b74b3,
    inset 0 0 30px rgba(24, 16, 48, 0.2),
    -4px -4px 0 #4d336e,
    4px 4px 0 #dcc4ff;
}

/* Cabinet Power LED & HUD Strip */
.arcade-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 12px;
  background: #1b1433;
  color: #efe9ff;
  border: 3px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #3b2d63, 0 3px 0 #463166;
  font: 700 10px/1.3 var(--px-font);
  letter-spacing: 0.8px;
}

.arcade-hud-led {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--px-neon-lime);
}

.arcade-hud-led i {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #7dff78;
  box-shadow: 0 0 0 2px #161129, 0 0 10px #7dff78;
}

.arcade-hud-combo {
  color: var(--px-neon-gold);
  min-height: 1em;
}

/* Pixel progress segments */
#progress i {
  height: 12px;
  border-radius: 0;
  border: 2px solid var(--px-ink);
  background: #d9d1e8;
  transition: background-color 200ms ease-out;
}

#progress .on {
  background: #8456d6;
  box-shadow: inset 0 3px 0 #c9aeff;
}

/* Arcade Question & Answer Option Buttons */
.machine .option,
.pk-page #pk-app .option {
  position: relative;
  border: 3px solid #392c57;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.72),
    0 5px 0 #4d3e6e;
  transition: transform 120ms var(--ease-arcade), background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.machine .option .key,
.pk-page #pk-app .option .key {
  width: 32px;
  height: 32px;
  font-size: 11px;
  border: 3px solid var(--px-ink);
  background: #e5dcf7;
  box-shadow: inset -2px -2px 0 #bcaeDB;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

.machine .option:hover:enabled,
.machine .option.selected {
  background: #efe4ff;
  border-color: #5b32a8;
  transform: translateX(4px);
}

.machine .option.selected .key {
  background: #6741b8;
  color: #f6ffbe;
  border-color: var(--px-ink);
  box-shadow: inset -2px -2px 0 #3f2478;
}

.machine .option.right,
.pk-page #pk-app .option.right {
  background: #dcf8b9 !important;
  border-color: #2f6b1c !important;
  box-shadow: inset 3px 3px 0 #f6ffe8, 0 4px 0 #2f6b1c;
}

.machine .option.wrong,
.pk-page #pk-app .option.wrong {
  background: #ffdbe3 !important;
  border-color: #a8284b !important;
  box-shadow: inset 3px 3px 0 #fff5f7, 0 4px 0 #a8284b;
}

/* Interactive Control Deck (Joystick + 2 Colored Arcade Buttons + Coin Slot) */
.control-deck {
  position: relative;
  height: 66px;
  padding: 0 18px;
  border: 4px solid var(--px-ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #9f7cc7;
  box-shadow:
    inset 0 4px 0 #e0c8ff,
    inset 0 -6px 0 #66458a;
}

.control-deck::before {
  content: "1P  [25¢]  START";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  background: #1d1633;
  color: var(--px-neon-gold);
  border: 3px solid var(--px-ink);
  box-shadow: inset 2px 2px 0 #0f0a1d;
  font: 700 9px/1 var(--px-font);
  letter-spacing: 1px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .control-deck::before {
    content: "1P [25¢]";
    font-size: 8px;
    padding: 4px 6px;
  }
}

.control-deck i::after {
  transition: transform 150ms var(--ease-arcade);
}

.control-deck b {
  width: 26px;
  height: 15px;
  transition: transform 120ms var(--ease-arcade), filter 120ms ease-out;
}

.machine[data-stick="left"] .control-deck i::after { transform: translate(-5px, -1px); }
.machine[data-stick="up"] .control-deck i::after { transform: translate(0, -5px); }
.machine[data-stick="right"] .control-deck i::after { transform: translate(5px, -1px); }
.machine[data-stick="down"] .control-deck i::after { transform: translate(0, 4px); }

.machine:has(button:enabled:active) .control-deck b:first-of-type,
.machine[data-btn="a"] .control-deck b:first-of-type {
  transform: translateY(4px);
  filter: brightness(1.35);
}

.machine[data-btn="b"] .control-deck b:last-of-type {
  transform: translateY(4px);
  filter: brightness(1.35);
}

/* ==========================================================================
   2P PK Battle Arena — Compact Top Layout + Heavy Pixel Style + Clear Rules
   ========================================================================== */
.pk-page {
  background-color: #111226;
  background-image:
    linear-gradient(90deg, rgba(103, 232, 249, 0.08) 2px, transparent 2px),
    linear-gradient(rgba(244, 114, 182, 0.08) 2px, transparent 2px),
    linear-gradient(180deg, #111226 0%, #1c193b 62%, #36204f 100%);
  background-size: 24px 24px, 24px 24px, cover;
}

.pk-page main {
  padding-top: 14px;
}

.pk-page .mode-links {
  margin-top: 0;
  margin-bottom: 10px;
}

.pk-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 12px;
}

.pk-page .pk-header-row h1 {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 32px);
  border-left: 6px solid var(--px-neon-cyan);
  padding-left: 12px;
  color: #ffffff;
  text-shadow: 3px 3px 0 #0c091c;
}

.pk-page .pk-sound-controls {
  margin: 0;
}

.pk-page #rank-dialog {
  margin: 0 0 12px;
  padding: 12px 16px;
  background: #f5f7ff;
  color: var(--px-ink);
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 0 0 0 3px #c7d5f5,
    6px 6px 0 #080917;
}

.pk-page #rank-dialog h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pk-page #rank-dialog p {
  margin: 4px 0;
}

.pk-page #pk-app {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  background: #f5f7ff;
  color: var(--px-ink);
  border: 4px solid var(--px-ink);
  border-top: 6px solid var(--px-neon-cyan);
  box-shadow:
    inset 0 0 0 3px #b7caef,
    6px 6px 0 #080917;
}

.pk-page #pk-app[data-phase="playing"] {
  background-image:
    repeating-linear-gradient(0deg, rgba(24, 29, 64, 0.07) 0 2px, transparent 2px 4px),
    linear-gradient(145deg, #edf4ff, #fafcff 55%, #eef2ff);
  box-shadow:
    inset 0 0 0 4px #7598d6,
    6px 6px 0 #080917;
}

.pk-page #pk-clock {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 12px;
  min-height: 1.4em;
  background: #1a1e3c;
  border: 3px solid var(--px-neon-cyan);
  box-shadow: 4px 4px 0 #080917;
  color: var(--px-neon-cyan);
  font-size: 14px;
}

.pk-page #pk-clock:empty,
.pk-page #pk-status:empty {
  display: none;
  margin: 0;
}

.pk-page #pk-status {
  margin: 0 0 10px;
  padding: 6px 10px;
  background: #3a1428;
  border: 2px solid #ff6b9d;
  color: #ffd6e4;
  font-weight: 700;
}

/* High-contrast bottom rules card on PK dark theme */
.pk-page .editorial.pk-rules-box {
  margin-top: 22px;
  padding: 20px 22px;
  background: #1c1838;
  color: #f4efff;
  border: 4px solid var(--px-neon-cyan);
  box-shadow:
    inset 0 0 0 3px #120f26,
    6px 6px 0 #080917;
}

.pk-page .editorial.pk-rules-box h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--px-neon-lime);
  text-shadow: 2px 2px 0 #0c091c;
}

.pk-page .editorial.pk-rules-box p {
  margin: 0;
  color: #ece6ff;
  font-size: 15px;
  line-height: 1.85;
}

/* Streamlined 1-click PK Lobby Controls */
.pk-quick-hero {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 900;
  background: var(--px-neon-lime);
  color: #162106;
  border: 3px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #f4ffd6, 0 5px 0 #314511;
}

.pk-quick-hero:enabled:hover {
  background: #e5ffa3;
  transform: translateY(-2px);
  box-shadow: inset 3px 3px 0 #f8ffe6, 0 7px 0 #314511;
}

.pk-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pk-action-row > button,
.pk-action-row > a {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  text-decoration: none;
}

.pk-join-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.pk-join-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 3px solid var(--px-ink);
  background: #fff;
  font: 700 14px/1.2 var(--px-font);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.pk-share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #e8efff;
  border: 3px solid #455994;
}

.pk-code-pill {
  padding: 6px 10px;
  background: #1b1838;
  color: var(--px-neon-gold);
  border: 3px solid var(--px-ink);
  font: 700 14px/1.2 var(--px-font);
  letter-spacing: 2px;
}

/* 1P vs 2P Arcade HUD inside PK */
.pk-vs-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #1b1838;
  color: #f4f2ff;
  border: 4px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #352e66, 5px 5px 0 #0b091c;
}

.pk-fighter { display: grid; gap: 6px; }
.pk-fighter.p2 { text-align: right; }
.pk-fighter-name { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }

.pk-fighter-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 6px;
  font: 700 9px/1.2 var(--px-font);
  background: var(--px-neon-cyan);
  color: var(--px-ink);
}

.pk-fighter.p2 .pk-fighter-tag {
  margin-right: 0;
  margin-left: 6px;
  background: var(--px-neon-pink);
}

.pk-vs-badge {
  padding: 6px 8px;
  font: 900 13px/1 var(--px-font);
  color: var(--px-neon-gold);
  background: #362259;
  border: 3px solid var(--px-neon-gold);
  box-shadow: 3px 3px 0 #120e24;
  text-shadow: 2px 2px 0 #120e24;
}

.pk-bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.pk-bars i { display: block; height: 11px; background: #342f5c; border: 2px solid #120e24; transition: background-color 200ms ease-out; }
.pk-fighter.p1 .pk-bars i.on { background: var(--px-neon-cyan); box-shadow: inset 0 2px 0 #d6fbff; }
.pk-fighter.p2 .pk-bars i.on { background: var(--px-neon-pink); box-shadow: inset 0 2px 0 #ffd1e1; }

/* ==========================================================================
   PK Win / Lose / Draw Dramatic Pixel Result Banner
   ========================================================================== */
.pk-result-banner {
  --result-accent: #c9c5ff;
  --result-bg: #1e1a3a;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(20px, 4vw, 34px) 18px;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 4px),
    var(--result-bg);
  color: var(--result-accent);
  border: 4px solid var(--result-accent);
  box-shadow: inset 0 0 0 4px #17132e, 6px 6px 0 #0d0a1e;
}

.pk-result-banner[data-outcome="win"] { --result-accent: #ffe066; --result-bg: #231942; }
.pk-result-banner[data-outcome="loss"] { --result-accent: #ff7ba9; --result-bg: #27152c; }
.pk-result-banner[data-outcome="draw"] { --result-accent: #7ceeff; --result-bg: #182342; }

.pk-result-sprite { display: inline-block; margin-bottom: 10px; }
.pk-result-sprite svg { width: 58px; height: 58px; image-rendering: pixelated; display: block; margin: auto; }
.pk-result-kicker { margin: 0 0 8px; font: 700 10px/1.4 var(--px-font); letter-spacing: 2px; opacity: 0.94; }
.pk-result-banner h3 { margin: 0; font: 900 clamp(1.35rem, 4.6vw, 2.15rem)/1.35 var(--px-font); letter-spacing: 0.04em; text-shadow: 3px 3px 0 #120d24; }
.pk-result-sub { margin: 10px 0 0; font: 700 11px/1.5 var(--px-font); color: #f3ecff; letter-spacing: 1px; }

/* ==========================================================================
   Floating Pixel Score/Combo Popups, Particle Bursts & Smooth Scan Beam
   ========================================================================== */
.arcade-float-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.arcade-popup {
  position: fixed;
  transform: translate(-50%, -50%);
  padding: 6px 11px;
  font: 900 13px/1.2 var(--px-font);
  letter-spacing: 1px;
  white-space: nowrap;
  border: 3px solid var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-ink);
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 9999;
}

.arcade-popup.is-correct { background: var(--px-neon-lime); color: #1c2b0a; }
.arcade-popup.is-combo { background: var(--px-neon-gold); color: #2e1b04; }
.arcade-popup.is-wrong { background: var(--px-neon-pink); color: #fff5f8; }

.arcade-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 9998;
  box-shadow: 2px 2px 0 rgba(20, 14, 38, 0.6);
}

/* ==========================================================================
   Silky 60fps 6-Bar Pixel Shutter Curtain (Zero Flash, Zero Double-Play)
   ========================================================================== */
html.arcade-entering::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #17122e;
  pointer-events: none;
}

/* ==========================================================================
   Animated Pixel Background Particles, Skyline Windows & Twinkling Starfield
   ========================================================================== */
body::before {
  z-index: -2 !important;
}

#arcade-bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-px-win {
  position: absolute;
  bottom: var(--y, 8vh);
  left: var(--x, 50%);
  width: var(--w, 4px);
  height: var(--h, 4px);
  background: var(--c, #ffd95a);
  box-shadow: 0 0 8px var(--c, #ffd95a);
  will-change: opacity, transform;
}

.bg-px-city-spark {
  position: absolute;
  bottom: var(--y, 6vh);
  left: var(--x, 50%);
  width: var(--s, 4px);
  height: var(--s, 4px);
  background: var(--c, #67e8f9);
  box-shadow: 0 0 10px var(--c, #67e8f9);
  opacity: 0;
  will-change: transform, opacity;
}

.bg-px-dot {
  position: absolute;
  bottom: -16px;
  left: var(--x, 50%);
  width: var(--s, 4px);
  height: var(--s, 4px);
  background: var(--c, #dafa88);
  box-shadow: 0 0 8px var(--c, #dafa88);
  opacity: 0;
  will-change: transform, opacity;
}

.bg-px-star {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 30%);
  width: var(--s, 4px);
  height: var(--s, 4px);
  background: var(--c, #f2e8ff);
  box-shadow: 0 0 6px var(--c, #f2e8ff);
  will-change: transform, opacity;
}

.bg-px-meteor {
  position: absolute;
  top: var(--y, 12%);
  left: var(--x, 85%);
  width: 68px;
  height: 3px;
  background: linear-gradient(90deg, #dafa88, #67e8f9 45%, transparent);
  transform: rotate(-28deg);
  opacity: 0;
  will-change: transform, opacity;
}

.bg-px-meteor::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  width: 7px;
  height: 7px;
  background: #f4ffbe;
  box-shadow: 0 0 10px #dafa88;
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: skyline-glow 5.5s ease-in-out infinite alternate;
  }
  .bg-px-dot {
    animation: bg-px-float var(--dur, 12s) linear var(--delay, 0s) infinite;
  }
  .bg-px-star {
    animation: bg-px-twinkle var(--dur, 3.2s) ease-in-out var(--delay, 0s) infinite;
  }
  .bg-px-win {
    animation: bg-win-flicker var(--dur, 3.6s) ease-in-out var(--delay, 0s) infinite;
  }
  .bg-px-city-spark {
    animation: bg-city-rise var(--dur, 5.5s) ease-out var(--delay, 0s) infinite;
  }
  .bg-px-meteor {
    animation: bg-px-shoot var(--dur, 7.5s) ease-in var(--delay, 0s) infinite;
  }
}

@keyframes skyline-glow {
  from { filter: brightness(0.95); }
  to { filter: brightness(1.18); }
}

@keyframes bg-win-flicker {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  45%, 55% { opacity: 0.95; transform: scale(1.15); }
}

@keyframes bg-city-rise {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  18% { opacity: 0.9; }
  75% { opacity: 0.7; }
  100% { transform: translate3d(var(--drift, 14px), -26vh, 0) scale(0.4); opacity: 0; }
}

@keyframes bg-px-float {
  0% { transform: translate3d(0, 0, 0) scale(0.8); opacity: 0; }
  12% { opacity: var(--op, 0.78); }
  50% { transform: translate3d(var(--drift, 18px), -52vh, 0) scale(1); opacity: var(--op, 0.78); }
  88% { opacity: var(--op, 0.65); }
  100% { transform: translate3d(calc(var(--drift, 18px) * -0.6), -108vh, 0) scale(0.7); opacity: 0; }
}

@keyframes bg-px-twinkle {
  0%, 100% { opacity: 0.28; transform: translate3d(0, 0, 0) scale(0.8); }
  50% { opacity: 1; transform: translate3d(var(--dx, 6px), var(--dy, -8px), 0) scale(1.3); }
}

@keyframes bg-px-shoot {
  0%, 62% { transform: translate3d(0, 0, 0) rotate(-28deg); opacity: 0; }
  66% { opacity: 0.9; }
  82% { transform: translate3d(-38vw, 24vh, 0) rotate(-28deg); opacity: 0.85; }
  88%, 100% { transform: translate3d(-46vw, 30vh, 0) rotate(-28deg); opacity: 0; }
}

body.audio-navigation-active > #arcade-transition {
  display: grid !important;
}

#arcade-transition {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  opacity: 0;
  visibility: hidden;
}

#arcade-transition .px-bar {
  background: #17122e;
  border-bottom: 2px solid #35275c;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

#arcade-transition .px-bar:nth-child(even) {
  background: #211940;
  transform-origin: right center;
}

#arcade-transition .px-label {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  background: #281e4b;
  color: var(--px-neon-lime);
  border: 3px solid var(--px-neon-lime);
  box-shadow: 4px 4px 0 #0c091a;
  font: 700 12px/1.4 var(--px-font);
  letter-spacing: 2px;
  opacity: 0;
  will-change: transform, opacity;
}

#arcade-transition.is-closing {
  visibility: visible;
  opacity: 1;
}

#arcade-transition.is-closing .px-bar {
  animation: px-shutter-in 170ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#arcade-transition.is-closing .px-label {
  animation: px-label-in 150ms var(--ease-arcade) forwards;
}

#arcade-transition.is-opening {
  visibility: visible;
  opacity: 1;
}

#arcade-transition.is-opening .px-bar {
  transform: scaleX(1);
  animation: px-shutter-out 260ms var(--ease-arcade) forwards;
}

#arcade-transition.is-opening .px-bar:nth-child(2) { animation-delay: 18ms; }
#arcade-transition.is-opening .px-bar:nth-child(3) { animation-delay: 34ms; }
#arcade-transition.is-opening .px-bar:nth-child(4) { animation-delay: 20ms; }
#arcade-transition.is-opening .px-bar:nth-child(5) { animation-delay: 38ms; }
#arcade-transition.is-opening .px-bar:nth-child(6) { animation-delay: 14ms; }

@keyframes px-shutter-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes px-shutter-out {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes px-label-in {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.info-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.info-tool-status { margin-top: 10px; font-weight: 700; color: #4f3185; }

/* ==========================================================================
   All Other Modes — Heavy Mode-Specific Pixel Arcade Cabinets & High Scores
   ========================================================================== */

/* Compact top spacing & PK-style full-width focused layout on Daily / Practice / Hard */
.arcade-page {
  --mode-accent: #dafa88;
  --mode-accent-2: #b98cff;
}
.arcade-page:has(#machine-screen #drill) {
  --mode-accent: #67e8f9;
  --mode-accent-2: #4fd1c5;
}
.arcade-page:has(#machine-screen #hard-panel) {
  --mode-accent: #ff6b9d;
  --mode-accent-2: #ffd95a;
}

.arcade-page header .top {
  height: 52px;
}

.arcade-page main.wrap {
  max-width: 820px;
  padding-top: 8px;
}

.arcade-page .cabinet-nav {
  margin: 0 0 8px;
  gap: 8px;
}

.arcade-page .cabinet-nav a {
  padding: 5px 11px;
  font-size: 13px;
  background: #232b4a;
  color: #f3f6ff;
  border: 2px solid var(--px-ink);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.2), 0 3px 0 #120e24;
}

.arcade-page .cabinet-nav a.back-hall {
  margin: 0;
  background: var(--mode-accent);
  color: #161129;
  font-weight: 900;
}

/* Full Physical Pixel Arcade Cabinet — compact enough to see the WHOLE machine above the fold! */
.arcade-page .machine {
  display: flex;
  flex-direction: column;
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 16px 14px;
  background: #8e63d6 !important;
  clip-path: polygon(0 12px,6px 12px,6px 6px,12px 6px,12px 0,calc(100% - 12px) 0,calc(100% - 12px) 6px,calc(100% - 6px) 6px,calc(100% - 6px) 12px,100% 12px,100% calc(100% - 12px),calc(100% - 6px) calc(100% - 12px),calc(100% - 6px) calc(100% - 6px),calc(100% - 12px) calc(100% - 6px),calc(100% - 12px) 100%,12px 100%,12px calc(100% - 6px),6px calc(100% - 6px),6px calc(100% - 12px),0 calc(100% - 12px)) !important;
  box-shadow:
    inset 7px 7px 0 #dfc5ff,
    inset -7px -7px 0 #2e1f45,
    inset -14px -14px 0 #62438f,
    0 10px 0 #0e0a1d !important;
}

.arcade-page .machine h1 {
  order: 1;
  text-align: center;
  margin: 0 0 8px;
  padding: 6px 36px;
  font-size: clamp(18px, 2.8vw, 25px);
  letter-spacing: 0.1em;
  color: #edffaf;
  background: repeating-linear-gradient(0deg, #271b3e 0 4px, #372654 4px 8px) !important;
  border: 4px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #8968b3, inset -3px -3px 0 #171029, 0 4px 0 #4a336e !important;
  text-shadow: 3px 3px 0 #140d26, 0 0 12px rgba(218, 250, 136, 0.4);
}

.arcade-page .machine h1::before,
.arcade-page .machine h1::after {
  display: block;
}

.arcade-page .arcade-hud-bar {
  order: 2;
  margin-bottom: 6px;
  padding: 5px 10px;
  border-color: var(--px-ink);
  box-shadow: inset 2px 2px 0 #35295c;
}

.arcade-page .machine #machine-screen {
  order: 3;
  padding: 14px 18px;
  border: 8px solid #161129;
  background-color: #f5f7ff;
  background-image:
    repeating-linear-gradient(0deg, rgba(24, 29, 64, 0.07) 0 2px, transparent 2px 4px),
    linear-gradient(145deg, #f0f4ff, #fafcff 55%, #eef2ff) !important;
  box-shadow:
    inset 0 0 0 3px #8b74b3,
    inset 0 0 22px rgba(24, 16, 48, 0.18),
    -3px -3px 0 #4d336e,
    3px 3px 0 #dcc4ff !important;
}

/* Compact screen typography & controls so the ENTIRE cabinet (marquee + screen + joystick deck) fits in one view! */
.arcade-page #progress {
  margin: 8px 0 12px;
}

.arcade-page #machine-screen .question {
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.4;
  margin: 0 0 12px;
}

.arcade-page #machine-screen .choices {
  gap: 7px;
}

.arcade-page #machine-screen .option {
  min-height: 40px;
  padding: 6px 11px;
  font-size: 15px;
}

.arcade-page #machine-screen .action {
  margin-top: 12px;
  padding: 9px;
}

.arcade-page #machine-screen .inventory {
  margin-top: 12px;
  padding-top: 10px;
}

.arcade-page #machine-screen .item {
  padding: 6px 8px;
}

.arcade-page .control-deck {
  order: 4;
  height: 50px;
  margin-top: 8px;
  border: 4px solid var(--px-ink);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), inset 0 -5px 0 rgba(16, 11, 32, 0.45);
}

/* Move mode description cleanly below the cabinet, high-contrast */
.arcade-page .mode-description {
  order: 5;
  margin: 10px 0 0;
  padding: 9px 12px;
  background: #1c1838;
  border: 3px solid var(--mode-accent);
  color: #efeaff;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

/* Arrange aside cards (Login / Stats / Shop / Timer) neatly in a 2-column grid below the play screen */
.arcade-page .grid {
  margin-top: 16px;
}

.arcade-page .grid > aside {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}

.arcade-page .grid > aside > * {
  margin: 0 !important;
}

/* High-contrast dark-arcade bottom guide & sample questions (matching PK bottom rules card) */
.arcade-page .editorial {
  margin-top: 22px;
  padding: 22px 24px;
  background: #1c1838;
  color: #f2edff;
  border: 4px solid var(--mode-accent);
  box-shadow: inset 0 0 0 3px #120f26, 6px 6px 0 #080917;
}

.arcade-page .editorial h2,
.arcade-page .editorial h3 {
  color: var(--mode-accent);
  text-shadow: 2px 2px 0 #0c091c;
}

.arcade-page .editorial p,
.arcade-page .editorial li,
.arcade-page .editorial summary {
  color: #ece6ff;
}

.arcade-page .editorial a {
  color: var(--px-neon-cyan);
}

.arcade-page .editorial details {
  border-bottom-color: #3d3369;
}

.arcade-page .site-footer {
  max-width: 900px;
  background: #171b35;
  border: 4px solid #64709a;
  color: #e4eaff;
}

.arcade-page .site-footer a,
.arcade-page .site-footer a:visited {
  color: #e4eaff;
}

/* Lobby: Pixel Marquee Leaderboard Tabs + Mini-CRT Quiz Card + Week LEDs */
.leaderboard-shortcuts a:nth-child(1) {
  background: #dafa88;
  color: #162106;
}
.leaderboard-shortcuts a:nth-child(2) {
  background: #ff8bc2;
  color: #29091a;
}
.leaderboard-shortcuts a:nth-child(3) {
  background: #7ceeff;
  color: #07222b;
}

.grid > .quiz.card {
  border: 4px solid var(--px-ink);
  background-image:
    repeating-linear-gradient(0deg, rgba(22, 16, 44, 0.06) 0 2px, transparent 2px 4px),
    linear-gradient(145deg, #efe8fc, #faf7ff 55%, #e7def7);
  box-shadow:
    inset 0 0 0 4px #a68fd1,
    6px 6px 0 #0f0b1f;
}

#week i {
  border-radius: 0 !important;
  border: 2px solid var(--px-ink) !important;
  font-family: var(--px-font) !important;
  font-size: 10px !important;
}

#week .today {
  background: #d8c2ff !important;
  box-shadow: 0 0 0 2px #7c51cc;
}

#week .done {
  background: var(--px-neon-lime) !important;
  color: #1b2b05 !important;
}

/* High-contrast pool summary note on dark starry background */
.pool-summary {
  margin-top: 18px;
  padding: 14px 18px;
  background: #1b1636;
  color: #e4dcff;
  border: 3px solid #6b529c;
  box-shadow: 4px 4px 0 #0e0a1d;
  font-size: 13px;
  line-height: 1.75;
}

/* Practice Mode — Emerald / Cyan Retro Training Cabinet */
body:has(#machine-screen #drill) .machine {
  background: #2c8a80 !important;
  box-shadow:
    inset 7px 7px 0 #8ff0e4,
    inset -7px -7px 0 #174a45,
    inset -14px -14px 0 #216b63,
    0 10px 0 #0a1f1e !important;
}

body:has(#machine-screen #drill) .machine h1 {
  background: repeating-linear-gradient(0deg, #133638 0 4px, #1b4a4d 4px 8px) !important;
  color: #a8fff4;
  text-shadow: 3px 3px 0 #0b2022, 0 0 12px rgba(103, 232, 249, 0.45);
}

body:has(#machine-screen #drill) .machine #machine-screen {
  box-shadow:
    inset 0 0 0 3px #52aba1,
    inset 0 0 24px rgba(12, 46, 44, 0.2),
    -3px -3px 0 #1d5c56,
    3px 3px 0 #8ff0e4 !important;
}

body:has(#machine-screen #drill) .control-deck {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #3ca397;
  box-shadow: inset 0 4px 0 #9df5ea, inset 0 -6px 0 #1f635c;
}

body:has(#machine-screen #drill) .control-deck::before {
  content: "TRAINING · 5Q";
  color: var(--px-neon-cyan);
}

/* Practice 5-block Pixel LED Trail */
.practice-trail {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  letter-spacing: 0;
}

.practice-trail .trail-led {
  flex: 1;
  display: grid;
  place-items: center;
  height: 26px;
  border: 3px solid var(--px-ink);
  background: #d2e0de;
  color: #465e5b;
  font: 700 11px/1 var(--px-font);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.55);
}

.practice-trail .trail-led.now {
  background: var(--px-neon-gold);
  color: #291a03;
  box-shadow: 0 0 10px rgba(255, 217, 90, 0.65);
}

.practice-trail .trail-led.hit {
  background: var(--px-neon-lime);
  color: #162905;
}

.practice-trail .trail-led.miss {
  background: var(--px-neon-pink);
  color: #fff2f6;
}

/* Hard Mode — Crimson / Magenta BOSS STAGE Cabinet */
body:has(#machine-screen #hard-panel) .machine {
  background: #ab376a !important;
  box-shadow:
    inset 7px 7px 0 #ffa6cb,
    inset -7px -7px 0 #521431,
    inset -14px -14px 0 #7d224c,
    0 10px 0 #210815 !important;
}

body:has(#machine-screen #hard-panel) .machine h1 {
  background: repeating-linear-gradient(0deg, #3b1027 0 4px, #4f1735 4px 8px) !important;
  color: #ffe066;
  text-shadow: 3px 3px 0 #240717, 0 0 14px rgba(255, 107, 157, 0.55);
}

body:has(#machine-screen #hard-panel) .machine #machine-screen {
  box-shadow:
    inset 0 0 0 3px #c76b95,
    inset 0 0 24px rgba(68, 14, 42, 0.22),
    -3px -3px 0 #6e1e43,
    3px 3px 0 #ffa6cb !important;
}

body:has(#machine-screen #hard-panel) .control-deck {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #bf4c7e;
  box-shadow: inset 0 4px 0 #ffb3d2, inset 0 -6px 0 #752046;
}

body:has(#machine-screen #hard-panel) .control-deck::before {
  content: "⚠ BOSS STAGE ⚠";
  color: #ff80aa;
}

/* Hard Mode 10-Block Boss Progress HUD */
.hard-boss-hud {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #2b1024;
  color: #ffe4ef;
  border: 3px solid var(--px-ink);
  box-shadow: inset 2px 2px 0 #5c2249, 4px 4px 0 #170814;
}

.hard-boss-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font: 700 10px/1.3 var(--px-font);
  color: var(--px-neon-gold);
}

.hard-boss-bars {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.hard-boss-bars i {
  display: block;
  height: 12px;
  background: #4f203d;
  border: 2px solid #170814;
}

.hard-boss-bars i.on {
  background: #ff5e94;
  box-shadow: inset 0 2px 0 #ffc2d7;
}

.hard-boss-bars i.now {
  background: var(--px-neon-gold);
  box-shadow: 0 0 8px rgba(255, 217, 90, 0.7);
}

/* Daily / Practice / Hard Stage Clear Pixel Banner */
.arcade-stage-clear {
  margin-bottom: 16px;
  padding: 20px 16px;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 4px),
    #1f173b;
  color: var(--px-neon-gold);
  border: 4px solid var(--px-neon-gold);
  box-shadow: inset 0 0 0 3px #140f29, 5px 5px 0 #0e0a1d;
}

.arcade-stage-clear.is-boss {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 4px),
    #301129;
  border-color: #ff6b9d;
}

.arcade-stage-clear .stage-kicker {
  margin: 0 0 8px;
  font: 700 10px/1.4 var(--px-font);
  letter-spacing: 2px;
  color: var(--px-neon-lime);
}

.arcade-stage-clear h2,
.arcade-stage-clear h3 {
  display: block;
  margin: 0;
  color: var(--px-neon-gold);
  font: 900 clamp(1.1rem, 3.6vw, 1.6rem)/1.4 var(--px-font);
  text-shadow: 3px 3px 0 #100b21;
}

.arcade-stage-clear .stage-score {
  margin: 10px 0 0;
  color: #f3ecff;
  font-weight: 800;
  font-size: 15px;
}

.arcade-stage-clear .stage-emoji-grid {
  margin: 10px 0 0;
  font-size: 18px;
  letter-spacing: 3px;
}

.arcade-share-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  background: var(--px-neon-gold);
  color: #241602;
  font-weight: 900;
  border: 3px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #fff4bd, 0 5px 0 #6b4e07;
}

.arcade-share-btn:enabled:hover {
  background: #ffe57d;
}

.arcade-share-btn.is-copied {
  background: var(--px-neon-lime);
  color: #162605;
}

.guest-welcome-box {
  display: grid;
  gap: 10px;
}

.guest-welcome-box p {
  margin: 0;
  color: #463a61;
  font-size: 14px;
  line-height: 1.6;
}

.guest-upsell {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f3ecff;
  border: 3px solid #6b47b3;
  box-shadow: 4px 4px 0 rgba(22, 17, 41, 0.2);
}

.guest-upsell p {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #2e1d52;
}

.guest-cta-primary {
  width: 100%;
  padding: 12px 16px;
  background: var(--px-neon-lime);
  color: #162106;
  font-weight: 900;
  font-size: 15px;
  border: 3px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #f4ffd6, 0 5px 0 #314511;
}

/* Leaderboards Page — Classic Arcade HIGH SCORES CRT Table */
.leaderboard-page:not(.pk-page) main {
  padding-top: 16px;
}

.leaderboard-page:not(.pk-page) h1 {
  margin: 12px 0 14px;
  color: var(--px-neon-gold);
  font-family: var(--px-font);
  font-size: clamp(1.15rem, 3.4vw, 1.75rem);
  letter-spacing: 1px;
  text-shadow: 4px 4px 0 #0e0a1d;
}

.leaderboard-page:not(.pk-page) #rank-dialog {
  background: #1a1636;
  color: #f1ebff;
  border: 4px solid var(--px-neon-gold);
  box-shadow: inset 0 0 0 3px #100d24, 6px 6px 0 #090717;
}

.leaderboard-page:not(.pk-page) #rank-dialog h2 {
  margin: 0 0 8px;
  color: var(--px-neon-lime);
}

.leaderboard-page:not(.pk-page) #rank-dialog input,
.leaderboard-page:not(.pk-page) #rank-dialog select {
  background: #27214d;
  color: #fff;
  border: 2px solid #8a72bd;
}

.leaderboard-page:not(.pk-page) #rank-dialog .quiet {
  background: #352b63;
  color: #f6f2ff;
  border-color: #b49be6;
}

.leaderboard-page:not(.pk-page) #rank-dialog table {
  border: 3px solid #59468c;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 4px),
    #131029;
}

.leaderboard-page:not(.pk-page) #rank-dialog th {
  background: #2a2152;
  color: var(--px-neon-cyan);
  font: 700 11px/1.4 var(--px-font);
  padding: 10px 8px;
  border-bottom: 3px solid #59468c;
}

.leaderboard-page:not(.pk-page) #rank-dialog td {
  padding: 10px 8px;
  border-bottom: 1px solid #2e2654;
  color: #f2edff;
  font-weight: 700;
}

.leaderboard-page:not(.pk-page) #rank-dialog td:first-child,
.leaderboard-page:not(.pk-page) #rank-dialog td:nth-child(3) {
  font-family: var(--px-font);
  font-size: 12px;
}

.leaderboard-page:not(.pk-page) #rank-rows tr:nth-child(1) td {
  color: var(--px-neon-gold);
  background: rgba(255, 217, 90, 0.1);
}

.leaderboard-page:not(.pk-page) #rank-rows tr:nth-child(2) td {
  color: var(--px-neon-cyan);
  background: rgba(103, 232, 249, 0.08);
}

.leaderboard-page:not(.pk-page) #rank-rows tr:nth-child(3) td {
  color: var(--px-neon-pink);
  background: rgba(255, 107, 157, 0.08);
}

.leaderboard-page:not(.pk-page) .editorial.pk-rules-box {
  margin-top: 20px;
  padding: 18px 20px;
  background: #1b1636;
  color: #ede6ff;
  border: 3px solid #8a72bd;
  box-shadow: 5px 5px 0 #0b081a;
}

.leaderboard-page:not(.pk-page) .editorial.pk-rules-box h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--px-neon-lime);
}

.leaderboard-page:not(.pk-page) .editorial.pk-rules-box p {
  color: #e6deff;
}

/* ==========================================================================
   Keyframes (Silky Smooth 60fps Motion with Pixel-Art Styling)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .banner-text::before { animation: coin-pulse 2.2s ease-in-out infinite; }
  .machine h1::before, .machine h1::after { animation: marquee-leds 1.6s ease-in-out infinite; }
  .arcade-hud-led i { animation: led-pulse 1.8s ease-in-out infinite; }
  .arcade-arrival { animation: crt-power-on 280ms var(--ease-arcade); }
  .arcade-question-enter { animation: question-slide-in 220ms var(--ease-arcade); }
  .arcade-feedback[data-arcade-feedback="correct"] { animation: cabinet-hit-ok 420ms ease-out; }
  .arcade-feedback[data-arcade-feedback="incorrect"] { animation: cabinet-hit-miss 360ms ease-out; }
  #machine-screen.arcade-feedback + .control-deck b { animation: cabinet-lamp 320ms ease-out; }
  .arcade-popup { animation: popup-rise 820ms var(--ease-snappy) forwards; }
  .arcade-particle { animation: particle-fly var(--dur, 640ms) var(--ease-snappy) forwards; }

  .pk-result-banner[data-outcome="win"] { animation: win-border-glow 1.8s ease-in-out infinite; }
  .pk-result-banner[data-outcome="win"] .pk-result-sprite { animation: trophy-bounce 760ms ease-in-out infinite; }
  .pk-result-banner[data-outcome="win"] h3 { animation: victory-pop 520ms var(--ease-arcade); }
  .pk-result-banner[data-outcome="loss"] { animation: defeat-shake 440ms ease-out; }
  .pk-result-banner[data-outcome="loss"] .pk-result-sprite { animation: defeat-drop 540ms var(--ease-arcade); }
  .pk-result-banner[data-outcome="loss"] h3 { animation: defeat-reveal 500ms var(--ease-arcade); }
  .pk-result-banner[data-outcome="loss"] .pk-result-sub { animation: coin-pulse 1.5s ease-in-out infinite; }
  .pk-result-banner[data-outcome="draw"] h3 { animation: draw-clash 440ms var(--ease-arcade); }
  .pk-vs-badge { animation: vs-pulse 1.6s ease-in-out infinite; }
}

@keyframes coin-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.68; } }
@keyframes marquee-leds { 0%, 100% { color: #dafa88; text-shadow: 0 0 8px #dafa88; } 33% { color: #ff8bc2; text-shadow: 0 0 8px #ff8bc2; } 66% { color: #67e8f9; text-shadow: 0 0 8px #67e8f9; } }
@keyframes led-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.9); } }
@keyframes crt-power-on { from { opacity: 0.35; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes question-slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes cabinet-hit-ok {
  0% { box-shadow: inset 0 0 0 5px #74e058, 0 0 18px rgba(132, 245, 96, 0.5), -4px -4px 0 #4d336e, 4px 4px 0 #dcc4ff; }
  100% { box-shadow: inset 0 0 0 4px #8b74b3, -4px -4px 0 #4d336e, 4px 4px 0 #dcc4ff; }
}
@keyframes cabinet-hit-miss {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px); }
  32% { transform: translateX(6px); }
  50% { transform: translateX(-4px); }
  68% { transform: translateX(3px); }
  84% { transform: translateX(-1px); }
}
@keyframes cabinet-lamp { 0% { filter: brightness(1.65); transform: translateY(3px); } 100% { filter: brightness(1); transform: translateY(0); } }
@keyframes popup-rise {
  0% { opacity: 0; transform: translate(-50%, -15%) scale(0.65); }
  22% { opacity: 1; transform: translate(-50%, -70%) scale(1.08); }
  40% { opacity: 1; transform: translate(-50%, -88%) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -120%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(0.94); }
}
@keyframes particle-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  70% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, -40px)) scale(0.35); }
}
@keyframes win-border-glow {
  0%, 100% { border-color: #ffe066; box-shadow: inset 0 0 0 4px #17132e, 0 0 18px rgba(255, 224, 102, 0.45), 6px 6px 0 #0d0a1e; }
  50% { border-color: #dafa88; box-shadow: inset 0 0 0 4px #17132e, 0 0 24px rgba(218, 250, 136, 0.55), 6px 6px 0 #0d0a1e; }
}
@keyframes trophy-bounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7px) scale(1.05); } }
@keyframes victory-pop { 0% { opacity: 0; transform: scale(0.75) translateY(14px); } 65% { opacity: 1; transform: scale(1.05) translateY(-2px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes defeat-shake { 0%, 100% { transform: translateX(0); } 16% { transform: translateX(-7px); } 34% { transform: translateX(6px); } 52% { transform: translateX(-4px); } 72% { transform: translateX(2px); } }
@keyframes defeat-drop { 0% { opacity: 0; transform: translateY(-18px) scale(0.9); } 70% { opacity: 1; transform: translateY(3px) scale(1); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes defeat-reveal { 0% { opacity: 0; transform: translateY(-8px) scale(1.06); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes draw-clash { 0% { opacity: 0; transform: scale(0.84); letter-spacing: 0.16em; } 100% { opacity: 1; transform: scale(1); letter-spacing: 0.04em; } }
@keyframes vs-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }


/* ==========================================================================
   FULL 100% PIXEL ART MODE — Typography, Cursors, Dither, RPG Menus & Dark Manual
   ========================================================================== */

/* 1. Universal Crisp Pixel Typography (100% Chinese + English Bitmap Font) */
html, body, button, input, select, textarea, dialog, table, th, td,
h1, h2, h3, h4, p, a, li, span, small, strong, em, summary, label, time {
  font-family: var(--px-cjk);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

body {
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  /* Crisp 16-bit classic pixel arrow cursor */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23140f26' d='M0 0h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v2H6v1h1v2h1v1H6v-1H5v-2H4v-1H3v1H2v1H0V0z'/%3E%3Cpath fill='%23ffffff' d='M1 2h1v1h1v1h1v1h1v1h1v1h1v1h1v1H5v2h1v2H5v-2H4v-1H3v1H2v1H1V2z'/%3E%3Cpath fill='%23cfc2f5' d='M2 3h1v1h1v1h1v1h1v1h1v1H6v1H5V8H4V7H3V6H2V3z'/%3E%3C/svg%3E") 1 1, default;
}

a, button:enabled, summary, select, label, [role="button"] {
  /* Crisp 16-bit classic pixel gloved pointing hand cursor */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23140f26' d='M5 0h2v4h2v1h2v1h2v1h1v5h-1v2H4v-2H3v-2H2V8H1V6h2v1h1V1h1V0z'/%3E%3Cpath fill='%23ffffff' d='M5 1h2v6h1V5h1v2h1V6h1v2h1V7h1v5h-1v1H5v-1H4v-2H3V8H2V7h1v1h1v1h1V1z'/%3E%3Cpath fill='%23ffd95a' d='M5 12h7v1H5z'/%3E%3C/svg%3E") 8 1, pointer;
}

/* Strict zero border-radius on every element */
*, *::before, *::after {
  border-radius: 0 !important;
}

/* Crisp pixel scrollbars */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
::-webkit-scrollbar-track {
  background: #140f26;
  border-left: 2px solid #3a2d5c;
}
::-webkit-scrollbar-thumb {
  background: #7c5bc4;
  border: 3px solid #140f26;
  box-shadow: inset 2px 2px 0 #c9aeff, inset -2px -2px 0 #473078;
}
::-webkit-scrollbar-thumb:hover {
  background: #dafa88;
}

/* 2. Stepped 8-bit Retro Night Sky Bands + Pixel Grid (Zero Smooth Blur) */
body {
  background-color: #120e24;
  background-image:
    linear-gradient(90deg, rgba(168, 136, 235, 0.09) 2px, transparent 2px),
    linear-gradient(rgba(168, 136, 235, 0.09) 2px, transparent 2px),
    linear-gradient(
      180deg,
      #100c20 0%, #100c20 22%,
      #171130 22%, #171130 44%,
      #201842 44%, #201842 66%,
      #2c2059 66%, #2c2059 84%,
      var(--horizon, #452e73) 84%, var(--horizon, #452e73) 100%
    );
  background-size: 16px 16px, 16px 16px, 100% 100%;
  background-attachment: fixed;
}

.pk-page {
  background-color: #0e1024;
  background-image:
    linear-gradient(90deg, rgba(103, 232, 249, 0.09) 2px, transparent 2px),
    linear-gradient(rgba(255, 107, 157, 0.08) 2px, transparent 2px),
    linear-gradient(
      180deg,
      #0c0d1f 0%, #0c0d1f 28%,
      #131430 28%, #131430 56%,
      #1c1842 56%, #1c1842 80%,
      #2e1c4d 80%, #2e1c4d 100%
    );
  background-size: 16px 16px, 16px 16px, 100% 100%;
}

/* Blocky 8-bit city skyline at bottom */
body::before {
  background:
    repeating-linear-gradient(90deg, transparent 0 16px, #120e24 16px 20px),
    repeating-linear-gradient(0deg, #1d1838 0 10px, #4f3d73 10px 12px);
}

/* 3. Header & Top Bar — Pure 8-bit Console Bar */
header, .pk-page header {
  background: #17112e;
  border-bottom: 4px solid #0b0817;
  box-shadow: inset 0 4px 0 #34265c, inset 0 -4px 0 #7b5bb8, 0 6px 0 rgba(8, 5, 18, 0.85);
}

.brand {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #f8f4ff;
  text-shadow: 3px 3px 0 #0a0616, -2px 0 0 #5b3b96;
}

header .quiet {
  background: #2c224d;
  color: #f6f0ff;
  border: 3px solid #0c081a;
  box-shadow: inset 2px 2px 0 #55428a, inset -2px -2px 0 #181130, 0 4px 0 #0c081a;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
}

header .quiet#music[aria-pressed="true"] {
  background: var(--px-neon-lime);
  color: #162405;
  box-shadow: inset 2px 2px 0 #f4ffd6, inset -2px -2px 0 #82a337, 0 4px 0 #0c081a;
}

.quiet b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  line-height: 1;
  border: 2px solid currentColor;
  background: #140f26;
  color: var(--px-neon-gold);
  font-family: var(--px-font);
  font-size: 10px;
}

/* 4. Lobby Banner — 16-bit Arcade Title Screen */
.banner {
  background:
    repeating-conic-gradient(#1f173b 0% 25%, #261d47 0% 50%) 0 0 / 16px 16px;
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 0 0 0 4px #7858b8,
    inset 0 0 0 8px #17112e,
    8px 8px 0 #090614;
}

.banner::before {
  background-image:
    repeating-linear-gradient(0deg, rgba(10, 7, 22, 0.28) 0 2px, transparent 2px 4px);
  background-size: 100% 4px;
}

.banner h1 {
  font-weight: 400;
  letter-spacing: 4px;
  text-shadow:
    4px 4px 0 #0b071a,
    -2px -2px 0 #5b3b96,
    2px -2px 0 #5b3b96,
    -2px 2px 0 #5b3b96;
}

.banner h1 span {
  color: var(--px-neon-lime);
}

.banner p {
  color: #ede6ff;
  font-size: 15px;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #120c24;
}

/* Distinct 8-bit Cartridge Colors for Mode Links */
.mode-links a {
  font-weight: 400;
  letter-spacing: 1px;
  padding: 8px 14px;
  border: 3px solid var(--px-ink);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.45),
    inset -3px -3px 0 rgba(16, 11, 32, 0.35),
    0 5px 0 #0d091c;
}

.mode-links a[href*="/practice"] {
  background: #5eead4;
  color: #082926;
}
.mode-links a[href*="/daily"] {
  background: #dafa88;
  color: #162405;
}
.mode-links a[href*="/hard"] {
  background: #ff7ba9;
  color: #2b0716;
}
.mode-links a[href*="/pk"] {
  background: #7ceeff;
  color: #07222b;
}

/* 5. Pixel RPG / Arcade Windows for Cards, Stats, Shop, Timer & Dialogs */
.card.stats, .card.shop, dialog {
  position: relative;
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.35) 0% 25%, transparent 0% 50%) 0 0 / 8px 8px,
    #efe8fc;
  color: var(--px-ink);
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 4px 4px 0 #ffffff,
    inset -4px -4px 0 #b8a5db,
    6px 6px 0 #0a0717;
}

.card.stats h2, .card.shop h2, dialog h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 1px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 3px solid var(--px-ink);
  text-shadow: 2px 2px 0 rgba(130, 96, 196, 0.25);
}

/* Retro Dark LCD Score & Streak Display inside Stats Card */
.points {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 4px),
    #16112b;
  border: 4px solid var(--px-ink);
  box-shadow: inset 3px 3px 0 #0b0817, inset -3px -3px 0 #372b61;
  padding: 12px 6px;
}

.points > div + div {
  border-left: 3px solid #372b61;
}

.points small {
  color: #c8b8f0;
  font-size: 12px;
  letter-spacing: 1px;
}

.points strong {
  color: var(--px-neon-lime);
  font-family: var(--px-font);
  font-size: 20px;
  text-shadow: 2px 2px 0 #090614;
}

.points > div:last-child strong {
  color: var(--px-neon-gold);
}

.points em {
  font-family: var(--px-cjk);
  font-style: normal;
  font-size: 12px;
  color: #e9dcff;
}

/* Pixel Countdown Clock Box */
.timer {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 4px),
    #182616;
  color: var(--px-neon-lime);
  border: 4px solid var(--px-ink);
  box-shadow:
    inset 4px 4px 0 #37572c,
    inset -4px -4px 0 #0d170b,
    6px 6px 0 #0a0717;
}

.timer small {
  color: #b7e39c;
  font-size: 12px;
  letter-spacing: 1px;
}

#timer {
  color: var(--px-neon-lime);
  font-family: var(--px-font);
  font-size: 15px;
  text-shadow: 2px 2px 0 #091207;
}

/* Pixel Shop Buttons */
.shop button {
  background: #e6d8ff;
  color: var(--px-ink);
  border: 3px solid var(--px-ink);
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #b19ad6, 0 4px 0 #1c1333;
  font-size: 14px;
  font-weight: 400;
  padding: 9px 8px;
}

.shop button:enabled:hover {
  background: var(--px-neon-gold);
  transform: translateY(-2px);
  box-shadow: inset 2px 2px 0 #fff7cc, inset -2px -2px 0 #ba9320, 0 6px 0 #1c1333;
}

/* 6. RPG Battle Menu Answer Options (Blinking Pixel ▶ Cursor!) */
.quiz.card .option,
.machine .option,
.pk-page #pk-app .option {
  position: relative;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.03em;
  border: 3px solid var(--px-ink);
  background: #fcfaff;
  box-shadow:
    inset 3px 3px 0 #ffffff,
    inset -3px -3px 0 #d5cbe8,
    0 4px 0 #261c42;
}

.option:hover:enabled::after,
.option.selected::after {
  content: "◀";
  margin-left: auto;
  padding-left: 8px;
  font-family: var(--px-cjk);
  font-size: 14px;
  color: #5b32a8;
  animation: px-cursor-blink 0.7s steps(2, end) infinite;
}

.option.right::after,
.option.wrong::after {
  content: none;
}

.question {
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.55;
  text-shadow: 1px 1px 0 rgba(120, 92, 180, 0.22);
}

.action {
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 2px;
  background: #c7a6ff;
  color: var(--px-ink);
  border: 3px solid var(--px-ink);
  box-shadow:
    inset 3px 3px 0 #efe3ff,
    inset -3px -3px 0 #8b67c9,
    0 5px 0 #161029;
}

.action:enabled:hover {
  background: var(--px-neon-lime);
  box-shadow:
    inset 3px 3px 0 #f4ffd6,
    inset -3px -3px 0 #8eb03c,
    0 7px 0 #161029;
}

/* Inventory RPG Item Slots */
.inventory {
  border-top: 4px solid var(--px-ink);
  border-image: repeating-linear-gradient(90deg, var(--px-ink) 0 6px, transparent 6px 12px) 4;
}

.item {
  background: #ede2ff;
  border: 3px solid var(--px-ink);
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #b8a3db, 0 4px 0 #1c1333;
}

.item[data-item="half"] {
  background: #e5f5c4;
  box-shadow: inset 2px 2px 0 #f8ffe8, inset -2px -2px 0 #9db86c, 0 4px 0 #1c1333;
}

.item b, .item span {
  font-weight: 400;
}

.hint-note {
  background: #1b1536;
  color: var(--px-neon-gold);
  border: 3px solid var(--px-neon-gold);
  box-shadow: 4px 4px 0 #0e0a1d;
  padding: 10px 12px;
}

/* 7. Pixel Form Inputs, Selects & Dialog Backdrops */
input, select {
  border: 3px solid var(--px-ink) !important;
  background: #fff;
  color: var(--px-ink);
  box-shadow: inset 3px 3px 0 #d9d0eb;
  font-size: 15px;
  padding: 8px 10px;
}

input:focus, select:focus {
  outline: 3px solid var(--px-neon-cyan);
  outline-offset: 2px;
}

dialog::backdrop {
  background-color: rgba(14, 10, 29, 0.82);
  background-image:
    repeating-conic-gradient(rgba(185, 140, 255, 0.08) 0% 25%, transparent 0% 50%);
  background-size: 8px 8px;
}

/* 8. Unified Dark Pixel Arcade Manual for ALL Editorial, Library, Info & Footer Sections */
.editorial,
.site-footer {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 4px),
    #191433 !important;
  color: #efe9ff !important;
  border: 4px solid #7d5ec4 !important;
  box-shadow:
    inset 0 0 0 3px #100c22,
    6px 6px 0 #090614 !important;
}

.editorial h1,
.editorial h2,
.editorial h3 {
  font-weight: 400;
  color: var(--px-neon-gold) !important;
  text-shadow: 3px 3px 0 #0a0717 !important;
  letter-spacing: 1px;
}

.editorial h2 {
  padding-bottom: 8px;
  border-bottom: 3px solid #3c2f69;
}

.editorial h3 {
  color: var(--px-neon-lime) !important;
}

.editorial p,
.editorial li,
.editorial summary,
.editorial .updated {
  color: #e8e0ff !important;
}

.editorial a,
.site-footer a,
.site-footer a:visited {
  color: var(--px-neon-cyan) !important;
  text-decoration: none;
  border-bottom: 2px solid rgba(103, 232, 249, 0.45);
}

.editorial a:hover,
.site-footer a:hover {
  color: var(--px-neon-lime) !important;
  border-bottom-color: var(--px-neon-lime);
}

/* Topic links become retro pixel cartridge tags */
.topic-links {
  gap: 10px !important;
}

.topic-links a {
  display: inline-block;
  padding: 6px 12px;
  background: #28204d;
  color: #f4efff !important;
  border: 3px solid #0c081a !important;
  box-shadow: inset 2px 2px 0 #4d3d8c, 3px 3px 0 #0a0616;
  font-size: 14px;
}

.topic-links a:hover {
  background: var(--px-neon-violet);
  color: #140f26 !important;
  transform: translateY(-2px);
}

/* Pixel Accordion Details */
.editorial details {
  padding: 10px 0;
  border-bottom: 3px solid #2f2554 !important;
}

.editorial summary {
  list-style: none;
  font-weight: 400;
  padding: 4px 0;
}

.editorial summary::-webkit-details-marker {
  display: none;
}

.editorial summary::before {
  content: "▸ ";
  color: var(--px-neon-lime);
}

.editorial details[open] > summary::before {
  content: "▾ ";
  color: var(--px-neon-gold);
}

.info-actions a {
  background: #2b2252 !important;
  color: #f4efff !important;
  border: 3px solid #0b0817 !important;
  box-shadow: inset 2px 2px 0 #554396, 0 4px 0 #0b0817 !important;
}

.info-actions a:hover {
  background: var(--px-neon-lime) !important;
  color: #162405 !important;
}

.info-tool-status {
  color: var(--px-neon-lime) !important;
}

.editorial .quiet {
  background: #2b2252;
  color: #f4efff;
  border-color: #0b0817;
}

/* 9. Stepped 8-bit Pixel Animations */
@keyframes px-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

@media (prefers-reduced-motion: no-preference) {
  .banner-text::before {
    animation: coin-pulse 1.2s steps(2, end) infinite;
  }
  .machine h1::before,
  .machine h1::after {
    animation: marquee-leds 1.2s steps(3, end) infinite;
  }
  .arcade-hud-led i {
    animation: led-pulse 1.1s steps(2, end) infinite;
  }
  .bg-px-star {
    animation: bg-px-twinkle var(--dur, 2.4s) steps(3, end) var(--delay, 0s) infinite;
  }
  .bg-px-win {
    animation: bg-win-flicker var(--dur, 3s) steps(2, end) var(--delay, 0s) infinite;
  }
}


/* ==========================================================================
   TRUE DARK CRT ARCADE QUIZ INTERFACE — 4-Color 2x2 Arcade Deck & Phosphor CRT
   ========================================================================== */

/* 1. Dark Phosphor CRT Screen (Lobby Quiz Card + Cabinet Screen + PK Arena) */
.grid > .quiz.card,
.arcade-page .machine #machine-screen,
.machine #machine-screen,
.pk-page #pk-app {
  position: relative;
  color: #f4efff !important;
  background-color: #100c24 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 26%, transparent 100%),
    linear-gradient(180deg, #130e2b 0%, #0d0920 100%) !important;
  border: 6px solid #090614 !important;
  box-shadow:
    inset 0 0 0 3px #4b397d,
    inset 0 0 0 6px #090614,
    inset 0 18px 28px rgba(0, 0, 0, 0.45),
    0 6px 0 #090614 !important;
}

/* Mode-specific CRT Phosphor Tints */
body:has(#machine-screen #drill) .machine #machine-screen {
  background-color: #081a1c !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(103, 232, 249, 0.07) 0%, transparent 28%),
    linear-gradient(180deg, #0b2427 0%, #07171a 100%) !important;
  box-shadow:
    inset 0 0 0 3px #2e8c83,
    inset 0 0 0 6px #051113,
    inset 0 18px 28px rgba(0, 0, 0, 0.5),
    0 6px 0 #051113 !important;
}

body:has(#machine-screen #hard-panel) .machine #machine-screen {
  background-color: #1b0915 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.36) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(255, 107, 157, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #240c1d 0%, #160611 100%) !important;
  box-shadow:
    inset 0 0 0 3px #a83264,
    inset 0 0 0 6px #12040d,
    inset 0 18px 28px rgba(0, 0, 0, 0.55),
    0 6px 0 #12040d !important;
}

.pk-page #pk-app {
  background-color: #0b0f26 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(103, 232, 249, 0.07) 0%, transparent 28%),
    linear-gradient(180deg, #101636 0%, #090d21 100%) !important;
  border-top: 6px solid var(--px-neon-cyan) !important;
  box-shadow:
    inset 0 0 0 3px #3b5a99,
    inset 0 0 0 6px #070a1a,
    6px 6px 0 #070a1a !important;
}

/* Cabinet Speaker Grille Slots beside the Marquee */
.machine h1::before,
.machine h1::after {
  content: "▤ ▤";
  letter-spacing: 5px;
  font-size: 12px;
}

/* 2. Top CRT HUD Strip (Category Badge & Digital Question Counter) */
.quiz.card .line,
#machine-screen .line {
  padding-bottom: 10px;
  border-bottom: 3px solid #2b2152;
}

.category {
  background: #1d1540 !important;
  color: var(--px-neon-cyan) !important;
  border: 2px solid var(--px-neon-cyan) !important;
  box-shadow: 3px 3px 0 #080514 !important;
  padding: 4px 10px;
  font-size: 12px !important;
  font-family: var(--px-cjk) !important;
}

.counter {
  color: #b7a8e0 !important;
  font-size: 13px;
}

.counter b {
  color: var(--px-neon-gold) !important;
  text-shadow: 2px 2px 0 #090614;
}

/* Glowing Pixel Progress Segments on Dark CRT */
#progress i {
  height: 14px;
  background: #1b1536 !important;
  border: 2px solid #40326e !important;
  box-shadow: inset 0 2px 0 #0d0a1c;
}

#progress .on {
  background: var(--px-neon-lime) !important;
  border-color: #142605 !important;
  box-shadow: inset 0 3px 0 #f4ffd6, 0 0 8px rgba(218, 250, 136, 0.45) !important;
}

/* 3. Arcade Dialogue Question Box */
.quiz.card .question,
#machine-screen .question,
#pk-app .question {
  padding: 16px 18px;
  margin: 0 0 16px !important;
  background: #191338;
  color: #ffffff !important;
  border: 3px solid #6b54ad;
  box-shadow:
    inset 3px 3px 0 #2b215c,
    inset -3px -3px 0 #0e0a21,
    4px 4px 0 #080514;
  font-size: clamp(18px, 2vw, 22px) !important;
  line-height: 1.55 !important;
  text-shadow: 2px 2px 0 #090614;
}

body:has(#machine-screen #drill) #machine-screen .question {
  background: #0e2d30;
  border-color: #4ad1c4;
  box-shadow: inset 3px 3px 0 #18474c, inset -3px -3px 0 #07191c, 4px 4px 0 #051113;
}

body:has(#machine-screen #hard-panel) #machine-screen .question {
  background: #2b1024;
  border-color: #ff6b9d;
  box-shadow: inset 3px 3px 0 #4a1a3d, inset -3px -3px 0 #170713, 4px 4px 0 #11040c;
}

.pk-page #pk-app .question {
  background: #151c42;
  border-color: var(--px-neon-cyan);
  box-shadow: inset 3px 3px 0 #24306b, inset -3px -3px 0 #0b0f26, 4px 4px 0 #070a1a;
}

/* 4. 2x2 Physical 4-Color Arcade Button Deck (A / B / C / D) */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px !important;
}

@media (max-width: 560px) {
  .choices {
    grid-template-columns: 1fr;
    gap: 9px !important;
  }
}

.quiz.card .option,
.machine .option,
.pk-page #pk-app .option {
  background: #1c163d !important;
  color: #f6f2ff !important;
  border: 3px solid #594696 !important;
  box-shadow:
    inset 3px 3px 0 #312666,
    inset -3px -3px 0 #0e0a24,
    0 5px 0 #090614 !important;
  min-height: 54px !important;
  padding: 10px 13px !important;
  gap: 12px !important;
  transition: transform 90ms steps(2), background-color 90ms steps(2), border-color 90ms steps(2);
}

/* 4 Classic Arcade Button Keycap Colors: A=Cyan, B=Lime, C=Gold, D=Pink */
.choices .option .key {
  flex-shrink: 0;
  width: 34px !important;
  height: 34px !important;
  font-family: var(--px-font) !important;
  font-size: 12px !important;
  color: #140f26 !important;
  border: 3px solid #090614 !important;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.55), inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 3px 0 #090614 !important;
}

.choices .option:nth-child(1) .key { background: #5ce1ff !important; }
.choices .option:nth-child(2) .key { background: #dafa88 !important; }
.choices .option:nth-child(3) .key { background: #ffd95a !important; }
.choices .option:nth-child(4) .key { background: #ff7ba9 !important; }

.choices .option:hover:enabled {
  background: #292059 !important;
  border-color: var(--px-neon-cyan) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 3px 3px 0 #45368c,
    inset -3px -3px 0 #140e30,
    0 7px 0 #090614 !important;
}

.choices .option.selected {
  background: #332470 !important;
  border-color: var(--px-neon-lime) !important;
  color: #ffffff !important;
  transform: translateY(2px) !important;
  box-shadow:
    inset 3px 3px 0 #5b44b8,
    inset -3px -3px 0 #1b1240,
    0 2px 0 #090614 !important;
}

.choices .option:hover:enabled::after,
.choices .option.selected::after {
  color: var(--px-neon-lime) !important;
}

.choices .option.right {
  background: #13381c !important;
  border-color: #7dff78 !important;
  color: #ebffec !important;
  box-shadow: inset 3px 3px 0 #236132, 0 4px 0 #091c0d !important;
}

.choices .option.wrong {
  background: #421226 !important;
  border-color: #ff6b9d !important;
  color: #ffebf2 !important;
  box-shadow: inset 3px 3px 0 #6e1f40, 0 4px 0 #210712 !important;
}

.choices .option.removed {
  opacity: 0.42 !important;
  background: #120e24 !important;
  border-color: #31294f !important;
  color: #776c99 !important;
  text-decoration: line-through;
}

.choices .option .marker {
  color: var(--px-neon-gold);
  font-size: 12px;
}

/* 5. Glowing "PRESS START / CONFIRM" Action Button */
.quiz.card .action,
#machine-screen .action,
#pk-app .action {
  background: var(--px-neon-lime) !important;
  color: #132104 !important;
  border: 3px solid #090614 !important;
  box-shadow:
    inset 3px 3px 0 #f4ffd6,
    inset -3px -3px 0 #7fa32c,
    0 5px 0 #090614 !important;
  font-size: 16px !important;
  padding: 12px 14px !important;
  letter-spacing: 2px;
}

.quiz.card .action:enabled:hover,
#machine-screen .action:enabled:hover,
#pk-app .action:enabled:hover {
  background: var(--px-neon-gold) !important;
  box-shadow:
    inset 3px 3px 0 #fff7cc,
    inset -3px -3px 0 #b88c14,
    0 7px 0 #090614 !important;
}

.quiz.card .action:disabled,
#machine-screen .action:disabled,
#pk-app .action:disabled {
  background: #251f42 !important;
  color: #786d9e !important;
  border-color: #140f26 !important;
  box-shadow: inset 2px 2px 0 #362e5e, 0 3px 0 #090614 !important;
}

/* 6. Dark CRT Power-Up Inventory Bar, Feedback, Review & Guest Prompt */
.quiz.card .inventory,
#machine-screen .inventory {
  border-top: 3px dashed #3d316b;
  border-image: none;
}

.quiz.card .inventory h3,
#machine-screen .inventory h3 {
  color: var(--px-neon-gold);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
}

.quiz.card .item,
#machine-screen .item {
  background: #1f1942 !important;
  color: #f4efff !important;
  border: 3px solid #634fa6 !important;
  box-shadow: inset 2px 2px 0 #352b6e, 0 4px 0 #090614 !important;
}

.quiz.card .item[data-item="half"],
#machine-screen .item[data-item="half"] {
  background: #143026 !important;
  border-color: #46a882 !important;
  box-shadow: inset 2px 2px 0 #215240, 0 4px 0 #090614 !important;
}

.quiz.card .item small,
#machine-screen .item small {
  color: #c2b6e6 !important;
}

.quiz.card .item span,
#machine-screen .item span {
  padding: 2px 6px;
  background: #0d0920;
  color: var(--px-neon-lime);
  border: 2px solid #4c3d82;
}

.quiz.card .feedback,
#machine-screen .feedback,
#pk-app .feedback,
.review,
.review p,
#drill article p,
#drill summary,
.guest-welcome-box p {
  color: #e6deff !important;
}

.quiz.card .feedback,
#machine-screen .feedback {
  padding: 10px 12px;
  background: #191436;
  border-left: 4px solid var(--px-neon-cyan);
  margin-top: 14px;
}

#drill article {
  border-bottom-color: #362c61 !important;
}

.guest-upsell {
  background: #1a1338 !important;
  border: 3px solid var(--px-neon-gold) !important;
  box-shadow: 4px 4px 0 #090614 !important;
}

.guest-upsell p {
  color: #f6f0ff !important;
}

/* 7. Dark CRT PK Lobby Controls inside #pk-app */
.pk-page #pk-app .quiet {
  background: #232a54 !important;
  color: #f2f5ff !important;
  border: 3px solid #090c1f !important;
  box-shadow: inset 2px 2px 0 #425096, 0 4px 0 #090c1f !important;
}

.pk-page #pk-app .quiet:enabled:hover {
  background: #313d78 !important;
}

.pk-page #pk-app .pk-share-bar {
  background: #161d40 !important;
  border: 3px solid var(--px-neon-cyan) !important;
  color: #eff4ff !important;
}

.pk-page #pk-app .pk-join-row input,
.pk-page #pk-app select,
.pk-page #pk-app input {
  background: #0e132b !important;
  color: var(--px-neon-lime) !important;
  border: 3px solid #5973b8 !important;
  box-shadow: inset 3px 3px 0 #070a17 !important;
}

.pk-page #pk-app .pk-public-room {
  border-bottom: 2px solid #2b3666 !important;
  color: #e9efff !important;
}

.pk-page #pk-app h2,
.pk-page #pk-app h3 {
  color: var(--px-neon-gold) !important;
}


/* ==========================================================================
   FREE-PRACTICE ARCADE STRUCTURE + DISTINCT MODE PALETTES + HIGH CONTRAST
   ========================================================================== */

/* Universal Ultra-High-Contrast Text Inside All Dark CRT Quiz Screens */
#machine-screen,
.grid > .quiz.card,
.pk-page #pk-app {
  color: #f6f2ff !important;
}

#machine-screen p,
#machine-screen li,
#machine-screen small,
#machine-screen label,
#machine-screen summary,
.grid > .quiz.card p,
.grid > .quiz.card li,
.grid > .quiz.card small,
.pk-page #pk-app p,
.pk-page #pk-app label {
  color: #ede6ff !important;
}

#machine-screen .option,
.grid > .quiz.card .option,
.pk-page #pk-app .option {
  color: #ffffff !important;
  text-shadow: 1px 1px 0 #090614;
}

/* Keep crisp dark ink on bright neon keycaps & primary buttons */
#machine-screen .option .key,
.grid > .quiz.card .option .key,
.pk-page #pk-app .option .key,
#machine-screen .action:enabled,
.grid > .quiz.card .action:enabled,
.pk-page #pk-app .action:enabled,
.pk-quick-hero,
.guest-cta-primary,
.arcade-share-btn {
  color: #140f26 !important;
  text-shadow: none !important;
}

/* --- 1. DAILY MODE & LOBBY: Classic Neon Violet Arcade Cabinet --- */
.arcade-page {
  --horizon: #4b3678;
  --mode-accent: #dafa88;
  --mode-accent-2: #b98cff;
}

.arcade-page .machine {
  background: #7f56c9 !important;
  box-shadow:
    inset 7px 7px 0 #e2ccff,
    inset -7px -7px 0 #2e1f4a,
    inset -14px -14px 0 #5b3b96,
    0 10px 0 #0e0a1d !important;
}

.arcade-page .machine h1 {
  background: repeating-linear-gradient(0deg, #271b40 0 4px, #372659 4px 8px) !important;
  color: #edffaf !important;
  text-shadow: 3px 3px 0 #140d26, 0 0 12px rgba(218, 250, 136, 0.42) !important;
}

.arcade-page .machine #machine-screen,
.grid > .quiz.card {
  background-color: #110c26 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(185, 140, 255, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #161033 0%, #0e0a21 100%) !important;
  border: 6px solid #090614 !important;
  box-shadow:
    inset 0 0 0 3px #6b52b3,
    inset 0 0 0 6px #090614,
    inset 0 18px 28px rgba(0, 0, 0, 0.45),
    -3px -3px 0 #4d3373,
    3px 3px 0 #dcc4ff !important;
}

.grid > .quiz.card {
  box-shadow:
    inset 0 0 0 3px #6b52b3,
    inset 0 0 0 6px #090614,
    6px 6px 0 #090614 !important;
}

.arcade-page .machine #machine-screen .question,
.grid > .quiz.card .question {
  background: #22194a !important;
  border-color: #9e82e8 !important;
  color: #ffffff !important;
  box-shadow: inset 3px 3px 0 #372973, inset -3px -3px 0 #120d29, 4px 4px 0 #080514 !important;
}

.arcade-page .machine .option,
.grid > .quiz.card .option {
  background: #281f54 !important;
  border-color: #9e82e8 !important;
  box-shadow: inset 3px 3px 0 #3f3180, inset -3px -3px 0 #140e30, 0 5px 0 #080514 !important;
}

.arcade-page .machine .option:hover:enabled,
.grid > .quiz.card .option:hover:enabled {
  background: #382b73 !important;
  border-color: var(--px-neon-lime) !important;
}

.arcade-page .machine .option.selected,
.grid > .quiz.card .option.selected {
  background: #46338f !important;
  border-color: var(--px-neon-lime) !important;
}

.arcade-page .control-deck {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #9570cf !important;
  box-shadow: inset 0 4px 0 #e2ccff, inset -4px -6px 0 #5b3b96 !important;
}

.arcade-page .control-deck::before {
  content: "DAILY · 10Q";
  color: var(--px-neon-lime);
}

/* --- 2. FREE PRACTICE MODE: Emerald / Cyan Training Cabinet --- */
body:has(#machine-screen #drill) {
  --horizon: #256062;
  --mode-accent: #67e8f9;
  --mode-accent-2: #4fd1c5;
}

body:has(#machine-screen #drill) .machine {
  background: #2c8a80 !important;
  box-shadow:
    inset 7px 7px 0 #8ff0e4,
    inset -7px -7px 0 #174a45,
    inset -14px -14px 0 #216b63,
    0 10px 0 #0a1f1e !important;
}

body:has(#machine-screen #drill) .machine h1 {
  background: repeating-linear-gradient(0deg, #133638 0 4px, #1b4a4d 4px 8px) !important;
  color: #a8fff4 !important;
  text-shadow: 3px 3px 0 #0b2022, 0 0 12px rgba(103, 232, 249, 0.45) !important;
}

body:has(#machine-screen #drill) .machine #machine-screen {
  background-color: #081a1c !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(103, 232, 249, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #0b2427 0%, #07171a 100%) !important;
  border: 6px solid #051113 !important;
  box-shadow:
    inset 0 0 0 3px #32998f,
    inset 0 0 0 6px #051113,
    inset 0 18px 28px rgba(0, 0, 0, 0.5),
    -3px -3px 0 #1d5c56,
    3px 3px 0 #8ff0e4 !important;
}

body:has(#machine-screen #drill) #machine-screen .question {
  background: #103338 !important;
  border-color: #5fd4c8 !important;
  box-shadow: inset 3px 3px 0 #1b5259, inset -3px -3px 0 #07191c, 4px 4px 0 #051113 !important;
}

body:has(#machine-screen #drill) .machine .option {
  background: #153f45 !important;
  border-color: #5fd4c8 !important;
  box-shadow: inset 3px 3px 0 #23636b, inset -3px -3px 0 #091f21, 0 5px 0 #051113 !important;
}

body:has(#machine-screen #drill) .machine .option:hover:enabled {
  background: #1d545c !important;
  border-color: var(--px-neon-lime) !important;
}

body:has(#machine-screen #drill) .machine .option.selected {
  background: #246870 !important;
  border-color: var(--px-neon-lime) !important;
}

body:has(#machine-screen #drill) .control-deck {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #3ca397 !important;
  box-shadow: inset 0 4px 0 #9df5ea, inset -4px -6px 0 #1f635c !important;
}

body:has(#machine-screen #drill) .control-deck::before {
  content: "TRAINING · 5Q";
  color: var(--px-neon-cyan);
}

/* --- 3. HARD MODE: Crimson / Gold BOSS STAGE Cabinet --- */
body:has(#machine-screen #hard-panel) {
  --horizon: #743c66;
  --mode-accent: #ff6b9d;
  --mode-accent-2: #ffd95a;
}

body:has(#machine-screen #hard-panel) .machine {
  background: #ab376a !important;
  box-shadow:
    inset 7px 7px 0 #ffa6cb,
    inset -7px -7px 0 #521431,
    inset -14px -14px 0 #7d224c,
    0 10px 0 #210815 !important;
}

body:has(#machine-screen #hard-panel) .machine h1 {
  background: repeating-linear-gradient(0deg, #3b1027 0 4px, #4f1735 4px 8px) !important;
  color: #ffe066 !important;
  text-shadow: 3px 3px 0 #240717, 0 0 14px rgba(255, 107, 157, 0.55) !important;
}

body:has(#machine-screen #hard-panel) .machine #machine-screen {
  background-color: #1c0916 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.36) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(255, 107, 157, 0.09) 0%, transparent 28%),
    linear-gradient(180deg, #260d1f 0%, #170712 100%) !important;
  border: 6px solid #12040d !important;
  box-shadow:
    inset 0 0 0 3px #c94b82,
    inset 0 0 0 6px #12040d,
    inset 0 18px 28px rgba(0, 0, 0, 0.55),
    -3px -3px 0 #6e1e43,
    3px 3px 0 #ffa6cb !important;
}

body:has(#machine-screen #hard-panel) #machine-screen .question {
  background: #36122b !important;
  border-color: #ff85b3 !important;
  color: #ffffff !important;
  box-shadow: inset 3px 3px 0 #571e46, inset -3px -3px 0 #1c0816, 4px 4px 0 #12040d !important;
}

body:has(#machine-screen #hard-panel) .machine .option {
  background: #421735 !important;
  border-color: #ff85b3 !important;
  box-shadow: inset 3px 3px 0 #692654, inset -3px -3px 0 #210a1a, 0 5px 0 #12040d !important;
}

body:has(#machine-screen #hard-panel) .machine .option:hover:enabled {
  background: #591f48 !important;
  border-color: var(--px-neon-gold) !important;
}

body:has(#machine-screen #hard-panel) .machine .option.selected {
  background: #6b2456 !important;
  border-color: var(--px-neon-gold) !important;
}

body:has(#machine-screen #hard-panel) #hard-panel .quiet {
  flex: 1;
  justify-content: center;
  background: #38152e !important;
  color: #ffffff !important;
  border: 3px solid #ff85b3 !important;
  box-shadow: inset 2px 2px 0 #5c244c, 0 4px 0 #12040d !important;
}

body:has(#machine-screen #hard-panel) #hard-panel .quiet:disabled {
  opacity: 0.48;
  color: #c7a3b8 !important;
}

body:has(#machine-screen #hard-panel) .control-deck {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    #bf4c7e !important;
  box-shadow: inset 0 4px 0 #ffb3d2, inset -4px -6px 0 #752046 !important;
}

body:has(#machine-screen #hard-panel) .control-deck::before {
  content: "★ BOSS · 10Q ★";
  color: var(--px-neon-gold);
}

/* --- 4. 2P PK MODE: Cyber Electric-Blue Arcade Duel Cabinet --- */
.pk-page #pk-app {
  background-color: #0b1129 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(103, 232, 249, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #10193b 0%, #090e24 100%) !important;
  border: 10px solid #2b54a3 !important;
  box-shadow:
    inset 0 0 0 3px #67e8f9,
    inset 0 0 0 6px #070b1c,
    0 0 0 4px #070b1c,
    0 10px 0 #070b1c !important;
}

.pk-page #pk-app .question {
  background: #172352 !important;
  border-color: #67e8f9 !important;
  color: #ffffff !important;
  box-shadow: inset 3px 3px 0 #263a82, inset -3px -3px 0 #0b1129, 4px 4px 0 #070b1c !important;
}

.pk-page #pk-app .option {
  background: #1c2b61 !important;
  border-color: #67e8f9 !important;
  box-shadow: inset 3px 3px 0 #2e4596, inset -3px -3px 0 #0d1533, 0 5px 0 #070b1c !important;
}

.pk-page #pk-app .option:hover:enabled {
  background: #263b82 !important;
  border-color: var(--px-neon-gold) !important;
}

.pk-page #pk-app .option.selected {
  background: #30499e !important;
  border-color: var(--px-neon-lime) !important;
}



/* ==========================================================================
   UNIFIED TOP-RIGHT AUTH BUTTON & ABOVE-THE-FOLD 4-MODE ARCADE HUB
   ========================================================================== */

/* Top-right Login / Sign-up Button in Header */
header .header-auth-btn,
.pk-page header .header-auth-btn {
  background: var(--px-neon-gold) !important;
  color: #1c1303 !important;
  border: 3px solid #0b0817 !important;
  box-shadow:
    inset 2px 2px 0 #fff7cc,
    inset -2px -2px 0 #b88c14,
    0 4px 0 #0b0817 !important;
  text-decoration: none;
  white-space: nowrap;
}

header .header-auth-btn:hover,
.pk-page header .header-auth-btn:hover {
  background: var(--px-neon-lime) !important;
  color: #162405 !important;
}

header .header-auth-btn.is-signed-in,
.pk-page header .header-auth-btn.is-signed-in {
  background: #1d3654 !important;
  color: var(--px-neon-cyan) !important;
  border-color: var(--px-neon-cyan) !important;
  box-shadow: inset 2px 2px 0 #2d5585, 0 4px 0 #0b0817 !important;
}

/* Compact Hero Banner so Banner + 4 Game Cards fit cleanly above the fold */
main {
  padding-top: 16px;
}

.banner {
  min-height: 158px !important;
  margin-bottom: 18px;
}

.banner-text {
  padding: 20px 20px 22px 32px !important;
  max-width: 60%;
}

.banner h1 {
  font-size: clamp(32px, 4vw, 50px) !important;
  margin: 4px 0 6px !important;
}

.banner p {
  font-size: 14px !important;
  margin: 4px 0 0 !important;
}

@media (max-width: 680px) {
  .banner-text {
    max-width: 100%;
    padding: 16px 16px 18px !important;
  }
}

/* 4-Card Above-the-Fold Arcade Game Selector Grid */
.home-arcade-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

@media (max-width: 920px) {
  .home-arcade-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .home-arcade-hub {
    grid-template-columns: 1fr;
  }
}

.home-arcade-hub .mode-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 15px 14px;
  text-decoration: none;
  color: #ffffff;
  border: 4px solid #0b0817;
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.25),
    inset -4px -4px 0 rgba(0, 0, 0, 0.35),
    6px 6px 0 #090614;
  transition: transform 110ms steps(2), filter 110ms steps(2), box-shadow 110ms steps(2);
}

.home-arcade-hub .mode-card:hover {
  transform: translateY(-4px);
  filter: brightness(1.08);
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.35),
    inset -4px -4px 0 rgba(0, 0, 0, 0.35),
    6px 10px 0 #090614;
}

.home-arcade-hub .mode-card:active {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 #090614;
}

.home-arcade-hub .mode-card.is-practice {
  background: linear-gradient(180deg, #1b6962 0%, #10423e 100%);
  border-top: 6px solid #67e8f9;
}

.home-arcade-hub .mode-card.is-daily {
  background: linear-gradient(180deg, #5c3b9e 0%, #372263 100%);
  border-top: 6px solid #dafa88;
}

.home-arcade-hub .mode-card.is-hard {
  background: linear-gradient(180deg, #8c2653 0%, #521330 100%);
  border-top: 6px solid #ffd95a;
}

.home-arcade-hub .mode-card.is-pk {
  background: linear-gradient(180deg, #1f448a 0%, #132854 100%);
  border-top: 6px solid #7ceeff;
}

.home-arcade-hub .mode-badge {
  display: inline-block;
  width: max-content;
  padding: 3px 8px;
  background: #0e0a21;
  color: var(--px-neon-gold);
  border: 2px solid rgba(255, 255, 255, 0.35);
  font-family: var(--px-cjk);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.home-arcade-hub .mode-card.is-practice .mode-badge { color: #67e8f9; }
.home-arcade-hub .mode-card.is-daily .mode-badge { color: #dafa88; }
.home-arcade-hub .mode-card.is-hard .mode-badge { color: #ffd95a; }
.home-arcade-hub .mode-card.is-pk .mode-badge { color: #7ceeff; }

.home-arcade-hub .mode-card strong {
  font-size: 20px;
  font-weight: 400;
  color: #ffffff;
  text-shadow: 2px 2px 0 #0a0717;
  letter-spacing: 1px;
}

.home-arcade-hub .mode-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #efe9ff;
  flex: 1;
}

.home-arcade-hub .mode-cta {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  text-align: center;
  background: var(--px-neon-lime);
  color: #142104;
  border: 3px solid #0b0817;
  box-shadow: inset 2px 2px 0 #f4ffd6, 0 3px 0 #0b0817;
  font-size: 13px;
  letter-spacing: 1px;
}

.home-arcade-hub .mode-card.is-practice .mode-cta { background: #67e8f9; color: #052229; }
.home-arcade-hub .mode-card.is-daily .mode-cta { background: #dafa88; color: #162405; }
.home-arcade-hub .mode-card.is-hard .mode-cta { background: #ffd95a; color: #241602; }
.home-arcade-hub .mode-card.is-pk .mode-cta { background: #ff7ba9; color: #2b0716; }

/* Keep leaderboard shortcuts sleek right below the 4 game cards */
.leaderboard-shortcuts {
  margin: 0 0 20px !important;
}

.leaderboard-shortcuts a {
  padding: 10px 14px !important;
  font-size: 14px;
}

/* PK page modal dialog matches Homepage / Daily / Practice / Hard modal */
.pk-page dialog#rank-dialog {
  width: min(470px, 94vw) !important;
  max-height: 88vh !important;
  margin: auto !important;
  padding: 24px !important;
}
