@font-face { font-family: Arcade; src: url(assets/Poppins-ExtraBold.ttf) format('truetype'); font-weight: 800; font-display: swap; }
:root {
  --bg: #07021a; --ink: #f4ecff; --dim: #8d7fb3; --pink: #ff2bd6; --cyan: #00e5ff; --yellow: #ffd400; --lime: #a6ff00;
  --display: Arcade, 'Arial Black', Impact, system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.locked { overflow: hidden; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
a.cab:hover, a.cab:focus-visible { text-decoration: none; }

/* backdrop: purple haze + perspective neon floor */
.bg { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 43, 214, .28), transparent 70%),
  radial-gradient(ellipse 60% 40% at 90% 30%, rgba(0, 229, 255, .12), transparent 70%),
  radial-gradient(ellipse 60% 40% at 5% 60%, rgba(139, 92, 255, .16), transparent 70%), var(--bg); overflow: hidden; }
.floor { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; transform: perspective(380px) rotateX(62deg); transform-origin: 50% 100%;
  background-image: linear-gradient(rgba(255, 43, 214, .35) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 43, 214, .35) 2px, transparent 2px);
  background-size: 60px 60px; animation: floor 3s linear infinite; mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); }
@keyframes floor { to { background-position: 0 60px; } }

/* header */
.top { text-align: center; padding: max(18px, env(safe-area-inset-top)) 16px 6px; }
.season { display: inline-block; font: 800 12px/1 var(--display); letter-spacing: .3em; padding: 7px 12px 6px 14px; border: 2px solid var(--lime); color: var(--lime); border-radius: 99px; box-shadow: 0 0 12px rgba(166, 255, 0, .45), inset 0 0 10px rgba(166, 255, 0, .25); text-shadow: 0 0 8px rgba(166, 255, 0, .8); }
.logo { margin: 12px 0 6px; font-family: var(--display); font-weight: 800; line-height: .9; letter-spacing: .02em; display: flex; flex-direction: column; align-items: center; }
.logo .l1 { font-size: clamp(44px, 12vw, 104px); color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--pink), 0 0 40px var(--pink), 0 0 80px rgba(255, 43, 214, .6); animation: flicker 6s infinite; }
.logo .l2 { font-size: clamp(36px, 9.6vw, 84px); color: transparent; -webkit-text-stroke: 2px var(--cyan); text-shadow: 0 0 14px rgba(0, 229, 255, .8), 0 0 40px rgba(0, 229, 255, .45); letter-spacing: .12em; margin-top: 4px; }
@keyframes flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: .55; } }
.pitch { max-width: 640px; margin: 8px auto 6px; font-size: clamp(15px, 2.2vw, 19px); color: #e9dcff; }
.pitch b { color: var(--yellow); font-weight: 700; }
.count { margin: 0; font: 12px var(--mono); color: var(--dim); letter-spacing: .08em; }

/* the floor of cabinets */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; padding: 22px 12px 10px; max-width: 1240px; margin: 0 auto; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; padding: 28px 20px 10px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 28px; } }

