/* Orbit Pinball (web). Colours follow the iOS app's OrbitTheme. */
:root {
  --bg: #08101b; --panel: #111c2b; --mint: #8bf3ce; --orange: #ffad67; --muted: #7d99b0;
  --lcd: #03050b; --amber: #ffcc4a; --cyan: #78dbff; --ink: #e6f5fa;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { -webkit-touch-callout: none; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono, .score, .label, .balls, .rank, .info, .mission, .caps, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

#app {
  height: 100%; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 7px;
  padding: max(6px, env(safe-area-inset-top)) 14px max(4px, env(safe-area-inset-bottom));
  width: 100%; max-width: min(780px, max(560px, 60dvh));
}
.top { display: flex; align-items: center; justify-content: space-between; height: 36px; flex: none; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo .spark { font-size: 24px; color: var(--mint); transform: rotate(-15deg); }
.logo b { display: block; font: 900 16px/1.1 ui-rounded, -apple-system, sans-serif; letter-spacing: 2.5px; }
.logo small { display: block; font: 600 8px/1.3 ui-monospace, monospace; letter-spacing: 1.8px; color: var(--muted); }
.icons { display: flex; }
.icons button { width: 38px; height: 36px; color: var(--muted); font-size: 15px; font-weight: 700; }
.icons button:hover { color: var(--ink); }

.lcd { background: var(--lcd); border: 1.5px solid #3a3f46; border-top-color: #8c9096; border-radius: 14px; box-shadow: 0 2px 4px rgba(0,0,0,.6); flex: none; }
.score-panel { display: flex; justify-content: space-between; align-items: center; padding: 7px 13px; gap: 12px; }
.label { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.label i { width: 4px; height: 4px; border-radius: 50%; background: var(--mint); }
.label em { font-style: normal; color: var(--orange); }
.score { font-size: clamp(26px, 7.5vw, 36px); font-weight: 700; color: var(--amber); text-shadow: 0 0 6px rgba(255, 204, 74, .55); letter-spacing: -1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-right { text-align: right; display: grid; gap: 4px; }
.balls { display: flex; align-items: center; gap: 5px; justify-content: flex-end; font-size: 9px; color: var(--muted); font-weight: 700; }
.balls b { color: var(--ink); font-size: 12px; } .balls em { color: var(--mint); font-style: normal; font-size: 11px; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.12); } .dots i.on { background: var(--orange); }
.rank { font-size: 9px; font-weight: 600; color: var(--mint); letter-spacing: .7px; }
.best span { display: block; font-size: 10px; font-weight: 600; color: var(--orange); }
.best b { font: 600 18px/1.1 ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.mission-panel { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; min-height: 46px; border-radius: 10px; }
.mission-panel .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--muted); }
.mission-panel .bar.active { background: var(--orange); }
.mission-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.info-row { display: flex; align-items: center; gap: 8px; }
.info { flex: 1; min-width: 0; font-size: 11px; font-weight: 700; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info.idle { color: rgba(120, 219, 255, .75); } .info.active { color: var(--orange); }
.mission { font-size: 10px; font-weight: 500; color: var(--cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fuel { display: flex; align-items: center; gap: 4px; flex: none; }
.fuel small { font: 700 7px ui-monospace, monospace; color: var(--muted); }
#fuel { display: inline-flex; gap: 2px; } #fuel i { width: 3px; height: 8px; border-radius: 1px; background: rgba(255,255,255,.09); }
#fuel i.on { background: var(--mint); } #fuel.low i.on { background: var(--orange); }
.nudge { width: 34px; height: 38px; color: var(--muted); font-size: 18px; flex: none; }
.nudge:disabled { opacity: .35; }

.stage { position: relative; flex: 1; min-height: 0; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,.07); background: #060912; }
#table { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 9px 14px; border-radius: 999px; background: rgba(8,16,27,.94); color: var(--mint); font-size: 11px; font-weight: 500; white-space: nowrap; pointer-events: none; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 20px; gap: 14px; text-align: center; }
.overlay.center { justify-content: center; } .overlay.bottom { justify-content: flex-end; pointer-events: none; }
.overlay.dim { background: rgba(8, 16, 27, .87); }
.overlay h2 { margin: 0; font: 600 22px/1.4 ui-rounded, -apple-system, sans-serif; }
.overlay .row { display: flex; gap: 26px; } .caps { font-size: 11px; font-weight: 700; letter-spacing: 3px; }
.hidden { display: none !important; }
.card { background: rgba(8,16,27,.95); border-radius: 16px; padding: 18px 22px; display: grid; gap: 7px; justify-items: center; margin-bottom: 40px; }
.card small { font: 700 11px ui-monospace, monospace; letter-spacing: 3px; color: var(--mint); }
.card b { font: 500 26px ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.card p { margin: 0; font-size: 11px; color: var(--muted); }
.card.go { border: 1px solid rgba(255,173,103,.4); } .card.go strong { font: 900 23px ui-rounded, sans-serif; letter-spacing: 3px; color: var(--orange); }
.meter { width: 160px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; } .meter i { display: block; height: 100%; width: 0; background: var(--mint); }
.mint { color: var(--mint) !important; }
.primary { background: var(--mint); color: var(--bg); font-weight: 700; font-size: 14px; padding: 14px 28px; border-radius: 999px; }
.primary.danger { background: #ff7b6b; }
.link { color: var(--muted); font-size: 13px; font-weight: 500; }
.keys { font-size: 12px; color: var(--muted); line-height: 2; max-width: 30em; margin: 0; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; margin: 0 2px; border: 1px solid #3c4a5c; border-bottom-width: 2px; border-radius: 5px; font-size: 11px; color: var(--ink); background: #0f1a28; }
.note { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.7; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(139,243,206,.2); border-top-color: var(--mint); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; gap: 10px; height: clamp(62px, 9dvh, 84px); flex: none; }
.pad { -webkit-touch-callout: none; position: relative; border-radius: 21px; touch-action: none; transition: transform .07s ease-out; box-shadow: 0 4px 0 #050b12; }
.pad.flipper { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 14px;
  background: linear-gradient(135deg, #77838f, #283947 45%, #070f18); }
.pad.flipper::before { content: ""; position: absolute; inset: 3px; border-radius: 18px; background: linear-gradient(135deg, #1d3545, #0a1621); }
.pad.flipper::after { content: ""; position: absolute; inset: 7px; border-radius: 15px; border: 1px solid rgba(139,243,206,.3); }
.pad > * { position: relative; z-index: 1; }
.pad .emblem { width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.4); border: 1px solid rgba(139,243,206,.35); display: grid; place-items: center; color: var(--mint); font-size: 21px; }
.pad .txt { display: grid; gap: 2px; } .pad.right .txt { text-align: right; }
.pad .txt b { font: 800 11px ui-monospace, monospace; letter-spacing: 1.7px; color: rgba(255,255,255,.92); }
.pad .txt small { font: 700 8px ui-monospace, monospace; letter-spacing: 1px; color: rgba(139,243,206,.75); }
.pad.restart .txt small { color: var(--orange); }
.pad.down { transform: translateY(2px) scale(.98); box-shadow: 0 2px 0 #050b12; }
.pad.flipper.down::before { background: linear-gradient(135deg, #153e43, #0b222e); }
.pad.flipper.down::after { border-color: var(--mint); box-shadow: 0 0 10px rgba(139,243,206,.6); }
.pad.launch { width: 78px; flex: none; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 18px;
  background: linear-gradient(135deg, #6b645b, #242a31 50%, #090e15); }
.pad.launch::before { content: ""; position: absolute; inset: 3px; border-radius: 14px; background: #111e2a; border: 1px solid rgba(255,173,103,.12); }
.pad.launch.ready::before { border-color: rgba(255,173,103,.65); }
.dial { position: relative; width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); font-size: 21px; font-weight: 700; }
.pad.launch.ready .dial, .pad.launch.ready small { color: var(--orange); }
.dial svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.dial .track { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 2; }
.dial .charge { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 106.8; stroke-dashoffset: 106.8; }
.pad.launch small { font: 800 8px ui-monospace, monospace; letter-spacing: 1px; color: var(--muted); }
.footnote { margin: 0; text-align: center; font-size: 10px; color: rgba(125,153,176,.6); flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

dialog.sheet { border: 0; padding: 0; background: #0b1420; color: var(--ink); border-radius: 18px; width: min(640px, 94vw); max-height: 88dvh; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog.sheet.small { width: min(460px, 94vw); } dialog.sheet.tiny { width: min(360px, 90vw); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog.sheet > header { position: sticky; top: 0; display: flex; justify-content: center; align-items: center; padding: 14px; background: rgba(11,20,32,.96); border-bottom: 1px solid rgba(255,255,255,.06); z-index: 1; }
dialog.sheet > header h2 { margin: 0; font-size: 16px; }
dialog.sheet .close { position: absolute; right: 12px; color: var(--mint); font-weight: 600; padding: 6px 12px; border: 1px solid rgba(139,243,206,.3); border-radius: 999px; }
.sheet-body { padding: 18px 22px 26px; overflow-y: auto; -webkit-user-select: text; user-select: text; }
dialog.sheet { overflow: auto; }
.sheet-body.center { text-align: center; display: grid; gap: 18px; } .sheet-body .row { display: flex; justify-content: center; gap: 18px; align-items: center; }
.sheet-body h3 { font-size: 13px; color: var(--muted); margin: 18px 0 8px; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--panel); border-radius: 10px; margin-bottom: 6px; font-size: 14px; cursor: pointer; }
.toggle input { width: 44px; height: 24px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: #3a4655; position: relative; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked { background: var(--mint); } .toggle input:checked::after { transform: translateX(20px); }
.links { display: flex; gap: 16px; font-size: 13px; } .links a { color: var(--mint); }

/* Guide */
.guide-hero small { font: 700 10px ui-monospace, monospace; letter-spacing: 3px; color: var(--mint); }
.guide-hero h2 { font: 700 26px/1.35 ui-rounded, -apple-system, sans-serif; margin: 6px 0; }
.guide-section { margin-top: 28px; } .guide-section > h3 { font-size: 18px; color: var(--ink); margin: 0 0 14px; }
.g-row { display: flex; gap: 12px; margin-bottom: 14px; } .g-row .mark { min-width: 58px; font: 700 11px ui-monospace, monospace; color: var(--orange); padding-top: 3px; }
.g-row b, .g-bullet b { display: block; font-size: 15px; margin-bottom: 3px; } .g-bullet b { color: var(--mint); font-size: 14px; }
.g-row p, .g-bullet p, .guide-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.g-bullet { margin-bottom: 13px; }
.g-table { background: var(--panel); border-radius: 14px; padding: 14px 16px; display: grid; gap: 9px; font-size: 12px; }
.g-table div { display: flex; justify-content: space-between; gap: 12px; } .g-table span:last-child { color: var(--mint); text-align: right; font-family: ui-monospace, monospace; }
.g-tier { background: var(--panel); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: grid; gap: 11px; }
.g-tier > small { font: 700 11px ui-monospace, monospace; color: var(--orange); letter-spacing: 1px; }
.g-mission .head { display: flex; align-items: baseline; gap: 8px; } .g-mission .tag { font: 700 10px ui-monospace, monospace; color: var(--bg); background: var(--cyan); padding: 1px 5px; border-radius: 4px; }
.g-mission .head b { font-size: 14px; flex: 1; } .g-mission .head span { font: 11px ui-monospace, monospace; color: var(--mint); }
.g-mission p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
@media (max-height: 700px) { #app { gap: 5px; } .score { font-size: 26px; } .best b { font-size: 15px; } }
@media (hover: hover) and (pointer: fine) { .pad:hover::after { border-color: rgba(139,243,206,.55); } }

.icons button svg { display: block; margin: auto; }
@media (hover: none), (pointer: coarse) { .keys, .pc { display: none; } }
.pad * { pointer-events: none; }
