@font-face { font-family: "Press Start 2P"; src: url(/arcade/press-start-2p.woff2) format("woff2"); font-display: swap; }
:root { color-scheme: dark; --bg: #0b0e2a; --ink: #f4f1ff; --mut: #a9acd6; --y: #ffd23f; --o: #ff8a1f; --p: #ff3dbb; --c: #3ddcff; --g: #8fd14f; --px: "Press Start 2P", ui-monospace, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; overflow-x: hidden; }
.sky { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(1200px 500px at 50% -120px, #3a1e8a 0%, transparent 70%),
  radial-gradient(800px 400px at 100% 100%, #0f3a5a 0%, transparent 70%),
  linear-gradient(#0b0e2a, #090b20);
}
.sky::after { content: ""; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 24px 24px; }
a { color: var(--c); }
main { max-width: 1120px; margin: 0 auto; padding: 18px 18px 80px; }
.crumb { margin: 0 0 10px; font-size: 14px; color: var(--mut); }
.crumb a { color: var(--mut); text-decoration: none; } .crumb a:hover { color: #fff; }

/* marquee */
.marquee { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; padding: 22px 24px; border-radius: 18px;
  background: linear-gradient(180deg, #ffb52e 0%, #ff7a1a 52%, #e8560e 53%, #ff8a1f 100%); border: 4px solid #1a0f3a;
  box-shadow: 0 6px 0 #1a0f3a, inset 0 3px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(0,0,0,.18); }
.logo { display: flex; flex-direction: column; line-height: 1; font-family: var(--px); }
.logo .l1 { font-size: clamp(14px, 2.4vw, 20px); color: #1a0f3a; letter-spacing: 2px; }
.logo .l2 { font-size: clamp(30px, 6.4vw, 56px); color: #fff; letter-spacing: 3px; text-shadow: 4px 4px 0 #1a0f3a, -2px -2px 0 #1a0f3a, 2px -2px 0 #1a0f3a, -2px 2px 0 #1a0f3a, 0 0 22px rgba(255,255,255,.35); margin-top: 6px; }
.marquee .tag { margin: 0; flex: 1 1 220px; color: #2a0f00; font-weight: 800; font-size: 16px; }
.snd, .tb, .btn, .tabs button { font-family: var(--px); cursor: pointer; }
.snd { border: 3px solid #1a0f3a; background: #1a0f3a; color: var(--y); padding: 10px 14px; font-size: 11px; border-radius: 10px; min-height: 44px; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.snd[aria-pressed=false] { color: #8a86b8; }

/* featured */
.featured { margin: 22px 0 18px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; border: 4px solid #1a0f3a; border-radius: 18px; overflow: hidden; background: #15134a; box-shadow: 0 6px 0 #1a0f3a; }
.feat-art { position: relative; min-height: 260px; background: #000; }
.feat-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.ribbon { position: absolute; top: 14px; left: -4px; font: 10px var(--px); background: var(--p); color: #fff; padding: 8px 12px; border: 3px solid #1a0f3a; border-left: 0; box-shadow: 0 3px 0 #1a0f3a; }
.feat-copy { padding: 24px 24px 20px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #1f1b6a, #15134a); }
.feat-style { font: 9px var(--px); color: var(--c); letter-spacing: 1px; }
.feat-copy h2 { margin: 0; font: clamp(18px, 2.6vw, 26px)/1.25 var(--px); color: var(--y); text-shadow: 3px 3px 0 #000; }
.feat-copy p { margin: 0; color: #dcdaf8; font-size: 15px; }
.feat-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.feat-best { font: 10px var(--px); color: var(--y); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 3px solid #1a0f3a; text-decoration: none; font-size: 13px; color: #1a0f3a;
  background: linear-gradient(#b6ff5c, #5fcf2a); box-shadow: 0 5px 0 #1a0f3a, inset 0 2px 0 rgba(255,255,255,.6); transition: transform .06s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #1a0f3a, inset 0 2px 0 rgba(255,255,255,.6); }
.btn.alt { background: linear-gradient(#ffe07a, #ffb52e); } .btn.ghost { background: linear-gradient(#7d86d8, #4b52a8); color: #fff; }
.dots { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.dots button { width: 14px; height: 14px; padding: 0; border-radius: 3px; border: 2px solid #1a0f3a; background: #3a3790; cursor: pointer; }
.dots button[aria-current=true] { background: var(--y); }

/* tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.tabs button { font-size: 11px; padding: 12px 16px; min-height: 44px; border-radius: 10px; border: 3px solid #1a0f3a; background: #26236e; color: #cfcdf7; box-shadow: 0 4px 0 #1a0f3a; }
.tabs button[aria-pressed=true] { background: var(--c); color: #1a0f3a; }
.tabs button:hover { filter: brightness(1.15); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; border: 4px solid #1a0f3a; border-radius: 16px; overflow: hidden; background: #1b1960; box-shadow: 0 6px 0 #1a0f3a; text-decoration: none; color: inherit; transition: transform .12s; }
.card:hover, .card:focus-visible { transform: translateY(-4px) rotate(-.4deg); outline: none; }
.card:focus-visible { box-shadow: 0 6px 0 #1a0f3a, 0 0 0 4px var(--y); }
.card .art { position: relative; aspect-ratio: 16 / 10; background: #000; }
.card canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.badge { position: absolute; top: 10px; right: 10px; font: 10px var(--px); padding: 7px 9px; border-radius: 8px; border: 3px solid #1a0f3a; transform: rotate(6deg); box-shadow: 0 3px 0 #1a0f3a; animation: wob 1.6s ease-in-out infinite; }
.badge.NEW { background: var(--g); color: #1a0f3a; } .badge.HOT { background: var(--p); color: #fff; }
@keyframes wob { 50% { transform: rotate(-4deg) scale(1.08); } }
.style { position: absolute; left: 10px; bottom: 10px; font: 8px var(--px); background: rgba(10,8,40,.8); color: var(--c); padding: 6px 8px; border-radius: 6px; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font: 14px/1.3 var(--px); color: #fff; text-shadow: 2px 2px 0 #000; }
.card p { margin: 0; color: #c9c7f0; font-size: 14px; line-height: 1.4; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.best { font: 9px var(--px); color: var(--y); }
.best.none { color: #6d6aa8; }
.pl { font: 11px var(--px); color: #1a0f3a; background: linear-gradient(#b6ff5c, #5fcf2a); border: 3px solid #1a0f3a; border-radius: 9px; padding: 9px 12px; box-shadow: 0 3px 0 #1a0f3a; }

/* more */
.more { margin-top: 38px; }
.more h2 { font: 13px var(--px); color: var(--mut); margin: 0 0 14px; }
.more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.more a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 2px solid #2b2878; background: rgba(27,25,96,.6); color: inherit; text-decoration: none; min-height: 64px; }
.more a:hover { background: #24217a; }
.more img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #111; flex: none; }
.more b { display: block; } .more small { color: var(--mut); }
.foot { margin-top: 30px; color: #7f7cb4; font-size: 13px; text-align: center; }

/* stage */
body.playing { overflow: hidden; }
body.playing #portal { display: none; }
body.playing .req-fab { display: none !important; }
.stage { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; background: radial-gradient(900px 500px at 50% 0, #2a1670, #0b0e2a 70%); padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); gap: 8px; z-index: 10; }
.stage[hidden] { display: none; }
.bar { width: 100%; max-width: 1180px; display: flex; align-items: center; gap: 10px; }
.stitle { flex: 1; margin: 0; font: clamp(10px, 1.6vw, 15px) var(--px); color: var(--y); text-align: center; text-shadow: 2px 2px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 6px; }
.tb { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 3px solid #1a0f3a; background: #2b2878; color: #fff; font-size: 14px; box-shadow: 0 3px 0 #1a0f3a; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tb.back { background: linear-gradient(#ffe07a, #ffb52e); color: #1a0f3a; font-size: 11px; }
.tb[aria-pressed=false] { background: #1a1850; color: #6f6ca8; text-decoration: line-through; }
.tb:active { transform: translateY(2px); }
.cab { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.screen { position: relative; border: 6px solid #1a0f3a; border-radius: 14px; background: #000; box-shadow: 0 0 0 4px #ff8a1f, 0 0 0 8px #1a0f3a, 0 14px 40px rgba(0,0,0,.6); overflow: hidden; }
.screen canvas { display: block; outline: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.screen.pixel canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.screen.pixel.smooth canvas { image-rendering: auto; }
.screen.pixel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(rgba(0,0,0,.08) 0 1px, transparent 1px 3px); }
.ov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(8,6,30,.72); backdrop-filter: blur(2px); z-index: 2; overflow: auto; }
.ov[hidden] { display: none; }
.ov.full { position: fixed; z-index: 30; background: rgba(8,6,30,.9); align-items: flex-start; padding: 16px 16px 24px; }
.ov.full .panel { margin: auto; }
.panel { width: min(520px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.panel h2 { margin: 0; font: clamp(16px, 3.4vw, 28px)/1.3 var(--px); color: var(--y); text-shadow: 3px 3px 0 #000; }
.panel .sub { margin: 0; color: #dcdaf8; font-size: 15px; max-width: 440px; }
.panel .score { font: clamp(22px, 5vw, 40px) var(--px); color: #fff; text-shadow: 3px 3px 0 #000; }
.panel .lbl { font: 9px var(--px); color: var(--mut); }
.panel .newbest { font: 12px var(--px); color: #1a0f3a; background: var(--y); padding: 8px 12px; border-radius: 8px; border: 3px solid #1a0f3a; animation: wob 1s ease-in-out infinite; }
.panel ul.lines { list-style: none; margin: 0; padding: 0; color: #cfcdf7; font-size: 14px; }
.panel .keys { display: grid; grid-template-columns: auto auto; gap: 4px 14px; text-align: left; font-size: 13px; color: #cfcdf7; margin: 2px 0; }
.panel .keys kbd { font: 700 12px system-ui, sans-serif; color: #fff; background: #2b2878; border: 2px solid #1a0f3a; border-radius: 5px; padding: 3px 6px; white-space: nowrap; }
.panel .acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.panel .hint { font: 8px var(--px); color: var(--mut); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; width: 100%; }
.mode { font-family: inherit; text-align: left; border: 3px solid #1a0f3a; border-radius: 12px; padding: 10px 12px; background: linear-gradient(#3a36a0, #26236e); color: #fff; cursor: pointer; box-shadow: 0 4px 0 #1a0f3a; min-height: 44px; }
.mode b { display: block; font: 10px/1.4 var(--px); color: var(--y); margin-bottom: 4px; }
.mode small { display: block; color: #cfcdf7; font-size: 12px; line-height: 1.3; }
.mode .md { display: block; margin-top: 6px; font: 8px var(--px); color: #9fd6ff; }
.mode:hover, .mode:focus-visible { filter: brightness(1.2); outline: none; }
.medal { display: inline-block; width: 46px; height: 46px; border-radius: 50%; border: 4px solid #1a0f3a; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.medal.m1 { background: #d08a4a; } .medal.m2 { background: #d6dbe8; } .medal.m3 { background: #ffd23f; }
.legend { width: 100%; max-width: 1180px; text-align: center; color: var(--mut); font-size: 13px; min-height: 18px; }
.legend kbd { font: 700 11px system-ui, sans-serif; color: #fff; background: #2b2878; border: 2px solid #1a0f3a; border-radius: 4px; padding: 2px 5px; margin: 0 2px; }
.touch { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 4px; -webkit-user-select: none; user-select: none; touch-action: none; }
.touch[hidden] { display: none; }
.pad { display: flex; gap: 10px; align-items: flex-end; }
.pad-right { margin-left: auto; }
.stage:not(.land) .touch .pad:not(:has(.wide)) { flex-wrap: wrap; max-width: 50%; justify-content: center; }
.stage:not(.land) .touch .pad-right { justify-content: flex-end; }
.pbtn { -webkit-tap-highlight-color: transparent; touch-action: none; font: 13px var(--px); color: #fff; width: 64px; height: 64px; border-radius: 50%; border: 4px solid #1a0f3a; background: radial-gradient(circle at 35% 30%, #5a56c8, #2b2878); box-shadow: 0 5px 0 #1a0f3a; display: flex; align-items: center; justify-content: center; padding: 0; }
.pbtn.big { width: 78px; height: 78px; font-size: 12px; }
.pbtn.wide { width: min(280px, 70vw); border-radius: 40px; }
.pad-right .pbtn { background: radial-gradient(circle at 35% 30%, #ff7ad0, #c21f8a); }
.pad-right .pbtn:last-child { background: radial-gradient(circle at 35% 30%, #b6ff5c, #4aa81a); color: #1a0f3a; }
.pbtn.on { transform: translateY(4px); box-shadow: 0 1px 0 #1a0f3a; filter: brightness(1.25); }
.stage:fullscreen { padding: 8px; }

@media (max-width: 760px) {
  main { padding: 12px 12px 70px; }
  .marquee { padding: 16px; border-radius: 14px; }
  .marquee .snd { position: absolute; top: 12px; right: 12px; padding: 8px 10px; font-size: 9px; }
  .marquee .tag { font-size: 14px; }
  .featured { grid-template-columns: 1fr; }
  .feat-art { min-height: 0; aspect-ratio: 16 / 9; }
  .feat-copy { padding: 16px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .tabs { gap: 6px; } .tabs button { font-size: 9px; padding: 10px 10px; }
  .stage { padding-left: 6px; padding-right: 6px; gap: 6px; }
  .tb.back span { display: none; }
  .tb { min-width: 40px; padding: 0 6px; }
  .tools { gap: 4px; }
  .legend { font-size: 11px; }
  .screen { border-width: 4px; box-shadow: 0 0 0 3px #ff8a1f, 0 0 0 6px #1a0f3a; }
}
@media (prefers-reduced-motion: reduce) { .badge { animation: none; } .card { transition: none; } }

/* phone held sideways: pads sit beside the screen */
.stage.land { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: max(4px, env(safe-area-inset-bottom)); gap: 4px; }
.stage.land .legend { display: none; }
.stage.land .bar .tb { min-height: 36px; min-width: 38px; }
.stage.land .touch { position: absolute; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); max-width: none; padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right)); pointer-events: none; z-index: 3; }
.stage.land .pad { pointer-events: auto; flex-wrap: wrap; max-width: 170px; justify-content: center; }
.stage.land .pbtn.wide { width: 150px; height: 110px; border-radius: 28px; }

/* shelves + link cards (classic remakes) */
.card .art img { width: 100%; height: 100%; display: block; object-fit: cover; background: #111; }
.tabs button small { font-size: .8em; opacity: .7; margin-left: 4px; }
.card[hidden] { display: none !important; }