.cab { --c: #6a5a95; position: relative; text-decoration: none; display: flex; flex-direction: column; text-align: center; color: inherit; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; transition: transform .18s ease; touch-action: manipulation; }
.cab.lit:hover, .cab.lit:focus-visible { transform: translateY(-4px) scale(1.02); outline: none; }
.cab.lit:active { transform: scale(.98); }
.cab .body { position: relative; border-radius: 14px 14px 6px 6px; padding: 7px 7px 0; background: linear-gradient(90deg, #120a2a, #1f1440 18%, #1a1036 82%, #0d0720); border: 2px solid color-mix(in srgb, var(--c) 70%, #000); box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 14px 30px rgba(0, 0, 0, .6); }
.cab.lit .body { box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent), 0 0 0 1px rgba(255, 255, 255, .05) inset, 0 14px 30px rgba(0, 0, 0, .6); }
.cab.lit:hover .body { box-shadow: 0 0 30px color-mix(in srgb, var(--c) 75%, transparent), 0 14px 30px rgba(0, 0, 0, .6); }

.marquee { position: relative; border-radius: 8px 8px 3px 3px; padding: 8px 6px 7px; min-height: 58px; display: flex; flex-direction: column; justify-content: center; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, #12062b), #12062b); border: 2px solid var(--c); }
.cab.lit .marquee { box-shadow: 0 0 14px var(--c), inset 0 0 18px color-mix(in srgb, var(--c) 50%, transparent); }
.marquee::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 45%, transparent 60%); transform: translateX(-120%); }
.cab.lit .marquee::after { animation: sheen 4.5s ease-in-out infinite; animation-delay: calc(var(--i) * .6s); }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.mtitle { font: 800 clamp(13px, 3.6vw, 19px)/1.05 var(--display); letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 0 6px var(--c), 0 0 14px var(--c); overflow-wrap: anywhere; }
.mhandle { margin-top: 3px; font: 600 clamp(10px, 2.6vw, 12px)/1.2 var(--mono); color: color-mix(in srgb, var(--c) 60%, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.screen { position: relative; margin: 7px 3px 0; aspect-ratio: 4 / 3; border-radius: 10px / 14px; overflow: hidden; background: #000; border: 5px solid #05020d; box-shadow: inset 0 0 0 2px #2b2148, inset 0 0 24px rgba(0, 0, 0, .9); }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.screen::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px); }
.screen::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .14), transparent 45%), radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .55)); }
.press { position: absolute; left: 0; right: 0; bottom: 7%; z-index: 4; font: 800 clamp(9px, 2.4vw, 12px)/1 var(--display); letter-spacing: .14em; color: #fff; text-shadow: 0 0 6px var(--c), 0 1px 0 #000; animation: blink 1.1s steps(2, start) infinite; }
.insert { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.insert b { font: 800 clamp(12px, 3.4vw, 17px)/1.1 var(--display); letter-spacing: .1em; color: var(--lime); text-shadow: 0 0 8px rgba(166, 255, 0, .9), 0 0 18px rgba(166, 255, 0, .5); animation: pulse 1.2s steps(2, start) infinite; animation-delay: calc(var(--i) * -.17s); }
@keyframes pulse { to { opacity: .18; text-shadow: none; } }
.insert span { font: 10px/1.2 var(--mono); color: #5d527d; letter-spacing: .08em; }
@keyframes blink { to { visibility: hidden; } }

.plate { position: relative; margin: 8px 2px 0; min-height: 52px; padding: 7px 8px; border-radius: 6px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .07); font-size: clamp(11px, 2.9vw, 13px); line-height: 1.32; color: #e9dcff; display: flex; align-items: center; justify-content: center; }
.plate q, .plate span { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.plate q { font-style: italic; }
.plate q::before { content: '“'; color: var(--c); } .plate q::after { content: '”'; color: var(--c); }
.plate span { color: #bfb2e0; }
.cab.dark .plate { color: #4e4570; font: 11px/1.3 var(--mono); }

/* control deck + coin door */
.deck { position: relative; height: 34px; margin: 8px -7px 0; background: linear-gradient(180deg, #2a1d52, #170e31); clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%); display: flex; align-items: center; justify-content: center; gap: 14%; }
.stick { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--c) 45%, #000 120%); box-shadow: 0 0 8px var(--c); position: relative; top: -4px; }
.stick::after { content: ''; position: absolute; left: 4px; top: 10px; width: 4px; height: 9px; background: #555; border-radius: 2px; }
.btns { display: flex; gap: 6px; }
.btns i { width: 11px; height: 11px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.btns i:nth-child(2) { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.btns i:nth-child(3) { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.cab.dark .stick, .cab.dark .btns i { background: #2c2446; box-shadow: none; }
.door { margin: 0 4% ; height: 44px; background: linear-gradient(180deg, #120a26, #0a0518); border: 2px solid #1c1338; border-top: 0; border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.coin { width: 18px; height: 22px; border-radius: 3px; background: #1d1438; border: 1px solid #2f2456; display: flex; align-items: center; justify-content: center; }
.coin::after { content: ''; width: 2px; height: 11px; background: #ff6b2b; box-shadow: 0 0 6px #ff6b2b, 0 0 12px #ff3b2b; border-radius: 1px; }
.cab.dark .coin::after { background: #4a2a22; box-shadow: none; animation: coinpulse 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
@keyframes coinpulse { 50% { background: #ff6b2b; box-shadow: 0 0 8px #ff6b2b; } }
.hi { position: absolute; left: 0; right: 0; bottom: -2px; font: 10px/1 var(--mono); color: var(--dim); letter-spacing: .06em; }
.door { position: relative; }
.door .hi { bottom: 4px; }
.door .coin { margin-top: -10px; }
.slotno { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 5; font: 800 9px/1 var(--display); letter-spacing: .1em; padding: 3px 6px 2px; border-radius: 99px; background: #07021a; border: 1px solid color-mix(in srgb, var(--c) 70%, #000); color: color-mix(in srgb, var(--c) 70%, #fff); }

.cab.dark { cursor: help; }
.cab.dark .body { border-color: #2a2142; }
.cab.dark .marquee { border-color: #2c2446; background: #0f0822; }
.cab.dark .mtitle { color: #3d3460; text-shadow: none; }
.cab.dark .mhandle { color: #352c55; }

.foot { max-width: 680px; margin: 26px auto 0; padding: 0 16px max(26px, env(safe-area-inset-bottom)); text-align: center; color: #bfb2e0; font-size: 14px; }
.foot .small { font-size: 12px; color: var(--dim); }

/* high-score card (opens on the arcade page after a game reports a top-5 score) */
.sc { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(4, 1, 14, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sc[hidden] { display: none; }
.sc-panel { --c: var(--pink); width: min(380px, 100%); max-height: 100%; overflow: auto; border-radius: 18px; padding: 12px 14px 14px; background: linear-gradient(180deg, #160a33, #0b0420); border: 2px solid var(--c); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sc-now { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-now b { font: 800 18px/1.15 var(--display); letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 0 8px var(--c); overflow-wrap: anywhere; }
.sc-now span { font: 12px var(--mono); color: color-mix(in srgb, var(--c) 60%, #fff); }
.pbtn { flex: none; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; font: 800 13px/1 var(--display); letter-spacing: .06em; cursor: pointer; touch-action: manipulation; }
.pbtn.close { font-size: 18px; border-color: var(--pink); }
.board { padding: 12px 14px; border-radius: 14px; background: rgba(10, 4, 28, .94); border: 2px solid var(--yellow); box-shadow: 0 0 24px rgba(255, 212, 0, .3); }
.board h2 { margin: 0 0 4px; font: 800 18px/1 var(--display); letter-spacing: .12em; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 212, 0, .7); text-align: center; }
.bline { margin: 6px 0 10px; font-size: 12px; color: #bfb2e0; text-align: center; font-style: italic; }
.bline:empty { display: none; }
.board ol { margin: 0; padding: 0; list-style: none; counter-reset: r; font: 15px/1 var(--mono); }
.board li { counter-increment: r; display: flex; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed rgba(255, 255, 255, .1); }
.board li::before { content: counter(r); width: 14px; color: var(--dim); }
.board li b { flex: 1; letter-spacing: .2em; color: #fff; }
.board li span { color: var(--cyan); }
.board li.new { animation: newrow .5s steps(2) 6; }
.board li.empty b, .board li.empty span { color: #3d3460; }
@keyframes newrow { 50% { background: rgba(255, 212, 0, .25); } }
.bnote { margin: 8px 0 0; font-size: 11px; color: var(--dim); text-align: center; }
.entry { margin: 0 0 12px; padding: 16px; border-radius: 14px; text-align: center; background: rgba(10, 4, 28, .97); border: 2px solid var(--pink); box-shadow: 0 0 30px rgba(255, 43, 214, .45); }
.entry[hidden] { display: none; }
.etitle { font: 800 20px/1 var(--display); color: var(--yellow); letter-spacing: .08em; text-shadow: 0 0 12px rgba(255, 212, 0, .8); animation: blink 1s steps(2, start) infinite; }
.escore { margin: 10px 0 12px; font: 800 38px/1 var(--display); color: #fff; text-shadow: 0 0 14px var(--pink); }
.entry label { display: block; font: 11px var(--mono); color: var(--dim); letter-spacing: .14em; margin-bottom: 6px; }
.entry input { width: 150px; height: 56px; text-align: center; font: 800 32px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--lime); background: #000; border: 2px solid var(--lime); border-radius: 10px; padding-left: .3em; outline: none; box-shadow: 0 0 14px rgba(166, 255, 0, .4); }
.ebtns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.ebtns button { height: 44px; min-width: 96px; border-radius: 10px; font: 800 14px/1 var(--display); letter-spacing: .1em; cursor: pointer; }
.ebtns .go { border: 0; color: #12062b; background: linear-gradient(90deg, var(--pink), var(--yellow)); }
.ebtns .skip { border: 2px solid rgba(255, 255, 255, .2); background: none; color: #bfb2e0; }
.sc-actions { display: flex; justify-content: center; margin-top: 12px; }
.playagain { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 10px; border: 2px solid var(--c); color: #fff; font: 800 14px/1 var(--display); letter-spacing: .1em; text-shadow: 0 0 8px var(--c); }
.playagain:hover { text-decoration: none; box-shadow: 0 0 14px var(--c); }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 160%); opacity: 0; visibility: hidden; z-index: 60; max-width: calc(100% - 24px); padding: 11px 16px; border-radius: 12px; background: #12062b; border: 2px solid var(--lime); color: #fff; font-size: 14px; box-shadow: 0 0 20px rgba(166, 255, 0, .35); transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s; pointer-events: none; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .25s ease, opacity .25s ease; }

@media (prefers-reduced-motion: reduce) {
  .floor, .logo .l1, .marquee::after, .press, .insert b, .coin::after, .etitle, .board li.new { animation: none !important; }
}
