/* Dash Arena - title, HUD, panels and touch controls over the canvas (frame.css sets the page and the back link) */
html, body { touch-action: none; }
body { background: #050609; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
body.ad-playing { cursor: crosshair; }
body.ad-paneled { cursor: default; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; }

.ad-vignette { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 52%, rgb(0 0 0 / 0) 55%, rgb(2 3 8 / 0.55) 100%); }
.ad-hurt { position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 70% 65% at 50% 50%, rgb(255 30 20 / 0) 45%, rgb(255 30 20 / 0.45) 100%); }
.ad-hurt.ad-on { animation: ad-hurt 0.7s ease-out; }
@keyframes ad-hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

/* title over the attract mode */
.ad-title { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 7vh 20px calc(7vh + env(safe-area-inset-bottom)); box-sizing: border-box; text-align: center; pointer-events: none; transition: opacity 0.4s; background: linear-gradient(rgb(4 5 12 / 0.55), rgb(4 5 12 / 0) 30%, rgb(4 5 12 / 0) 74%, rgb(4 5 12 / 0.5)); }
.ad-title.ad-hide { opacity: 0; }
.ad-name { margin: 0; font-size: clamp(44px, 9.5vw, 112px); line-height: 1; font-weight: 800; letter-spacing: -0.035em; color: #fff; text-shadow: 0 0 36px rgb(70 240 255 / 0.55), 0 4px 30px rgb(4 5 12 / 0.85); }
.ad-go { margin: 0; padding: 10px 22px; border-radius: 9999px; background: rgb(8 10 24 / 0.66); border: 1px solid rgb(255 255 255 / 0.22); font-size: clamp(14px, 2.2vw, 18px); line-height: 24px; font-weight: 600; color: #fff; animation: ad-breathe 2.4s ease-in-out infinite; }
@keyframes ad-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }

/* HUD */
.ad-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.4s; text-shadow: 0 1px 8px rgb(2 3 8 / 0.9); }
.ad-hud.ad-show { opacity: 1; }
.ad-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad-wave { display: flex; align-items: baseline; gap: 8px; padding: 4px 14px; border-radius: 9999px; background: rgb(8 10 24 / 0.55); border: 1px solid rgb(255 255 255 / 0.1); white-space: nowrap; }
.ad-wave-label { font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(255 255 255 / 0.65); }
.ad-wave-num { font-size: 18px; line-height: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ad-left { font-size: 12px; line-height: 16px; font-weight: 600; color: rgb(255 255 255 / 0.55); }
.ad-hearts { display: flex; gap: 4px; }
.ad-heart svg { display: block; width: 22px; height: 22px; fill: #ff4a5c; filter: drop-shadow(0 0 6px rgb(255 60 80 / 0.6)); }
.ad-heart.ad-empty svg { fill: rgb(255 255 255 / 0.14); filter: none; }
.ad-heart.ad-shield svg { fill: rgb(70 240 255 / 0.25); stroke: #46f0ff; stroke-width: 1.8; filter: drop-shadow(0 0 6px rgb(70 240 255 / 0.7)); }

.ad-scorebox { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: calc(64px + env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ad-score { font-size: 26px; line-height: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ad-chain { display: flex; align-items: center; gap: 8px; }
.ad-mult { font-size: 15px; line-height: 20px; font-weight: 800; color: rgb(255 255 255 / 0.45); font-variant-numeric: tabular-nums; }
.ad-mult.ad-hot { color: #46f0ff; }
.ad-mult.ad-bump { animation: ad-bump 0.25s ease-out; }
@keyframes ad-bump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.ad-bar { display: block; width: 84px; height: 5px; border-radius: 3px; background: rgb(255 255 255 / 0.14); overflow: hidden; }
.ad-bar-fill { display: block; width: 100%; height: 100%; background: #46f0ff; transform-origin: 100% 50%; transform: scaleX(0); }

.ad-perks { position: absolute; left: calc(14px + env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 6px; }
.ad-perk { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgb(8 10 24 / 0.6); border: 1px solid rgb(70 240 255 / 0.35); }
.ad-perk svg { width: 18px; height: 18px; fill: none; stroke: #46f0ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-perk b { position: absolute; right: -4px; bottom: -4px; min-width: 14px; height: 14px; border-radius: 7px; background: #46f0ff; color: #04222a; font-size: 10px; line-height: 14px; text-align: center; text-shadow: none; }
.ad-touchui .ad-perks { bottom: calc(150px + env(safe-area-inset-bottom)); }

.ad-banner { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; opacity: 0; white-space: nowrap; }
.ad-banner.ad-show { animation: ad-banner 2.3s ease-out forwards; }
@keyframes ad-banner { 0% { opacity: 0; transform: translate(-50%, 10px) scale(1.08); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
.ad-banner p { margin: 0; }
.ad-banner-big { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 0 26px rgb(70 240 255 / 0.45), 0 2px 16px rgb(2 3 8 / 0.9); }
.ad-banner-small { margin-top: 6px !important; font-size: 15px; line-height: 22px; font-weight: 600; color: #ffc27a; }
.ad-banner-small:empty { display: none; }

.ad-hint { position: absolute; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: 86vw; padding: 7px 16px; border-radius: 12px; background: rgb(8 10 24 / 0.62); border: 1px solid rgb(255 255 255 / 0.1); text-align: center; font-size: 14px; line-height: 20px; font-weight: 500; color: rgb(255 255 255 / 0.94); opacity: 0; transition: opacity 0.9s; }
.ad-hint.ad-show { opacity: 1; }
.ad-touchui .ad-hint { bottom: calc(168px + env(safe-area-inset-bottom)); max-width: min(80vw, 420px); }

.ad-pops { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.ad-pop { position: absolute; left: 0; top: 0; display: none; font-size: 15px; line-height: 18px; font-weight: 800; color: #ffd27a; white-space: nowrap; text-shadow: 0 0 10px rgb(255 120 40 / 0.6), 0 1px 4px rgb(0 0 0 / 0.9); }
.ad-pop.ad-show { display: block; }
.ad-pop.ad-cool { color: #aef8ff; text-shadow: 0 0 10px rgb(70 240 255 / 0.7), 0 1px 4px rgb(0 0 0 / 0.9); }

/* panels: the upgrade choice and the end of a run */
.ad-panel { position: fixed; z-index: 14; left: 50%; top: 50%; transform: translate(-50%, calc(-50% + 14px)); box-sizing: border-box; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; padding: 22px 22px 18px; border-radius: 22px; background: rgb(8 10 24 / 0.86); border: 1px solid rgb(255 255 255 / 0.14); text-align: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity 0.3s, transform 0.3s, visibility 0.3s; cursor: default; }
.ad-panel.ad-show { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.ad-panel:not(.ad-show) { pointer-events: none; }
.ad-panel p { margin: 0; }
.ad-panel-head { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #46f0ff; }
.ad-panel-title { margin-top: 6px !important; font-size: 24px; line-height: 30px; font-weight: 800; letter-spacing: -0.01em; }
.ad-panel-keys { margin-top: 12px !important; font-size: 12px; line-height: 16px; color: rgb(255 255 255 / 0.5); }
.ad-panel-keys:empty { display: none; }

.ad-choose { width: min(700px, calc(100vw - 24px)); }
.ad-cards { display: flex; gap: 12px; margin-top: 16px; }
.ad-card { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px 14px; border-radius: 16px; border: 1px solid rgb(70 240 255 / 0.25); background: rgb(70 240 255 / 0.06); color: #fff; font: inherit; cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.ad-card:hover, .ad-card:focus-visible { background: rgb(70 240 255 / 0.14); border-color: rgb(70 240 255 / 0.7); transform: translateY(-2px); outline: none; }
.ad-card:active { transform: scale(0.98); }
.ad-card[hidden] { display: none; }
.ad-card-key { position: absolute; left: 10px; top: 8px; font-size: 11px; line-height: 16px; font-weight: 700; color: rgb(255 255 255 / 0.4); }
.ad-card-icon svg { display: block; width: 34px; height: 34px; fill: none; stroke: #46f0ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgb(70 240 255 / 0.6)); }
.ad-card-name { font-size: 16px; line-height: 22px; font-weight: 700; }
.ad-card-desc { font-size: 13px; line-height: 18px; color: rgb(255 255 255 / 0.72); }
.ad-card-lvl { font-size: 11px; line-height: 16px; font-weight: 600; color: rgb(70 240 255 / 0.8); }
.ad-card-lvl:empty { display: none; }
@media (max-width: 560px) {
  .ad-cards { flex-direction: column; }
  .ad-card { flex-direction: row; flex-wrap: wrap; text-align: left; padding: 12px 14px 12px 34px; column-gap: 12px; row-gap: 2px; }
  .ad-card-icon svg { width: 28px; height: 28px; }
  .ad-card-desc { flex-basis: 100%; }
}

.ad-over { width: min(360px, calc(100vw - 24px)); }
.ad-over-wave { margin-top: 10px !important; display: flex; flex-direction: column; align-items: center; }
.ad-over-wave span { font-size: 13px; line-height: 18px; font-weight: 600; color: rgb(255 255 255 / 0.6); }
.ad-over-wave b { font-size: 56px; line-height: 60px; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 0 24px rgb(70 240 255 / 0.5); }
.ad-over-rows { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 22px; }
.ad-over-row { display: flex; justify-content: space-between; padding: 4px 6px; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.ad-over-row span { color: rgb(255 255 255 / 0.66); }
.ad-over-row b { font-variant-numeric: tabular-nums; }
.ad-newbest { margin-bottom: 12px !important; font-size: 13px; line-height: 18px; font-weight: 700; color: #ffd27a; }
.ad-newbest[hidden] { display: none; }
.ad-btn { height: 46px; padding: 0 30px; border: 0; border-radius: 9999px; background: #46f0ff; color: #032028; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.ad-btn:hover, .ad-btn:focus-visible { background: #8ff6ff; outline: none; transform: translateY(-1px); }
.ad-btn:active { transform: scale(0.97); }

/* touch controls: only on touch devices, only while playing */
.ad-touch { display: none; }
.ad-touchui.ad-playing:not(.ad-paneled) .ad-touch { display: block; }
.ad-stick { position: fixed; z-index: 11; left: calc(92px + env(safe-area-inset-left)); top: calc(100% - 100px - env(safe-area-inset-bottom)); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.18); background: rgb(8 10 24 / 0.35); pointer-events: none; opacity: 0.6; transition: opacity 0.2s; }
.ad-stick.ad-active { opacity: 1; transition: none; }
.ad-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgb(70 240 255 / 0.35); border: 2px solid rgb(70 240 255 / 0.8); box-shadow: 0 0 18px rgb(70 240 255 / 0.4); }
.ad-dash { position: fixed; z-index: 11; right: calc(26px + env(safe-area-inset-right)); bottom: calc(40px + env(safe-area-inset-bottom)); width: 96px; height: 96px; padding: 0; border-radius: 50%; border: 0; background: rgb(8 10 24 / 0.5); color: #fff; font: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; touch-action: none; }
.ad-dash svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ad-dash-track { fill: none; stroke: rgb(255 255 255 / 0.16); stroke-width: 5; }
.ad-dash-ring { fill: none; stroke: rgb(70 240 255 / 0.55); stroke-width: 5; stroke-linecap: round; }
.ad-dash.ad-ready { background: rgb(70 240 255 / 0.18); box-shadow: 0 0 22px rgb(70 240 255 / 0.35); }
.ad-dash.ad-ready .ad-dash-ring { stroke: #46f0ff; }
.ad-dash span { position: relative; }

/* the mute button, top right */
.ad-tools { position: fixed; z-index: 50; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: flex; gap: 8px; }
.ad-mute { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.16); background: rgb(15 15 15 / 0.6); color: #fff; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ad-mute:hover { background: rgb(15 15 15 / 0.85); }
.ad-mute svg { display: block; width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-mute .ad-off { display: none; }
.ad-mute.ad-muted .ad-off { display: inline; }
.ad-mute.ad-muted .ad-on { display: none; }

@media (max-width: 600px) {
  .ad-scorebox { top: calc(56px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
  .ad-score { font-size: 22px; line-height: 26px; }
  .ad-top { top: calc(12px + env(safe-area-inset-top)); }
}
