/* Canyon Glider - HUD, title and end card over the canvas (frame.css sets the page and the back link) */
html, body { touch-action: none; }
body { background: #f3c796; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: crosshair; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; }

.cg-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.cg-hud.cg-show { opacity: 1; }

.cg-scorebox { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(64px + env(safe-area-inset-right)); text-align: right; text-shadow: 0 1px 10px rgb(60 20 0 / 0.55); }
.cg-score { font-size: 34px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cg-sub { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cg-mult { display: inline-block; padding: 0 8px; border-radius: 9999px; background: rgb(40 16 4 / 0.45); color: rgb(255 255 255 / 0.75); text-shadow: none; transform-origin: 100% 50%; }
.cg-mult.cg-hot { background: #ffd66e; color: #4a2203; }
.cg-mult.cg-pop { animation: cg-pop 0.35s ease-out; }
.cg-dist { color: rgb(255 255 255 / 0.85); }
@keyframes cg-pop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }

.cg-burst { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(255 255 255 / 0.7); text-shadow: 0 1px 6px rgb(60 20 0 / 0.6); transition: color 0.2s; }
.cg-burst-bar { width: 132px; height: 6px; border-radius: 3px; background: rgb(40 16 4 / 0.45); overflow: hidden; }
.cg-burst-fill { display: block; width: 100%; height: 100%; background: rgb(255 255 255 / 0.65); transform-origin: 0 50%; }
.cg-burst.cg-ready { color: #fff; }
.cg-burst.cg-ready .cg-burst-fill { background: #ffd66e; }
.cg-burst.cg-firing .cg-burst-fill { background: #fff; }

.cg-toast { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 8px); padding: 4px 14px; border-radius: 9999px; background: rgb(40 16 4 / 0.5); font-size: 15px; line-height: 24px; font-weight: 700; color: #ffe39a; white-space: nowrap; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.cg-toast.cg-show { opacity: 1; transform: translate(-50%, 0); }
.cg-toast.cg-bad { color: #ffc0a8; }

.cg-hint { position: absolute; left: 50%; bottom: calc(56px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 88vw; text-align: center; font-size: 13px; line-height: 20px; font-weight: 500; color: rgb(255 255 255 / 0.9); text-shadow: 0 1px 8px rgb(60 20 0 / 0.7); opacity: 0; transition: opacity 0.6s; }
.cg-hint.cg-show { opacity: 1; }

.cg-title { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 9vh 20px calc(7vh + env(safe-area-inset-bottom)); box-sizing: border-box; text-align: center; pointer-events: none; transition: opacity 0.35s; background: linear-gradient(rgb(20 30 80 / 0.28), rgb(20 30 80 / 0) 34%, rgb(60 20 0 / 0) 70%, rgb(60 20 0 / 0.35)); }
.cg-title.cg-hide { opacity: 0; }
.cg-title-name { margin: 0; font-size: clamp(40px, 9vw, 104px); line-height: 1; font-weight: 800; letter-spacing: -0.035em; color: #fff; text-shadow: 0 2px 0 rgb(120 50 10 / 0.35), 0 8px 40px rgb(30 20 60 / 0.45); }
.cg-title-day { margin: 12px 0 auto; font-size: 13px; line-height: 20px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(255 255 255 / 0.85); text-shadow: 0 1px 8px rgb(30 20 60 / 0.6); }
.cg-title-go { margin: 0; padding: 10px 22px; border-radius: 9999px; background: rgb(40 16 4 / 0.5); 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: cg-breathe 2.4s ease-in-out infinite; }
@keyframes cg-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.cg-over { position: fixed; inset: 0; z-index: 14; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(30 12 4 / 0.36); opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s; cursor: default; }
.cg-over.cg-show { opacity: 1; visibility: visible; }
.cg-card { min-width: min(300px, 80vw); padding: 28px 32px 30px; border-radius: 20px; background: rgb(28 14 8 / 0.78); border: 1px solid rgb(255 255 255 / 0.14); text-align: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transform: translateY(12px); transition: transform 0.4s; }
.cg-over.cg-show .cg-card { transform: none; }
.cg-card p { margin: 0; }
.cg-over-head { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #ffd66e; }
.cg-over-score { margin-top: 8px !important; font-size: 60px; line-height: 64px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cg-over-stats { margin-top: 4px !important; font-size: 14px; line-height: 20px; color: rgb(255 255 255 / 0.7); }
.cg-over-best { margin-top: 12px !important; font-size: 16px; line-height: 24px; font-weight: 600; color: #fff; }
.cg-btn { margin-top: 22px; height: 48px; padding: 0 30px; border: 0; border-radius: 9999px; background: #ffd66e; color: #3d1c02; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.cg-btn:hover { background: #ffe39a; transform: translateY(-1px); }
.cg-btn:active { transform: scale(0.97); }
.cg-btn:focus-visible, .cg-mute:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cg-mute { position: fixed; z-index: 50; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); 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); }
.cg-mute:hover { background: rgb(15 15 15 / 0.85); }
.cg-mute svg { display: block; width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cg-mute .cg-off { display: none; }
.cg-mute.cg-muted .cg-off { display: inline; }
.cg-mute.cg-muted .cg-on { display: none; }

.cg-stick { position: fixed; z-index: 11; left: -64px; top: -64px; width: 128px; height: 128px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.35); background: rgb(255 255 255 / 0.06); box-sizing: border-box; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.cg-stick.cg-show { opacity: 1; }
.cg-knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgb(255 255 255 / 0.55); }

.cg-fade { position: fixed; inset: 0; z-index: 13; background: #f3c796; opacity: 0; pointer-events: none; }
.cg-fade.cg-run { animation: cg-fade 0.6s ease-out; }
@keyframes cg-fade { 0% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 520px) {
  .cg-score { font-size: 26px; line-height: 30px; }
  .cg-scorebox { right: calc(58px + env(safe-area-inset-right)); }
}
