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

.oc-s-on { color: #ffd66e; }
.oc-s-off { color: rgb(255 255 255 / 0.22); }

/* title over the attract mode */
.oc-title { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8vh 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(7 10 28 / 0.5), rgb(7 10 28 / 0) 30%, rgb(7 10 28 / 0) 76%, rgb(7 10 28 / 0.5)); }
.oc-title.oc-hide { opacity: 0; }
.oc-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 0 34px rgb(120 200 255 / 0.55), 0 4px 30px rgb(7 10 28 / 0.8); }
.oc-title-go { margin: 0; padding: 10px 22px; border-radius: 9999px; background: rgb(10 14 40 / 0.62); 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: oc-breathe 2.4s ease-in-out infinite; }
@keyframes oc-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* HUD */
.oc-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.oc-hud.oc-show { opacity: 1; }
.oc-level { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: baseline; gap: 10px; padding: 4px 14px; border-radius: 9999px; background: rgb(10 14 40 / 0.5); border: 1px solid rgb(255 255 255 / 0.1); white-space: nowrap; font-size: 13px; line-height: 20px; }
.oc-level-num { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; color: rgb(255 255 255 / 0.7); }
.oc-level-name { font-weight: 700; font-size: 15px; }
.oc-stars { letter-spacing: 0.08em; }

.oc-gauges { position: absolute; left: calc(16px + env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 6px rgb(7 10 28 / 0.9); }
.oc-gauge { display: flex; align-items: center; gap: 10px; height: 20px; }
.oc-gauge-label { width: 46px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(255 255 255 / 0.7); }
.oc-gauge-val { font-size: 16px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oc-bar { display: block; width: 132px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / 0.16); overflow: hidden; }
.oc-bar-fill { display: block; width: 100%; height: 100%; background: #8feaff; transform-origin: 0 50%; }
.oc-bar-fill.oc-low { background: #ffb36e; }

.oc-hint { position: absolute; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: 88vw; padding: 6px 14px; border-radius: 12px; background: rgb(10 14 40 / 0.55); text-align: center; font-size: 13px; line-height: 20px; font-weight: 500; color: rgb(255 255 255 / 0.92); opacity: 0; transition: opacity 0.8s; }
.oc-hint.oc-show { opacity: 1; }
.oc-toast { position: absolute; left: 50%; top: 20%; transform: translate(-50%, 8px); padding: 4px 14px; border-radius: 9999px; background: rgb(10 14 40 / 0.6); font-size: 15px; line-height: 24px; font-weight: 700; color: #ffe39a; white-space: nowrap; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.oc-toast.oc-show { opacity: 1; transform: translate(-50%, 0); }
.oc-toast.oc-bad { color: #ffb4a8; }

/* small round buttons, top right: mute (and restart, next on touch) */
.oc-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; }
.oc-tool { 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; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.oc-tool:hover { background: rgb(15 15 15 / 0.85); }
.oc-tool:disabled { opacity: 0.35; cursor: default; }
.oc-tool:not(.oc-mute) { display: none; }
.oc-tools.oc-play .oc-tool { display: block; }
.oc-tool svg { display: block; width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.oc-mute .oc-off { display: none; }
.oc-mute.oc-muted .oc-off { display: inline; }
.oc-mute.oc-muted .oc-on { display: none; }

/* thruster buttons (made on touch devices only) */
.oc-pad { position: fixed; z-index: 11; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); width: 150px; height: 150px; display: none; pointer-events: none; }
.oc-pad.oc-show { display: block; }
.oc-paneled .oc-pad { display: none; }
.oc-thr { position: absolute; pointer-events: auto; width: 48px; height: 48px; padding: 0; border-radius: 14px; border: 1px solid rgb(255 255 255 / 0.28); background: rgb(10 14 40 / 0.5); color: rgb(255 255 255 / 0.9); font: inherit; font-size: 15px; touch-action: none; }
.oc-thr.oc-held { background: #8feaff; color: #06203a; }
.oc-thr-up { left: 51px; top: 0; }
.oc-thr-down { left: 51px; bottom: 0; }
.oc-thr-left { left: 0; top: 51px; }
.oc-thr-right { right: 0; top: 51px; }

/* the result of one delivery: low on the screen, so the orbit that was flown stays in view */
.oc-result { position: fixed; z-index: 14; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); width: min(380px, calc(100vw - 32px)); box-sizing: border-box; padding: 18px 22px 16px; border-radius: 20px; background: rgb(12 16 44 / 0.84); 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.35s, transform 0.35s, visibility 0.35s; cursor: default; }
.oc-result.oc-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.oc-result:not(.oc-show), .oc-over:not(.oc-show) { pointer-events: none; }   /* a panel that is fading out lets the next drag through */
.oc-result p, .oc-card p { margin: 0; }
.oc-res-head, .oc-over-head { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8feaff; }
.oc-res-stars { font-size: 40px; line-height: 48px; letter-spacing: 0.1em; }
.oc-res-rows { margin: 6px 0 14px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 22px; text-align: left; }
.oc-res-row { display: flex; gap: 8px; }
.oc-res-label { width: 76px; font-weight: 600; }
.oc-res-val { color: rgb(255 255 255 / 0.72); }
.oc-res-btns { display: flex; justify-content: center; gap: 10px; }
.oc-res-keys { margin-top: 10px !important; font-size: 12px; line-height: 16px; color: rgb(255 255 255 / 0.5); }
.oc-res-keys:empty { display: none; }

.oc-btn { height: 44px; padding: 0 26px; border: 0; border-radius: 9999px; background: #ffd66e; color: #2a1a02; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.oc-btn:hover { background: #ffe39a; transform: translateY(-1px); }
.oc-btn:active { transform: scale(0.97); }
.oc-btn-quiet { background: rgb(255 255 255 / 0.12); color: #fff; }
.oc-btn-quiet:hover { background: rgb(255 255 255 / 0.2); }
.oc-btn:focus-visible, .oc-tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* the end of the round */
.oc-over { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(7 10 28 / 0.5); opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s; cursor: default; }
.oc-over.oc-show { opacity: 1; visibility: visible; }
.oc-card { width: min(420px, 100%); box-sizing: border-box; padding: 28px 28px 30px; border-radius: 20px; background: rgb(12 16 44 / 0.86); 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; }
.oc-over.oc-show .oc-card { transform: none; }
.oc-over-score { margin-top: 8px !important; font-size: 44px; line-height: 52px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.oc-over-last { margin-top: 2px !important; font-size: 14px; line-height: 20px; color: rgb(255 255 255 / 0.7); }
.oc-over-grid { margin: 16px 0 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 4px; font-size: 13px; line-height: 16px; }
.oc-over-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.oc-over-n { font-size: 11px; font-weight: 700; color: rgb(255 255 255 / 0.55); }

@media (max-width: 640px) {
  .oc-level { top: calc(58px + env(safe-area-inset-top)); }
  .oc-hint { bottom: calc(176px + env(safe-area-inset-bottom)); }
  .oc-bar { width: 96px; }
  .oc-toast { top: 26%; }
}
