/* Beat Dash: page-specific styles on top of ../arcade-common/pz.css */
body[data-tod="day"] { --accent: #0f9bd8; --accent2: #c43cc9; --glow: rgba(15, 155, 216, .25); }
body[data-tod="night"] { --accent: #19d3ff; --accent2: #d94cff; }
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.col { display: grid; gap: 16px; min-width: 0; }
.menu-grid > * { min-width: 0; }
.hero-cv { width: 100%; aspect-ratio: 8 / 5; display: block; border-radius: 14px; margin: 12px 0 2px; background: var(--card2); border: 1px solid var(--line); touch-action: pan-y; }
.hint.small { font-size: .8rem; margin-top: 8px; }

/* level picker */
.levels { display: grid; gap: 8px; }
.levels button { text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card2); min-height: 64px; color: var(--ink); }
.levels button b { font-size: 1rem; }
.levels button span { grid-column: 1; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.levels button small { grid-column: 2; grid-row: 1; font-weight: 700; font-size: .72rem; color: var(--muted); white-space: nowrap; text-align: right; }
.levels button .meter { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 6px; font-style: normal; }
.levels button .meter > i { display: block; height: 6px; border-radius: 99px; background: rgba(128, 140, 170, .28); overflow: hidden; }
.levels button .meter > i > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.levels button .meter em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); }
.levels button[aria-checked="true"] { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 6px 18px var(--glow); }
.levels button[aria-checked="true"] span, .levels button[aria-checked="true"] small, .levels button[aria-checked="true"] .meter em { color: rgba(255, 255, 255, .94); }
.levels button[aria-checked="true"] .meter > i { background: rgba(255, 255, 255, .3); }
.levels button[aria-checked="true"] .meter > i > i { background: #fff; }
.go-row { margin-top: 16px; flex-wrap: nowrap; }
.go-row .btn { flex: 1 1 0; width: auto; margin-top: 0; }
.postcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 12px; border-radius: 14px; border: 2px dashed var(--accent); background: var(--card2); }
.postcard div { display: grid; gap: 2px; min-width: 0; }
.postcard b { font-size: .92rem; }
.postcard span { font-size: .78rem; color: var(--muted); }
.postcard .btn { flex: none; }

/* how to play */
.how { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--ink); }
.how .pi { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.2rem; }

/* leaderboard */
.lb { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.lb li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card2); font-size: .92rem; min-width: 0; }
.lb li.me { outline: 2px solid var(--accent); }
.lb .rk { font-weight: 800; color: var(--muted); text-align: center; }
.lb li:nth-child(-n+3) .rk { color: var(--accent); }
.lb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb .md { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.lb b { font-variant-numeric: tabular-nums; }
#lbBody .hint { text-align: center; padding: 14px 4px; }

/* play screen */
body[data-screen="play"] { overflow: hidden; position: fixed; inset: 0; width: 100%; overscroll-behavior: none; }
body[data-screen="play"] .top, body[data-screen="play"] main > #scMenu { display: none; }
.play { position: fixed; inset: 0; z-index: 20; margin: 0; background: #000; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 8px; align-items: center; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hudbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(10, 14, 40, .55); color: #fff; font-size: 1.1rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 0; }
.hudbtn[aria-pressed="false"] { opacity: .55; }
.hudbtn.cp { color: #ffe066; }
.hud-mid { flex: 1 1 auto; min-width: 0; pointer-events: none; }
.prog { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .35); overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.prog > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #19d3ff, #d94cff); }
.hud-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .7), 0 0 2px #000; font-weight: 800; }
.hud-pct { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.hud-info { font-size: .78rem; font-weight: 700; opacity: .92; text-align: right; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-fx { position: absolute; left: 0; right: 0; top: calc(max(8px, env(safe-area-inset-top)) + 74px); text-align: center; font-weight: 800; font-size: clamp(1.1rem, 4vw, 1.6rem); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .75); letter-spacing: .02em; pointer-events: none; }
.tap-hint { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(10, 14, 40, .7); color: #fff; font-weight: 700; font-size: .9rem; pointer-events: none; animation: bdfade 4.5s forwards; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
@keyframes bdfade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulse { from { transform: scale(1.3); } }
@media (max-width: 360px) { .hud { gap: 5px; padding-left: 6px; padding-right: 6px; } .hud-info { display: none; } }
@media (prefers-reduced-motion: reduce) { .tap-hint { animation: none; } .newbest { animation: none; } }

/* result / pause overlay */
.newbest { display: inline-block; margin-bottom: 6px; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #1a1030; background: linear-gradient(135deg, #ffd24a, #ff8a3d); animation: pulse .6s; }
.ovscore { font-size: clamp(2.6rem, 14vw, 3.6rem); font-weight: 800; line-height: 1.05; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.ovmode { color: var(--muted); font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.ovstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.ovstats div { background: var(--card2); border-radius: 12px; padding: 8px 4px; min-width: 0; }
.ovstats b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ovstats span { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.ovname { text-align: left; margin-top: 12px; }
.ovboard { text-align: left; margin-top: 8px; }
.ovboard .label { margin: 8px 0 0; }
.ovboard .lb { margin-top: 6px; }
.overlay .row .btn { flex: 1 1 130px; }
.overlay .btn.go { margin-top: 0; width: auto; }

/* touch targets: at least 44px */
.seg button, .chips button { min-height: 44px; }
.seg { padding: 2px; }
.btn.small { min-height: 44px; }

/* result cards: the button row stays visible, only the middle scrolls on short screens */
.overlay > .card { display: flex; flex-direction: column; overflow: hidden; padding: 16px; }
.overlay .ovbody { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; padding: 0 2px; }
.overlay .big, .overlay h2, .overlay .row { flex: none; }
body[data-tod="night"] .ovscore { background-image: linear-gradient(90deg, #6fe6ff, #e58cff); }
@media (max-height: 680px) { .overlay .big { display: none; } .overlay h2 { font-size: 1.3rem; margin-top: 0; } .ovscore { font-size: 2.6rem; } .ovboard { display: none; } }
@media (max-height: 380px) { .ovstats { display: none; } }
@media (max-height: 520px) { .overlay .row { margin-top: 10px; flex-wrap: nowrap; } .overlay .row .btn { flex: 1 1 0; padding: 8px 6px; font-size: .9rem; } .ovstats { margin-top: 8px; } .ovname { margin-top: 6px; } }
@media (max-width: 420px) { .overlay .row { gap: 8px; } .overlay .row .btn { flex: 1 1 28%; padding: 8px 4px; font-size: .88rem; } .overlay .row .btn[data-role="again"] { flex-basis: 100%; } }
