/* ===== Neon Pinball — fixed "neon parlour" theme =====
   Self-contained c-* chrome: this page ignores the center's light/dark mode
   and never loads shared/css/glass.css, like the other arcade pages.
   The table is 480x760, so every stage size is derived from that ratio. */

:root {
  --pn-bg: #0a0716;
  --pn-panel: #171034;
  --pn-panel-2: #1e1542;
  --pn-line: rgba(255, 255, 255, .1);
  --pn-cream: #f2ecff;
  --pn-muted: #a89bc9;
  --pn-violet: #9b6bff;
  --pn-pink: #ff5fd2;
  --pn-cyan: #5fe8ff;
  --pn-amber: #ffce6b;
  --pn-amber-d: #c8932f;
  --pn-red: #ff6b7a;
  --pn-mint: #6ff0c0;
  --pn-ink: #0b0718;
}

* { box-sizing: border-box; }

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

body.pn-page {
  margin: 0;
  color: var(--pn-cream);
  background:
    radial-gradient(1100px 680px at 50% -8%, #2b1a55 0%, rgba(43, 26, 85, 0) 62%),
    radial-gradient(820px 560px at 88% 108%, #34123f 0%, rgba(52, 18, 63, 0) 62%),
    radial-gradient(620px 420px at 6% 86%, #102a4d 0%, rgba(16, 42, 77, 0) 60%),
    var(--pn-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.c-app {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px 24px;
}

/* ---------- Top bar ---------- */
.c-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--pn-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(38, 25, 78, .94), rgba(18, 12, 40, .94));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
}

.c-bar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.c-bar__brand svg { flex: none; }

.c-bar__title {
  margin: 0;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(155, 107, 255, .55);
}

.c-bar__stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.c-bar__stats .stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--pn-line);
  border-radius: 999px;
  background: rgba(9, 6, 20, .62);
  color: var(--pn-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.c-bar__stats .stat b {
  color: var(--pn-cream);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.c-bar__stats .stat i {
  color: var(--pn-muted);
  font-style: normal;
  font-size: 11px;
}

/* Multiplier chip brightens as it climbs: the JS sets data-mult. */
.stat--mult {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.stat--mult b {
  color: var(--pn-cyan);
  transition: color .2s ease;
}

.stat--mult[data-mult="2"] b { color: var(--pn-mint); }
.stat--mult[data-mult="3"] b { color: var(--pn-amber); }
.stat--mult[data-mult="4"] b { color: #ffa566; }
.stat--mult[data-mult="5"] b { color: var(--pn-pink); }

.stat--mult[data-mult="3"],
.stat--mult[data-mult="4"],
.stat--mult[data-mult="5"] {
  border-color: rgba(255, 206, 107, .5);
  box-shadow: 0 0 14px rgba(255, 206, 107, .18);
}

.c-bar__controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: linear-gradient(180deg, #33225f, #241748);
  color: var(--pn-cream);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 8px rgba(0, 0, 0, .3);
  transition: transform .12s, border-color .15s, background .15s;
}

.c-btn:hover {
  border-color: rgba(155, 107, 255, .65);
  transform: translateY(-1px);
}

.c-btn:active { transform: translateY(0); }

.c-btn--primary {
  border-color: #b995ff;
  background: linear-gradient(180deg, #a97bff, #7a45e0);
  color: #150a2b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 16px rgba(155, 107, 255, .35);
}

.c-btn--primary:hover { background: linear-gradient(180deg, #bb95ff, #8b55ef); }

/* ---------- Board / stage ---------- */
.c-table {
  display: flex;
  justify-content: center;
  padding: 14px 0 0;
}

.pn-board {
  /* 480x760 table: keep the whole playfield on screen on desktop. */
  width: min(94vw, calc((100dvh - 214px) * .6316), 470px);
  min-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.pn-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 480 / 760;
  border: 3px solid #3a2a6b;
  border-radius: 20px;
  background: #07040f;
  box-shadow:
    0 26px 56px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(155, 107, 255, .18),
    0 0 44px rgba(155, 107, 255, .14),
    inset 0 0 0 6px rgba(10, 6, 24, .65);
  overflow: hidden;
}

.pn-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pn-stage::after {
  /* faint CRT scanlines over the whole table */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, .022) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  mix-blend-mode: screen;
  opacity: .5;
}

.pn-hint {
  margin: 0;
  min-height: 17px;
  color: var(--pn-muted);
  font-size: 12px;
  font-weight: 550;
  text-align: center;
  letter-spacing: .01em;
}

.pn-hint b { color: var(--pn-cream); font-weight: 700; }

/* ---------- Overlays ---------- */
.pn-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 3, 15, .76);
  backdrop-filter: blur(4px);
}

.pn-overlay[hidden] { display: none; }

.pn-card {
  width: min(100%, 336px);
  padding: 20px 20px 18px;
  border: 1px solid rgba(155, 107, 255, .4);
  border-radius: 16px;
  background: linear-gradient(180deg, #241848, #150e2e);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
}

.pn-card__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.pn-card__icon svg { width: 72px; height: 72px; }

.pn-card h2 {
  margin: 2px 0 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .01em;
}

.pn-card p {
  margin: 0 0 16px;
  color: #cec2e8;
  font-size: 13px;
  line-height: 1.5;
}

.c-win__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pn-card .c-win__actions .c-btn { min-width: 0; flex: 1 1 118px; }

/* ---------- Touch controls ---------- */
.pn-touch {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 0;
}

.pn-touch__mid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pn-tb {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(38, 26, 74, .9);
  color: var(--pn-cream);
  font: inherit;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .09);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pn-tb--flip {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--pn-muted);
}

.pn-tb--flip svg { width: 24px; height: 24px; }

.pn-tb--flip:active,
.pn-tb--flip.is-down {
  background: linear-gradient(180deg, #b98bff, #7a45e0);
  color: #160a2d;
  transform: scale(.96);
}

.pn-tb--nudge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--pn-muted);
}

.pn-tb--nudge svg { width: 18px; height: 18px; }

.pn-tb--nudge:active { color: var(--pn-cyan); transform: scale(.94); }

.pn-tb--launch {
  min-width: 92px;
  height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border-color: rgba(255, 206, 107, .65);
  background: linear-gradient(180deg, #ffce6b, #dd9c2c);
  color: #26170a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pn-tb--launch:active,
.pn-tb--launch.is-down {
  background: linear-gradient(180deg, #ffe0a0, #f0b344);
  transform: scale(.97);
}

@media (hover: none), (pointer: coarse) {
  .pn-touch { display: flex; }
  .pn-board { width: min(94vw, calc((100dvh - 296px) * .6316), 440px); }
  .pn-hint { display: none; }
}

/* ---------- Modal (rules) ----------
   The overlay scrolls, never the card: no max-height/overflow on the panel. */
.c-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.c-modal[hidden] { display: none; }

.c-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 10, .78);
  backdrop-filter: blur(3px);
}

.c-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: auto;
  border: 1px solid rgba(155, 107, 255, .32);
  border-radius: 18px;
  background: linear-gradient(180deg, #221741, #130d2a);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--pn-cream);
}

.c-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--pn-line);
}

.c-modal__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.c-modal__x {
  width: 32px;
  height: 32px;
  border: 1px solid var(--pn-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: var(--pn-cream);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.c-modal__x:hover { border-color: rgba(155, 107, 255, .6); }

.c-modal__body {
  padding: 14px 18px 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #cfc4e6;
}

.c-modal__lead {
  margin: 0 0 14px;
  color: var(--pn-cream);
}

.c-modal__lead b { color: var(--pn-cyan); }

.c-modal__body h3 {
  margin: 16px 0 6px;
  color: var(--pn-cream);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.c-modal__body ul {
  margin: 0;
  padding-left: 18px;
}

.c-modal__body li { margin: 5px 0; }

.c-modal__body b { color: #d8c4ff; }

.c-modal__body kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .07);
  color: var(--pn-cream);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.c-modal__note {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: var(--pn-muted);
  font-size: 12px;
}

.c-modal__foot {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .c-bar__stats { margin-left: 0; order: 3; width: 100%; }
  .c-bar__controls { margin-left: auto; }
}

@media (max-width: 560px) {
  .c-app { padding: 8px 10px 18px; }
  .c-bar { gap: 10px; padding: 9px 11px; }
  .c-bar__title { font-size: 17px; }
  .c-bar__stats .stat { padding: 4px 8px; font-size: 10px; }
  .c-bar__stats .stat b { font-size: 13px; }
  .c-btn { padding: 7px 11px; font-size: 12px; }
  /* Leave the bottom-left corner clear for base.css's fixed back chip. */
  .pn-board { width: min(92vw, calc((100dvh - 214px) * .6316), 440px); }
  .pn-stage { border-width: 2px; border-radius: 16px; }
  .pn-card { padding: 16px 15px 15px; }
  .pn-card h2 { font-size: 21px; }
  .pn-card p { font-size: 12.5px; }
  .pn-touch { display: flex; }
  .pn-hint { display: none; }
}

@media (max-width: 380px) {
  .c-bar__controls { width: 100%; }
  .c-bar__controls .c-btn { flex: 1; }
  .c-bar__stats { gap: 6px; }
  .c-bar__stats .stat { flex: 1; justify-content: center; }
  .pn-tb--flip { width: 56px; height: 56px; }
  .pn-tb--launch { min-width: 76px; height: 48px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .c-btn, .stat--mult, .stat--mult b { transition: none; }
  .c-btn:hover { transform: none; }
}
