/* Rooftop Run - title, HUD, hint, end panel and touch controls over the canvas (frame.css sets the page and the back link) */
html, body { touch-action: none; }
body { background: #e88f63; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; }

.rr-vignette { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgb(30 8 40 / 0) 55%, rgb(30 8 40 / 0.42) 100%); }
.rr-fade { position: fixed; inset: 0; z-index: 6; pointer-events: none; background: #f0a070; opacity: 0; transition: opacity 0.25s; }
.rr-fade.rr-on { opacity: 1; }

/* attract mode title */
.rr-title { position: fixed; left: 0; right: 0; top: 11%; z-index: 12; text-align: center; pointer-events: none; transition: opacity 0.35s, transform 0.35s; }
.rr-title.rr-hide { opacity: 0; transform: translateY(-14px); }
.rr-title h1 { margin: 0; font-size: clamp(44px, 9.5vw, 128px); line-height: 0.95; font-weight: 900; font-style: italic; letter-spacing: -0.03em; color: #fff7e6; text-shadow: 0 2px 0 rgb(120 30 60 / 0.55), 0 8px 36px rgb(70 10 60 / 0.55); }
.rr-title h1 span { color: #ffd23f; }
.rr-title .rr-tag { margin: 12px 0 0; font-size: clamp(13px, 1.5vw, 18px); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgb(255 247 230 / 0.92); text-shadow: 0 1px 10px rgb(70 10 60 / 0.7); }
.rr-start { position: fixed; left: 0; right: 0; bottom: calc(9% + env(safe-area-inset-bottom)); z-index: 12; text-align: center; pointer-events: none; transition: opacity 0.3s; }
.rr-start.rr-hide { opacity: 0; }
.rr-start span { display: inline-block; padding: 11px 22px; border-radius: 9999px; background: rgb(32 10 44 / 0.62); border: 1px solid rgb(255 255 255 / 0.22); font-size: clamp(13px, 1.5vw, 17px); font-weight: 600; color: #fff; animation: rr-pulse 1.8s ease-in-out infinite; }
@keyframes rr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }

/* HUD */
.rr-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.rr-hud.rr-show { opacity: 1; }
.rr-score { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(62px + env(safe-area-inset-right)); text-align: right; text-shadow: 0 1px 10px rgb(60 10 50 / 0.65); }
.rr-dist { font-size: 36px; line-height: 38px; font-weight: 800; font-style: italic; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rr-dist small { font-size: 16px; font-weight: 700; margin-left: 3px; opacity: 0.85; }
.rr-sub { margin-top: 2px; font-size: 12px; line-height: 16px; font-weight: 600; color: rgb(255 255 255 / 0.85); font-variant-numeric: tabular-nums; }
.rr-multbox { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rr-mult { padding: 2px 14px; border-radius: 9999px; background: rgb(32 10 44 / 0.55); font-size: 20px; line-height: 28px; font-weight: 800; font-style: italic; color: rgb(255 255 255 / 0.8); font-variant-numeric: tabular-nums; }
.rr-mult.rr-hot { background: #7ff6ff; color: #0b3140; }
.rr-mult.rr-pop { animation: rr-pop 0.35s ease-out; }
@keyframes rr-pop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
.rr-chain { width: 86px; height: 4px; border-radius: 2px; background: rgb(32 10 44 / 0.5); overflow: hidden; }
.rr-chain i { display: block; height: 100%; width: 0; background: #7ff6ff; transition: width 0.12s; }
.rr-toast { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font-size: clamp(20px, 3.4vw, 34px); font-weight: 900; font-style: italic; letter-spacing: 0.04em; color: #fff; text-shadow: 0 2px 0 rgb(120 30 60 / 0.6), 0 4px 22px rgb(70 10 60 / 0.6); opacity: 0; }
.rr-toast.rr-go { animation: rr-toast 0.95s ease-out; }
@keyframes rr-toast { 0% { opacity: 0; transform: translateY(14px) scale(0.8); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
.rr-hint { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 92vw; padding: 9px 18px; border-radius: 9999px; background: rgb(32 10 44 / 0.62); border: 1px solid rgb(255 255 255 / 0.18); font-size: 13px; line-height: 18px; font-weight: 600; text-align: center; white-space: nowrap; opacity: 0; transition: opacity 0.8s; }
.rr-hint.rr-show { opacity: 1; }
.rr-hint b { color: #ffd23f; font-weight: 700; }

.rr-mute { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 40; width: 36px; height: 36px; padding: 0; border-radius: 9999px; background: rgb(15 15 15 / 0.6); border: 1px solid rgb(255 255 255 / 0.16); color: #fff; font: 700 17px/1 Geist, system-ui, sans-serif; cursor: pointer; }
.rr-mute:hover { background: rgb(15 15 15 / 0.85); }
.rr-mute.rr-off { color: rgb(255 255 255 / 0.45); text-decoration: line-through; }

/* end panel */
.rr-panel { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; background: rgb(28 8 40 / 0.38); }
.rr-panel.rr-show { display: flex; }
.rr-card { width: min(88vw, 360px); padding: 26px 28px 24px; border-radius: 22px; background: rgb(30 12 44 / 0.86); border: 1px solid rgb(255 255 255 / 0.16); text-align: center; box-shadow: 0 20px 60px rgb(20 0 30 / 0.5); animation: rr-in 0.16s ease-out; }
@keyframes rr-in { 0% { transform: scale(0.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rr-card h2 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #ffb27d; }
.rr-big { margin-top: 8px; font-size: 62px; line-height: 64px; font-weight: 900; font-style: italic; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rr-big small { font-size: 24px; margin-left: 4px; }
.rr-newbest { display: none; margin: 8px auto 0; padding: 2px 12px; border-radius: 9999px; background: #ffd23f; color: #47210a; font-size: 12px; line-height: 20px; font-weight: 800; letter-spacing: 0.08em; }
.rr-newbest.rr-show { display: inline-block; }
.rr-rows { margin: 16px 0 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rr-rows div { padding: 8px 4px; border-radius: 12px; background: rgb(255 255 255 / 0.07); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 0.6); }
.rr-rows b { display: block; margin-top: 3px; font-size: 18px; line-height: 22px; letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; }
.rr-again { display: block; width: 100%; height: 50px; border: 0; border-radius: 9999px; background: #ffd23f; color: #3a1a08; font: 800 17px/1 Geist, system-ui, sans-serif; cursor: pointer; }
.rr-again:hover { background: #ffe07a; }
.rr-key { margin-top: 10px; font-size: 12px; line-height: 16px; color: rgb(255 255 255 / 0.55); }

/* touch controls: only on touch devices */
.rr-touch { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; display: none; justify-content: space-between; padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); pointer-events: none; }
.rr-touch.rr-show { display: flex; }
.rr-touch div { display: flex; gap: 12px; }
.rr-touch button { width: 62px; height: 62px; padding: 0; border-radius: 9999px; background: rgb(32 10 44 / 0.45); border: 1px solid rgb(255 255 255 / 0.28); color: #fff; font: 700 24px/1 Geist, system-ui, sans-serif; pointer-events: auto; touch-action: none; }
.rr-touch button:active { background: rgb(255 210 63 / 0.55); }
@media (pointer: coarse) { .rr-hint { bottom: calc(96px + env(safe-area-inset-bottom)); white-space: normal; } .rr-key { display: none; } }
