/* Starfall Sector: a WebGL canvas fills the stage; the HUD, banners and menus are HTML on top */
.sf { --a: #5ff3ff; --b: #ff5ad1; --g: #ffd34d; --sec: #ff7a4a; display: flex; flex-direction: column; color: #eaf6ff;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.sf-stage { position: relative; width: 100%; height: clamp(540px, calc(100vh - 150px), 980px); height: clamp(540px, calc(100dvh - 150px), 980px); overflow: hidden; border-radius: 10px; background: #03040a;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none; contain: layout paint; touch-action: none; }
@media (max-width: 640px) { .sf-stage { height: auto; aspect-ratio: 9 / 16.4; max-height: 90vh; min-height: 0; border-radius: 8px; } }
.stage.is-immersive .sf-stage { height: 100%; border-radius: 0; aspect-ratio: auto; max-height: none; }
#sf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sf [hidden] { display: none !important; }
.sf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sf kbd { display: inline-block; min-width: 1.5em; padding: 1px 6px; margin: 0 1px; border-radius: 6px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); font: inherit; font-size: 0.9em; text-align: center; }
.sf .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .sf .hint-kb { display: none; } .sf .hint-touch { display: inline; } }

/* ---------- HUD ---------- */
.sf-hud { position: absolute; inset: 0; pointer-events: none; }
.sf-hl, .sf-hr { position: absolute; top: max(8px, env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 3px; }
.sf-hl { left: var(--hl, 10px); align-items: flex-start; }
.sf-hr { right: var(--hr, 10px); align-items: flex-end; top: calc(max(8px, env(safe-area-inset-top, 0px)) + var(--hrtop, 44px)); }
.sf-score { display: flex; align-items: baseline; gap: 8px; }
#sf-score { font-size: clamp(20px, 4.6vmin, 30px); font-weight: 900; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 0 10px rgba(95,243,255,0.8), 0 0 24px rgba(95,243,255,0.35); }
.sf-mult { font-size: 14px; font-weight: 900; color: var(--g); text-shadow: 0 0 10px rgba(255,211,77,0.9); }
.sf-mult.is-pop { animation: sf-pop .25s ease-out; }
@keyframes sf-pop { 40% { transform: scale(1.35); } }
.sf-sub { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(220,240,255,0.72); display: flex; gap: 6px; }
.sf-sub i { font-style: normal; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.9); }
.sf-chain { width: 92px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.sf-chain i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g), #ff8a3a); box-shadow: 0 0 8px var(--g); }
.sf-icons { display: flex; gap: 10px; align-items: center; }
.sf-lives, .sf-bombs { display: flex; gap: 3px; align-items: center; }
.sf-lives i { width: 13px; height: 14px; background: linear-gradient(#e6f6ff, #5fbfe0); clip-path: polygon(50% 0, 64% 40%, 100% 78%, 100% 100%, 60% 86%, 50% 100%, 40% 86%, 0 100%, 0 78%, 36% 40%); filter: drop-shadow(0 0 4px rgba(95,243,255,0.9)); }
.sf-bombs i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #ffb36a 40%, #ff5a2a 80%); box-shadow: 0 0 8px rgba(255,122,61,0.9); }
.sf-pods { display: flex; gap: 5px; }
.sf-pod { width: 30px; height: 18px; border-radius: 6px; border: 1px dashed rgba(255,255,255,0.22); display: grid; place-items: center; font-size: 8px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.sf-pod.on { border: 1px solid var(--pc); color: #fff; background: color-mix(in srgb, var(--pc) 30%, rgba(5,8,20,0.6)); box-shadow: 0 0 10px color-mix(in srgb, var(--pc) 70%, transparent), inset 0 0 8px color-mix(in srgb, var(--pc) 40%, transparent); text-shadow: 0 0 6px var(--pc); }
.sf-pod.on.is-new { animation: sf-pop .35s ease-out; }
.sf-powers { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.sf-pw { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pc); text-shadow: 0 0 8px var(--pc); }
.sf-pw u { display: block; width: 46px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.12); text-decoration: none; overflow: hidden; }
.sf-pw u::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--pc); box-shadow: 0 0 6px var(--pc); }
.sf-btns { position: absolute; top: max(6px, env(safe-area-inset-top, 0px)); right: 8px; display: flex; gap: 6px; pointer-events: auto; }
.sf-ib { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; padding: 0; cursor: pointer; color: #dff4ff; background: rgba(8,12,28,0.55); border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sf-ib svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sf-ib[aria-pressed="true"] .on, .sf-ib[aria-pressed="false"] .off { display: none; }
.sf-ib:focus-visible, .sf-btn:focus-visible, .sf-modes button:focus-visible, .sf-diffs button:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.sf-boss { position: absolute; left: 50%; transform: translateX(-50%); top: calc(max(8px, env(safe-area-inset-top, 0px)) + var(--bosstop, 46px)); width: min(70%, 420px); text-align: center; }
.sf-bossname { display: flex; justify-content: center; align-items: baseline; gap: 8px; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: #ffd9c4; text-shadow: 0 0 10px rgba(255,90,60,0.8); }
.sf-bossname span { font-size: 9.5px; color: rgba(255,220,200,0.7); }
.sf-bossbar { margin-top: 4px; height: 6px; border-radius: 6px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,140,100,0.4); overflow: hidden; }
.sf-bossbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff3d6e, #ff9a3d, #ffe08a); box-shadow: 0 0 12px rgba(255,120,60,0.9); transition: width .15s; }
.sf-bomb { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: 62px; height: 62px; border-radius: 50%; padding: 0; display: grid; place-items: center; cursor: pointer;
  color: #ffe2cf; background: radial-gradient(circle at 40% 35%, rgba(255,140,80,0.4), rgba(40,10,20,0.6)); border: 1.5px solid rgba(255,150,100,0.7); box-shadow: 0 0 18px rgba(255,100,60,0.45); touch-action: none; }
.sf-bomb svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sf-bomb b { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #ff7a3d; color: #1a0800; font-size: 12px; display: grid; place-items: center; }
.sf-bomb.is-empty { opacity: 0.35; }

/* score popups */
.sf-pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sf-pp { position: absolute; transform: translate(-50%, -50%); font-size: 12px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; color: #fff; text-shadow: 0 0 8px var(--pc, #5ff3ff), 0 0 2px #000; animation: sf-rise .9s ease-out forwards; }
.sf-pp.big { font-size: 15px; }
.sf-pp.msg { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
@keyframes sf-rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

/* banners */
.sf-banner { position: absolute; left: 0; right: 0; top: 34%; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; opacity: 0; text-align: center; padding: 0 16px; }
.sf-banner.is-on { animation: sf-banner 2.4s ease-out forwards; }
.sf-banner.is-warn b { color: #ff6a5a; text-shadow: 0 0 16px rgba(255,60,60,0.95), 0 0 40px rgba(255,60,60,0.5); animation: sf-blink .35s steps(2) 6; }
.sf-banner small { font-size: 11px; font-weight: 900; letter-spacing: 0.4em; text-transform: uppercase; color: var(--a); text-shadow: 0 0 10px var(--a); }
.sf-banner b { font-size: clamp(24px, 7vmin, 44px); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px rgba(95,243,255,0.9), 0 0 36px rgba(255,90,209,0.45); }
.sf-banner span { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: rgba(230,240,255,0.8); }
@keyframes sf-banner { 0% { opacity: 0; transform: scale(1.25); letter-spacing: 0.3em; } 12% { opacity: 1; transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes sf-blink { 50% { opacity: 0.3; } }
.sf-tally { position: absolute; left: 50%; top: 46%; transform: translateX(-50%); min-width: 220px; padding: 10px 16px; border-radius: 14px; background: rgba(6,10,24,0.55); border: 1px solid rgba(95,243,255,0.25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; animation: sf-tally 3s ease-out forwards; pointer-events: none; }
.sf-tally div { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.sf-tally div b { font-variant-numeric: tabular-nums; color: var(--g); }
.sf-tally div:not(.sf-tk):not(.sf-perf) b { color: #fff; }
.sf-tally .sf-tt { margin-top: 3px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,0.12); color: rgba(220,240,255,0.7); }
.sf-sub2 { margin-top: 1px; color: rgba(220,240,255,0.55); }
.sf-sub2:empty { display: none; }
.sf-card { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); width: min(340px, calc(100% - 32px)); padding: 16px 18px 14px; border-radius: 16px; text-align: center; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,10,28,0.78), rgba(8,10,28,0.55)); border: 1px solid color-mix(in srgb, var(--sc, #5ff3ff) 50%, transparent); box-shadow: 0 0 40px color-mix(in srgb, var(--sc, #5ff3ff) 25%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; }
.sf-card.is-on { animation: sf-card 3.4s ease-out forwards; }
.sf-card small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: 0.42em; text-transform: uppercase; color: var(--sa, #46e0ff); text-shadow: 0 0 10px var(--sa, #46e0ff); }
.sf-card b { display: block; margin: 4px 0 6px; font-size: clamp(22px, 6.4vmin, 34px); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; text-shadow: 0 0 16px var(--sc, #ff7a4a); }
.sf-card p { margin: 0; font-size: 12px; line-height: 1.45; color: rgba(230,240,255,0.82); }
.sf-card .sf-new { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.12); text-align: left; display: grid; gap: 5px; }
.sf-card .sf-new > span { font-size: 9.5px; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(220,240,255,0.6); text-align: center; }
.sf-card .sf-new div { font-size: 11.5px; line-height: 1.35; color: rgba(230,240,255,0.78); }
.sf-card .sf-new i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--pc); box-shadow: 0 0 8px var(--pc); vertical-align: 1px; }
.sf-card .sf-new em { font-style: normal; font-weight: 900; color: var(--pc); }
.sf-card .sf-cfirst { margin-top: 10px; font-size: 11px; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255,255,255,0.9); }
@keyframes sf-card { 0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.96); } 10% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
.sf-tally .sf-perf { justify-content: center; color: var(--g); text-shadow: 0 0 10px var(--g); letter-spacing: 0.24em; }
@keyframes sf-tally { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- title ---------- */
.sf-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px 16px; text-align: center; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 38%, rgba(3,4,12,0.15), rgba(3,4,12,0.62) 75%); }
.sf-logo { display: flex; flex-direction: column; align-items: center; line-height: 0.92; margin-bottom: 2px; }
.sf-logo span { font-weight: 900; text-transform: uppercase; background: linear-gradient(180deg, #ffffff 0%, #bff8ff 35%, #5ff3ff 60%, #ff5ad1 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(95,243,255,0.55)) drop-shadow(0 0 32px rgba(255,90,209,0.35)); }
.sf-l1 { font-size: clamp(40px, 11vmin, 86px); letter-spacing: 0.08em; }
.sf-l2 { font-size: clamp(18px, 4.6vmin, 34px); letter-spacing: 0.62em; margin-right: -0.62em; margin-top: 6px; }
.sf-logo.is-in span { animation: sf-logo 1.2s cubic-bezier(.2,.8,.2,1) both; }
.sf-logo.is-in .sf-l2 { animation-delay: .18s; }
@keyframes sf-logo { 0% { opacity: 0; letter-spacing: 0.5em; filter: blur(8px); } 100% { opacity: 1; } }
.sf-tag { margin: 0; max-width: 420px; font-size: 13.5px; color: rgba(225,240,255,0.82); }
.sf-modes, .sf-diffs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(6,10,24,0.6); border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sf-modes button, .sf-diffs button { padding: 8px 14px; border-radius: 10px; border: 0; background: transparent; color: rgba(230,240,255,0.75); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.sf-diffs button { padding: 6px 10px; font-size: 12px; }
.sf-modes button[aria-selected="true"], .sf-diffs button[aria-pressed="true"] { color: #04121a; background: linear-gradient(180deg, #bff8ff, #5ff3ff); box-shadow: 0 0 16px rgba(95,243,255,0.5); }
.sf-diffs button[data-diff="nightmare"][aria-pressed="true"] { background: linear-gradient(180deg, #ffb0c8, #ff3d6e); box-shadow: 0 0 16px rgba(255,61,110,0.6); }
.sf-modeinfo { margin: 0; min-height: 2.6em; max-width: 440px; font-size: 12.5px; color: rgba(220,236,255,0.78); }
.sf-modeinfo b { color: #fff; }
.sf-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sf-btn { min-height: 44px; padding: 10px 20px; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; color: #eaf6ff; background: rgba(8,14,30,0.7); border: 1px solid rgba(255,255,255,0.16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sf-btn:hover { border-color: rgba(95,243,255,0.6); }
.sf-go { min-width: 180px; font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase; color: #04121a; background: linear-gradient(180deg, #e4fcff, #5ff3ff 60%, #2fb8d8); border: 0; box-shadow: 0 0 24px rgba(95,243,255,0.55), 0 8px 24px rgba(0,0,0,0.4); }
.sf-go:hover { filter: brightness(1.08); }
.sf-cont { border-color: rgba(255,211,77,0.5); color: #ffeab0; }
.sf-sm { min-height: 38px; padding: 7px 14px; font-size: 13px; }
.sf-best { margin: 0; font-size: 12px; font-weight: 700; color: rgba(220,236,255,0.7); }
.sf-best b { color: var(--g); font-variant-numeric: tabular-nums; }
.sf-keys { margin: 2px 0 0; font-size: 11.5px; color: rgba(220,236,255,0.6); }

/* ---------- panels ---------- */
.sf-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(2,3,10,0.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.sf-panel { position: relative; width: min(100%, 470px); max-height: 100%; overflow-y: auto; padding: 18px 18px 16px; border-radius: 18px; background: linear-gradient(160deg, rgba(14,22,46,0.94), rgba(6,9,22,0.94)); border: 1px solid rgba(95,243,255,0.22); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 40px rgba(95,243,255,0.08); }
.sf-panel h3 { margin: 2px 0 8px; font-size: 21px; font-weight: 900; letter-spacing: 0.02em; }
.sf-kicker { margin: 0; font-size: 10.5px; font-weight: 900; letter-spacing: 0.24em; text-transform: uppercase; color: var(--a); }
.sf-panel p { font-size: 13.5px; line-height: 1.5; color: rgba(225,238,255,0.86); }
.sf-close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,0.08); color: #fff; font-size: 20px; cursor: pointer; }
.sf-row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.sf-big { margin: 4px 0; font-size: 40px; font-weight: 900; letter-spacing: 0.02em; color: #fff; text-shadow: 0 0 18px rgba(95,243,255,0.7); font-variant-numeric: tabular-nums; }
.sf-new { color: var(--g); text-shadow: 0 0 12px rgba(255,211,77,0.8); }
.sf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.sf-grid div { padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,0.05); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(220,236,255,0.7); text-align: center; }
.sf-grid b { display: block; font-size: 17px; letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; text-transform: none; }
.sf-set { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; font-size: 13.5px; }
.sf-set input[type=range] { width: 100%; accent-color: #5ff3ff; }
.sf-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.sf-seg button { padding: 6px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: #eaf6ff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.sf-seg button[aria-pressed="true"] { background: #5ff3ff; color: #04121a; border-color: #5ff3ff; }
.sf-help h4 { margin: 14px 0 4px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a); }
.sf-help ul { margin: 4px 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: rgba(225,238,255,0.86); }
.sf-help p { margin: 4px 0; }
.sf-podlist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.sf-podlist div { padding: 6px 8px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent); background: color-mix(in srgb, var(--pc) 10%, transparent); font-size: 12px; }
.sf-podlist b { color: var(--pc); display: block; font-size: 12.5px; }
.sf-tour { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.sf-tour i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); opacity: 0.35; }
.sf-tour i.on { opacity: 1; box-shadow: 0 0 10px currentColor; }

/* loading, errors */
.sf-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #03040a; color: rgba(220,240,255,0.8); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; z-index: 8; transition: opacity .4s; }
.sf-loading.is-out { opacity: 0; pointer-events: none; }
.sf-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(95,243,255,0.2); border-top-color: #5ff3ff; animation: sf-spin .8s linear infinite; }
@keyframes sf-spin { to { transform: rotate(360deg); } }
.sf-nogl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: #03040a; z-index: 9; }
.sf-nogl p { max-width: 380px; font-size: 14px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .sf-banner.is-on, .sf-pp, .sf-logo.is-in span, .sf-tally { animation-duration: 0.01s !important; } .sf-card.is-on { animation: none; opacity: 1; } .sf-banner.is-on { animation: none; opacity: 1; } }
@media (max-height: 520px) { .sf-tag, .sf-keys { display: none; } .sf-title { gap: 8px; } .sf-l1 { font-size: 34px; } }
