/* ---------- The Arcade page ----------
   Seasonal colours via variables (theme.js puts halloween / thanksgiving / christmas on <html>);
   the sky and panel backing for each season come from style.css and the theme stylesheets. */

:root {
  --arc-a: #ff2e9a;
  --arc-b: #00e5ff;
  --arc-accent: #ffc700;
  --arc-cab: #1a0b2e;
  --arc-cab2: #2b1750;
}
html.halloween { --arc-a: #ff7a1a; --arc-b: #a45cff; --arc-accent: #ff9d3c; --arc-cab: #170a22; --arc-cab2: #2a1240; }
html.thanksgiving { --arc-a: #c2571a; --arc-b: #e0a526; --arc-accent: #f1c36b; --arc-cab: #2b0c1b; --arc-cab2: #4d1b2c; }
html.christmas { --arc-a: #c0392b; --arc-b: #2e8b57; --arc-accent: #f4d68a; --arc-cab: #0b2238; --arc-cab2: #14405e; }

.arcade { max-width: 560px; padding-bottom: 48px; }

.arcade-panel {
  width: 100%;
  margin-top: 18px;
  padding: 20px 18px 18px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 2px solid rgba(253, 246, 255, 0.12);
}
.arcade-panel h2 { margin: 0 0 8px; font-family: "Bungee", "Space Grotesk", sans-serif; font-weight: 400; font-size: 1.25rem; color: var(--arc-accent); }
.arcade-panel p { margin: 0 0 14px; color: var(--ink-dim); font-size: 0.92rem; line-height: 1.5; }
.arcade-panel form { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.arcade-panel input[type="text"] {
  flex: 1 1 200px; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: 999px;
  border: 2px solid rgba(253, 246, 255, 0.25); background: rgba(15, 6, 32, 0.6); color: var(--ink);
  font-family: "DM Mono", monospace; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}
.arcade-panel input::placeholder { color: rgba(201, 184, 232, 0.6); letter-spacing: 0; text-transform: none; font-family: "Space Grotesk", sans-serif; }
.arcade-panel form button { min-height: 46px; padding: 0 24px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--magenta), var(--violet)); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.arcade-panel button:disabled { opacity: 0.55; cursor: progress; }
.how { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.how li { padding: 9px 12px; border-radius: 12px; background: rgba(15, 6, 32, 0.45); color: var(--ink); font-size: 0.9rem; line-height: 1.45; }
.arcade-link { margin: 0 !important; font-size: 0.85rem !important; }
.arcade-link a { color: var(--arc-b); }

.arcade-msg { min-height: 1.4em; margin: 12px 0 0 !important; color: var(--cyan) !important; font-size: 0.88rem !important; }
.arcade-msg.is-error { color: #ff7a9c !important; }

/* ---- game picker ---- */
.gamepick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.gamepick button {
  min-height: 38px; padding: 0 18px; border-radius: 999px; border: 2px solid rgba(253, 246, 255, 0.2);
  background: rgba(255, 255, 255, 0.06); color: var(--ink-dim); font: inherit; font-weight: 700; cursor: pointer;
}
.gamepick button[aria-selected="true"] { background: linear-gradient(135deg, var(--arc-a), var(--violet)); color: #fff; border-color: transparent; }
.gamepick button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- the cabinet ---- */
.cab {
  width: 100%;
  border-radius: 22px 22px 14px 14px;
  background: linear-gradient(180deg, var(--arc-cab2), var(--arc-cab));
  border: 3px solid rgba(253, 246, 255, 0.14);
  box-shadow: 0 0 0 4px var(--arc-a), 0 0 38px color-mix(in srgb, var(--arc-a) 55%, transparent), inset 0 0 30px rgba(0, 0, 0, 0.5);
  padding: 14px 14px 16px;
}
.cab-marquee {
  margin: 0 auto 12px; padding: 10px 14px; text-align: center; border-radius: 10px;
  font-family: "Press Start 2P", "Bungee", monospace; font-size: clamp(1rem, 5.5vw, 1.5rem); letter-spacing: 0.06em;
  color: #fff; background: linear-gradient(90deg, var(--arc-a), var(--arc-b));
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 2px 2px 0 rgba(0, 0, 0, 0.4);
}
.cab-bezel { padding: 10px; border-radius: 14px; background: #07030f; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 4px 18px #000; }
.cab-screen { position: relative; width: 100%; aspect-ratio: 256 / 240; border-radius: 6px; overflow: hidden; background: #000; }
.cab-screen canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: none; touch-action: none; }
.cab-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px); }

.cab-panel .arcade-msg { text-align: center; }
.cab-panel { margin-top: 14px; padding: 14px 12px 6px; border-radius: 14px; background: rgba(0, 0, 0, 0.32); }
.coin-area { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 92px; }
.coin-arrow { color: var(--arc-accent); font-size: 1.4rem; animation: arc-nudge 1s ease-in-out infinite alternate; }
@keyframes arc-nudge { from { transform: translateX(-4px); opacity: 0.5; } to { transform: translateX(4px); opacity: 1; } }

.coin {
  position: relative; width: 84px; height: 84px; padding: 0; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: conic-gradient(from 20deg, #fff3a0, #ffc700, #b8860b, #ffc700, #fff3a0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.35);
  animation: arc-float 2.2s ease-in-out infinite;
}
.coin::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px dashed rgba(120, 80, 0, 0.7); }
.coin img { position: absolute; inset: 11px; width: calc(100% - 22px); height: calc(100% - 22px); border-radius: 50%; object-fit: cover; background: #1a0b2e; }
.coin:hover:not(:disabled) { filter: brightness(1.12); }
.coin:disabled { cursor: progress; animation: none; }
@keyframes arc-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }

.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 12px; background: #120a1f; border: 2px solid rgba(255, 255, 255, 0.15); }
.slot-label { font-family: "Press Start 2P", monospace; font-size: 0.55rem; color: var(--arc-accent); }
.slot-hole { position: relative; width: 12px; height: 46px; border-radius: 6px; background: #000; box-shadow: inset 0 0 0 2px #444; }
.slot-light { position: absolute; left: 50%; top: 50%; width: 4px; height: 36px; margin: -18px 0 0 -2px; border-radius: 2px; background: var(--arc-a); box-shadow: 0 0 10px var(--arc-a); animation: arc-blink 1s steps(2) infinite; }
.cab.is-playing .slot-light { animation: none; background: #3a3a3a; box-shadow: none; }
.slot-cost { font-family: "Press Start 2P", monospace; font-size: 0.45rem; color: var(--ink-dim); text-align: center; }
@keyframes arc-blink { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .coin, .coin-arrow, .slot-light { animation: none; }
}

/* ---- tickets, shop, crown, scoreboard ---- */
.tickets { margin: 10px 0 0; text-align: center; font-family: "Press Start 2P", monospace; font-size: 0.62rem; color: var(--arc-accent); }
.tickets b { color: #fff; font-size: 0.8rem; }

.shop { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.shop li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(15, 6, 32, 0.45); }
.shop .s-emoji { font-size: 1.6rem; }
.shop .s-text { flex: 1; min-width: 0; color: var(--ink); font-size: 0.9rem; font-weight: 700; }
.shop .s-desc { display: block; margin-top: 2px; color: var(--ink-dim); font-size: 0.78rem; font-weight: 400; line-height: 1.35; }
.shop button { flex: none; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--magenta), var(--violet)); color: #fff; font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.shop button:disabled { opacity: 0.4; cursor: not-allowed; }

.crown-panel { border-color: #ffc700; box-shadow: 0 0 24px rgba(255, 199, 0, 0.35); }
.crown-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.crown-picks button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 2px solid rgba(255, 199, 0, 0.5); border-radius: 14px; background: rgba(15, 6, 32, 0.5); color: var(--ink); font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.crown-picks .s-emoji { font-size: 1.6rem; }
.crown-picks button:hover:not(:disabled) { border-color: #ffc700; }
.crown-picks button:disabled { opacity: 0.5; cursor: progress; }

.board-king { margin: 0 0 10px !important; color: var(--arc-accent) !important; font-weight: 700; }
.scoreboard { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: sb; }
.scoreboard li { counter-increment: sb; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(15, 6, 32, 0.45); color: var(--ink); font-size: 0.9rem; text-align: left; }
.scoreboard li::before { content: counter(sb); width: 1.4em; font-family: "Press Start 2P", monospace; font-size: 0.6rem; color: var(--arc-accent); }
.scoreboard .sb-name { flex: 1; font-weight: 700; }
.scoreboard .sb-score { font-family: "DM Mono", monospace; }
.scoreboard:empty { display: none; }
.board-note { margin: 10px 0 0 !important; font-size: 0.8rem !important; }

/* two games share the screen: only one canvas shows at a time */
.cab-screen canvas[hidden] { display: none; }
.how-game { margin: 14px 0 8px; font-family: "Bungee", "Space Grotesk", sans-serif; font-weight: 400; font-size: 1rem; color: var(--arc-b); }
.gamepick button:disabled.is-locked { opacity: 0.55; cursor: not-allowed; }

/* ---- cabinet polish: a shimmering marquee, neon-lit sides and a glowing screen ---- */
.cab { position: relative; }
.cab-marquee {
  background: linear-gradient(90deg, var(--arc-a), var(--arc-b), var(--arc-a), var(--arc-b));
  background-size: 300% 100%;
  animation: arc-shimmer 7s linear infinite, arc-glow 2.4s ease-in-out infinite alternate;
  box-shadow: 0 0 18px color-mix(in srgb, var(--arc-a) 60%, transparent), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
@keyframes arc-shimmer { to { background-position: -300% 0; } }
@keyframes arc-glow { from { text-shadow: 0 0 6px rgba(255, 255, 255, 0.5), 2px 2px 0 rgba(0, 0, 0, 0.4); } to { text-shadow: 0 0 16px rgba(255, 255, 255, 0.95), 2px 2px 0 rgba(0, 0, 0, 0.4); } }

/* chasing lights down both sides of the cabinet */
.cab::before, .cab::after {
  content: "";
  position: absolute;
  top: 64px;
  bottom: 18px;
  width: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, var(--arc-a) 0 8px, #fff 8px 12px, var(--arc-b) 12px 20px, transparent 20px 28px);
  background-size: 100% 56px;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--arc-a) 70%, transparent));
  animation: arc-chase 1.4s linear infinite;
  pointer-events: none;
}
.cab::before { left: 4px; }
.cab::after { right: 4px; animation-direction: reverse; }
@keyframes arc-chase { to { background-position: 0 56px; } }

.cab-bezel { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 4px 18px #000, 0 0 26px color-mix(in srgb, var(--arc-b) 45%, transparent); }
.cab-screen::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.45) 100%); }
.cab.is-playing { box-shadow: 0 0 0 4px var(--arc-b), 0 0 46px color-mix(in srgb, var(--arc-b) 65%, transparent), inset 0 0 30px rgba(0, 0, 0, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .cab-marquee, .cab::before, .cab::after { animation: none; }
}
