/* Shared look for the arcade home page and every game's interface. */
:root {
  --bg: #0b0d1a; --panel: rgba(18, 22, 44, .82); --line: rgba(255, 255, 255, .12);
  --text: #f3f5ff; --muted: #a9b0d0; --accent: #ffc94d; --accent-ink: #2a1c00; --good: #5ff2c0; --bad: #ff6b7d;
  --radius: 16px; --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body.game { overflow: hidden; }
canvas.stage { position: fixed; inset: 0; display: block; touch-action: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: .01em; }
.muted { color: var(--muted); }

.btn { display: inline-block; font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-align: center; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px) scale(.98); }
.btn.ghost { background: rgba(255, 255, 255, .12); color: var(--text); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* in-game */
.topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; pointer-events: none; z-index: 20; }
.topbar > * { pointer-events: auto; }
.topbar-title { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; opacity: .85; flex: 1; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.coinpill { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); border-radius: 999px; padding: 7px 14px; font-weight: 800; }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.hud .chip { position: absolute; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); border-radius: 14px; padding: 8px 14px; text-shadow: none; }
.toast { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 30; font-size: 24px; font-weight: 800; text-align: center; text-shadow: 0 3px 14px rgba(0, 0, 0, .7); opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(6, 8, 18, .62); backdrop-filter: blur(6px); padding: 16px; }
.overlay.loading { background: var(--bg); }
.card { width: min(100%, 420px); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; text-align: center; box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.card h1 { font-size: 30px; margin-bottom: 6px; }
.card p { margin: 6px 0 14px; }
.card .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.card .row b { color: var(--accent); }
.card .btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.card input { width: 100%; font: inherit; font-weight: 600; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: var(--text); text-align: center; margin: 6px 0; }
.bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff8a5c); transition: width .2s; }

/* level, results extras */
.levelpill { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 14px; }
.levelpill i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--good); transition: width .4s; }
.levelpill span { position: relative; }
.card .rewards { margin-top: 14px; display: grid; gap: 8px; text-align: left; }
.card .levelrow { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.card .levelrow .bar { flex: 1; }
.card .levelrow .bar i { background: linear-gradient(90deg, var(--good), #6cc7ff); }
.card .reward { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(95, 242, 192, .12); border: 1px solid rgba(95, 242, 192, .3); font-size: 14px; font-weight: 600; }
.card .reward b { color: var(--accent); white-space: nowrap; }
.card .reward.levelup { justify-content: center; background: rgba(255, 201, 77, .16); border-color: rgba(255, 201, 77, .45); color: var(--accent); font-weight: 800; }
.card .row.keys { align-items: center; }
.card .row.keys b { color: var(--text); font-weight: 600; }
kbd { display: inline-block; min-width: 28px; margin-right: 4px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line); border-bottom-width: 3px; background: rgba(255, 255, 255, .1); font: 700 13px var(--font); text-align: center; }

/* pause menu */
.pausebtn { letter-spacing: 1px; font-size: 12px; padding: 8px 11px; }
.pausebtn.floating { position: fixed; top: 10px; right: 14px; z-index: 20; }
.overlay.pause .seg { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.overlay.pause .seg span { flex: 1; text-align: left; font-weight: 700; }
.card p.tiny { font-size: 12px; margin: 0; }

/* touch controls */
.touch-zone { position: fixed; bottom: 0; width: 50%; height: 62%; z-index: 15; touch-action: none; user-select: none; -webkit-user-select: none; }
.touch-zone.left { left: 0; } .touch-zone.right { right: 0; }
.stick-base { position: absolute; left: 26px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); border-radius: 50%; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .28); display: grid; place-items: center; opacity: .6; pointer-events: none; backdrop-filter: blur(3px); }
.touch-zone.right .stick-base { left: auto; right: 26px; }
.stick-base.on { opacity: 1; bottom: auto; right: auto; }
.stick-knob { width: 46%; height: 46%; border-radius: 50%; background: rgba(255, 255, 255, .75); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.touch-btn { position: fixed; z-index: 16; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); color: var(--text); font: 800 14px var(--font); backdrop-filter: blur(3px); touch-action: none; user-select: none; -webkit-user-select: none; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); padding: 0; }
.touch-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-shadow: none; transform: scale(.94); }
.touch-btn.slot0 { right: 22px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); width: 86px; height: 86px; font-size: 16px; }
.touch-btn.slot1 { right: 122px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 66px; height: 66px; }
.touch-btn.slot2 { right: 32px; bottom: calc(126px + env(safe-area-inset-bottom, 0px)); width: 66px; height: 66px; }
