:root {
  color-scheme: dark;
  --bg: #090a0e;
  --surface: #11141b;
  --surface-2: #171b24;
  --line: rgba(255,255,255,.10);
  --text: #f6f7fb;
  --muted: #9298a7;
  --red: #f23838;
  --red-dark: #981b26;
  --yellow: #ffd43b;
  --blue: #39a8ff;
  --green: #41df8d;
  --shadow: 0 18px 50px rgba(0,0,0,.42);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --banner-slot-height: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; width: 100%; min-height: 100%; min-height: 100dvh; background: #050608; color: var(--text); overscroll-behavior: none; }
body { display: flex; justify-content: center; }
button, input { font: inherit; }
button { min-height: 44px; color: inherit; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.hidden { display: none !important; }
.app-shell {
  position: relative; width: 100%; max-width: 540px; min-height: 100dvh; overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(242,56,56,.18), transparent 38%),
    linear-gradient(180deg, #0d0f15 0%, #08090d 55%, #0c0e14 100%);
  box-shadow: 0 0 80px rgba(0,0,0,.65);
}
.ambient { position: fixed; width: 280px; height: 280px; border-radius: 50%; filter: blur(90px); opacity: .12; pointer-events: none; }
.ambient-a { background: var(--red); top: -110px; right: -120px; }
.ambient-b { background: var(--blue); bottom: 60px; left: -170px; }
.scanlines { position: fixed; inset: 0; max-width: 540px; margin: auto; opacity: .025; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, #fff 4px); z-index: 80; }
.topbar {
  position: sticky; top: 0; z-index: 60; height: calc(58px + var(--safe-top)); padding: var(--safe-top) 18px 0;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(9,10,14,.98), rgba(9,10,14,.80)); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.icon-button { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 22px; }
.brand-mini { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; letter-spacing: .04em; }
.warning-mark { width: 24px; height: 24px; border-radius: 7px 7px 10px 10px; display: grid; place-items: center; color: #08090c; background: var(--yellow); font-weight: 1000; transform: rotate(2deg); }
.currency-pill { min-width: 72px; padding: 8px 11px; border: 1px solid rgba(255,212,59,.25); background: rgba(255,212,59,.08); border-radius: 99px; display: flex; align-items: center; justify-content: center; gap: 7px; font-weight: 900; font-variant-numeric: tabular-nums; }
.coin-dot { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff5a2, var(--yellow) 35%, #c88900 80%); box-shadow: 0 0 0 2px rgba(255,212,59,.16); flex: 0 0 auto; }
.coin-dot.large { width: 24px; height: 24px; }
#screen-stack { position: relative; z-index: 2; }
.screen { position: relative; isolation: isolate; display: none; min-height: calc(100dvh - 58px - var(--safe-top)); padding: 24px 18px calc(104px + var(--safe-bottom)); animation: screenIn .25s ease both; background-repeat: no-repeat; background-position: center top; background-size: cover; }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Screen-specific illustrated backgrounds */
#screen-home {
  background-image:
    linear-gradient(180deg, rgba(6,7,11,.10) 0%, rgba(5,7,11,.20) 46%, rgba(4,6,10,.58) 100%),
    url('assets/backgrounds/home-command-deck-v2.png');
}
#screen-result {
  background-image:
    linear-gradient(180deg, rgba(4,6,10,.06) 0%, rgba(4,7,12,.20) 48%, rgba(3,5,9,.70) 100%),
    url('assets/backgrounds/result-victory-bay.webp');
}
#screen-home::after,
#screen-result::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.26), transparent 19% 81%, rgba(0,0,0,.26));
}
.home-hero { padding: 22px 4px 16px; text-align: center; }
.eyebrow, .page-title > span, .section-heading span { color: var(--yellow); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.home-hero h1 { margin: 7px 0 8px; line-height: .96; }
.home-hero h1 span { display: block; font-size: clamp(38px, 10vw, 54px); font-style: italic; font-weight: 1000; letter-spacing: -.07em; text-shadow: 0 4px 0 rgba(0,0,0,.62), 0 5px 24px rgba(242,56,56,.46); }
.home-hero h1 strong { display: block; margin-top: 7px; color: var(--red); font-size: clamp(42px, 11vw, 61px); font-style: italic; font-weight: 1000; letter-spacing: -.08em; text-shadow: 0 6px 0 rgba(62,4,12,.94), 0 12px 32px rgba(242,56,56,.42); }
.home-hero p { color: #b8bdca; margin: 13px 0 0; font-size: 14px; }
.profile-strip { display: grid; grid-template-columns: 1.35fr .8fr .8fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); background: var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.profile-strip > div { min-width: 0; padding: 13px 12px; background: rgba(13,16,23,.80); backdrop-filter: blur(8px); }
.profile-strip .label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.profile-strip strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-variant-numeric: tabular-nums; }
.profile-metric { text-align: center; }
.primary-launch {
  position: relative; isolation: isolate; width: 100%; margin: 17px 0 24px; padding: 24px 22px 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 24px;
  background: linear-gradient(145deg, #ff4747 0%, #d31325 48%, #880d1c 100%); box-shadow: 0 10px 0 #5c0712, 0 22px 36px rgba(242,56,56,.25); text-align: left;
}
.primary-launch:active { transform: translateY(6px); box-shadow: 0 4px 0 #5c0712, 0 12px 22px rgba(242,56,56,.22); }
.launch-glow { position: absolute; inset: -100% -30%; z-index: -1; background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.28) 50%, transparent 62%); transform: translateX(-45%); animation: launchSweep 3.3s ease-in-out infinite; }
@keyframes launchSweep { 0%,45% { transform: translateX(-45%); } 75%,100% { transform: translateX(45%); } }
.launch-top { display: block; margin-bottom: 2px; color: rgba(255,255,255,.7); font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.primary-launch strong { display: block; font-size: 33px; font-weight: 1000; letter-spacing: -.04em; }
.primary-launch small { display: block; margin-top: 4px; color: rgba(255,255,255,.8); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 3px 11px; }
.section-heading h2, .page-title h2 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.04em; }
.text-button { padding: 9px 12px; color: var(--blue); background: rgba(57,168,255,.08); border-radius: 10px; font-size: 12px; font-weight: 800; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { min-height: 83px; padding: 13px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(25,30,41,.86), rgba(10,13,19,.84)); backdrop-filter: blur(8px); box-shadow: 0 10px 20px rgba(0,0,0,.2); }
.mode-card:active { transform: scale(.98); }
.mode-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(242,56,56,.12); border: 1px solid rgba(242,56,56,.25); color: #ff6a70; font-size: 19px; font-weight: 1000; }
.mode-card:nth-child(2) .mode-icon { color: var(--blue); background: rgba(57,168,255,.1); border-color: rgba(57,168,255,.25); }
.mode-card:nth-child(3) .mode-icon { color: var(--yellow); background: rgba(255,212,59,.1); border-color: rgba(255,212,59,.25); }
.mode-card:nth-child(4) .mode-icon { color: var(--green); background: rgba(65,223,141,.1); border-color: rgba(65,223,141,.25); }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 14px; margin-bottom: 4px; }
.mode-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.daily-banner { margin-top: 12px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(65,223,141,.18); border-radius: 18px; background: radial-gradient(circle at 100% 0%, rgba(65,223,141,.18), transparent 45%), rgba(8,14,19,.82); backdrop-filter: blur(8px); }
.daily-copy .tag { display: inline-block; color: #07110c; background: var(--green); padding: 3px 7px; border-radius: 99px; font-size: 9px; font-weight: 1000; letter-spacing: .1em; }
.daily-copy strong, .daily-copy small { display: block; }
.daily-copy strong { margin-top: 7px; font-size: 14px; }
.daily-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.compact-button { padding: 10px 18px; border-radius: 12px; background: var(--green); color: #08130d; font-weight: 1000; }
.bottom-nav { position: fixed; z-index: 70; left: 50%; bottom: 0; width: min(540px,100%); transform: translateX(-50%); height: calc(76px + var(--safe-bottom)); padding: 7px 9px var(--safe-bottom); display: grid; grid-template-columns: repeat(5,1fr); border-top: 1px solid var(--line); background: rgba(8,9,13,.94); backdrop-filter: blur(18px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 13px; background: transparent; color: #6f7583; }
.bottom-nav button span { font-size: 20px; line-height: 1; }
.bottom-nav button small { font-size: 9px; font-weight: 800; }
.bottom-nav button.active { color: var(--yellow); background: rgba(255,212,59,.06); }
.page-title { padding: 8px 2px 18px; }
.page-title h2 { font-size: 30px; }
.page-title p { color: var(--muted); margin: 7px 0 0; font-size: 13px; line-height: 1.6; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.segmented button { min-width: 0; padding: 10px 6px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; }
.segmented button.active { background: #eceef4; color: #11131a; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.mode-tabs { margin-bottom: 16px; }
.ranking-list { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(20,23,31,.86); }
.rank-row.self { border-color: rgba(255,212,59,.45); background: rgba(255,212,59,.06); }
.rank-position { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.06); font-weight: 1000; }
.rank-row:nth-child(1) .rank-position { color: #201400; background: linear-gradient(145deg,#fff2a0,#e4a900); }
.rank-row:nth-child(2) .rank-position { color: #17181b; background: linear-gradient(145deg,#fff,#9ea5b2); }
.rank-row:nth-child(3) .rank-position { color: #22130c; background: linear-gradient(145deg,#ffd0a5,#b96a31); }
.rank-name strong, .rank-name small { display: block; }
.rank-name strong { font-size: 13px; }
.rank-name small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.rank-score { text-align: right; font-weight: 1000; font-variant-numeric: tabular-nums; }
.empty-state { padding: 42px 20px; border: 1px dashed rgba(255,255,255,.14); border-radius: 18px; text-align: center; color: var(--muted); line-height: 1.8; }
.collection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.collection-card { position: relative; min-height: 172px; padding: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg,#171b24,#0e1016); text-align: left; }
.collection-card.active { border-color: rgba(255,212,59,.55); box-shadow: inset 0 0 0 1px rgba(255,212,59,.18); }
.collection-preview { height: 82px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.035); overflow: hidden; }
.mini-button { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #ff7a78, #df1827 48%, #610510 76%); box-shadow: 0 7px 0 #43030b, 0 11px 20px rgba(242,56,56,.25); border: 5px solid #3c3e46; }
.collection-card h3 { margin: 11px 0 3px; font-size: 14px; }
.collection-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.collection-cost { position: absolute; right: 10px; top: 10px; padding: 5px 8px; border-radius: 99px; background: rgba(0,0,0,.55); color: var(--yellow); font-size: 10px; font-weight: 900; }
.collection-state { display: inline-block; margin-top: 8px; color: var(--green); font-size: 10px; font-weight: 900; }
.bg-preview { width: 100%; height: 100%; background: radial-gradient(circle at 50% 30%, rgba(242,56,56,.3), transparent 45%), #090a0e; }
.title-preview { width: 100%; text-align: center; font-weight: 1000; color: var(--yellow); }
.stats-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stats-overview > div { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(20,23,31,.86); }
.stats-overview span, .stats-overview strong { display: block; }
.stats-overview span { color: var(--muted); font-size: 11px; }
.stats-overview strong { margin-top: 5px; font-size: 24px; font-variant-numeric: tabular-nums; }
.stats-panel, .settings-card { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(20,23,31,.86); }
.stats-panel h3, .settings-card h3 { margin: 0 0 12px; font-size: 14px; }
.mode-stat-row, .recent-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); }
.mode-stat-row:first-child, .recent-row:first-child { border-top: 0; }
.mode-stat-row small, .recent-row small { color: var(--muted); }
.mode-stat-row strong, .recent-row strong { font-variant-numeric: tabular-nums; }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(20,23,31,.86); }
.setting-row { min-height: 67px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.07); cursor: pointer; }
.setting-row:first-child { border-top: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 14px; }
.setting-row small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.setting-row input { position: absolute; opacity: 0; pointer-events: none; }
.setting-row i { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border-radius: 99px; background: #303440; transition: .2s; }
.setting-row i::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: .2s; }
.setting-row input:checked + i { background: var(--green); }
.setting-row input:checked + i::after { transform: translateX(20px); }
.name-editor { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.name-editor input { min-width: 0; height: 44px; padding: 0 12px; color: white; background: #0b0d12; border: 1px solid var(--line); border-radius: 11px; }
.name-editor button { padding: 0 16px; color: #111; background: var(--yellow); border-radius: 11px; font-weight: 900; }
.settings-card > small { display: block; margin-top: 8px; color: var(--muted); }
.settings-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.danger-zone { border-color: rgba(242,56,56,.2); }
.version-label { margin: 25px 0; text-align: center; color: #555b69; font-size: 10px; }
.tutorial-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.tutorial-stack article { display: grid; grid-template-columns: 45px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(20,23,31,.86); }
.tutorial-stack b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #111; background: var(--yellow); font-size: 18px; }
.tutorial-stack h3 { margin: 0 0 5px; font-size: 14px; }
.tutorial-stack p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.primary-action, .secondary-action, .ghost-action, .danger-action { min-height: 48px; padding: 0 18px; border-radius: 13px; font-weight: 900; }
.primary-action { color: white; background: linear-gradient(145deg,#ff4248,#c70f20); box-shadow: 0 5px 0 #650812; }
.primary-action:active { transform: translateY(3px); box-shadow: 0 2px 0 #650812; }
.secondary-action { color: #101218; background: #f2f4f8; }
.ghost-action { color: #b9beca; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.danger-action { color: white; background: var(--red); }
.full { width: 100%; }

/* Game */
.game-screen { min-height: calc(100dvh - 58px - var(--safe-top)); padding: 12px 14px calc(20px + var(--safe-bottom)); touch-action: none; user-select: none; overflow: hidden; background-image: linear-gradient(180deg, rgba(3,5,9,.04), rgba(2,4,8,.24)), url('assets/backgrounds/game-danger-core.webp'); background-size: cover; background-position: center center; }
.game-screen::before { content:""; position: fixed; inset: 58px 0 0; max-width: 540px; margin: auto; z-index: 1; pointer-events: none; background: radial-gradient(circle at 50% 49%, rgba(57,168,255,.09), transparent 31%), radial-gradient(circle at 50% 28%, rgba(242,56,56,.09), transparent 38%), linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.18)); }
.game-hud { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(7,10,16,.78); backdrop-filter: blur(9px); }
.hud-item span, .hud-item strong, .hud-center span, .hud-center strong { display: block; }
.hud-item span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.hud-item strong { margin-top: 3px; font-size: 20px; font-variant-numeric: tabular-nums; }
.hud-item.right { text-align: right; }
.hud-center { text-align: center; padding: 0 18px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.hud-center span { color: var(--yellow); font-size: 8px; font-weight: 1000; letter-spacing: .13em; }
.hud-center strong { margin-top: 3px; font-size: 12px; }
.game-subhud { position: relative; z-index: 3; min-height: 26px; margin: 8px 3px 0; display: flex; align-items: center; justify-content: space-between; }
.lives { display: flex; gap: 5px; }
.life-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--red); box-shadow: 0 0 12px rgba(242,56,56,.2); }
.life-dot.lost { border-color: #343843; background: #242731; box-shadow: none; }
.global-timer { width: 132px; height: 7px; overflow: hidden; background: #2a2e38; border-radius: 99px; }
.global-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg,var(--green),var(--yellow),var(--red)); transform-origin: left; }
.command-zone { position: relative; z-index: 3; min-height: 156px; margin-top: 2px; padding: 15px 14px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px solid rgba(255,255,255,.075); border-radius: 22px; background: linear-gradient(180deg, rgba(8,10,16,.50), rgba(8,10,16,.26)); backdrop-filter: blur(4px); box-shadow: inset 0 0 30px rgba(242,56,56,.035); }
.command-kicker { min-width: 76px; padding: 5px 10px; color: #141414; background: var(--yellow); border-radius: 99px; font-size: 9px; font-weight: 1000; letter-spacing: .15em; }
.command-zone h2 { margin: 12px 0 4px; font-size: clamp(29px,8.4vw,45px); line-height: 1.08; font-weight: 1000; letter-spacing: -.06em; text-wrap: balance; text-shadow: 0 4px 18px rgba(0,0,0,.48); }
.command-zone p { min-height: 20px; margin: 4px 0 12px; color: #aab0bd; font-size: 12px; font-weight: 700; }
.command-meter { width: min(260px,78%); height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.command-meter span { display: block; width: 100%; height: 100%; background: var(--yellow); transform-origin: left; }
.playfield { position: relative; z-index: 3; min-height: min(48vh,390px); display: grid; place-items: center; }
.danger-button { position: relative; width: clamp(190px,58vw,280px); aspect-ratio: 1; border-radius: 50%; background: transparent; transform: translate3d(0,0,0); touch-action: none; transition: transform .11s ease, filter .2s ease; }
.danger-button::before { content:""; position:absolute; inset: 7%; border-radius: 50%; background: radial-gradient(circle at 38% 28%, #ff8582 0%, #ff373d 28%, #b70518 62%, #4d030b 100%); box-shadow: inset 0 10px 18px rgba(255,255,255,.2), inset 0 -24px 30px rgba(43,0,5,.54), 0 15px 0 #310208, 0 24px 45px rgba(242,56,56,.35); border: clamp(7px,2vw,11px) solid #3e414b; }
.danger-button::after { content:""; position:absolute; inset: 0; border-radius:50%; border: 3px solid rgba(255,255,255,.08); box-shadow: 0 0 0 8px rgba(0,0,0,.35), 0 0 45px rgba(242,56,56,.18); }
.button-shine { position: absolute; z-index: 2; width: 48%; height: 23%; left: 25%; top: 17%; border-radius: 50%; background: linear-gradient(180deg,rgba(255,255,255,.38),rgba(255,255,255,0)); filter: blur(2px); }
.button-core { position: relative; z-index: 4; display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255,255,255,.95); font-size: clamp(27px,8vw,43px); font-weight: 1000; letter-spacing: -.03em; text-shadow: 0 4px 0 rgba(93,0,10,.9), 0 0 20px rgba(255,255,255,.18); }
.button-ring { position:absolute; inset:-7%; border-radius:50%; border: 2px solid rgba(242,56,56,.28); opacity:.5; animation: ringPulse 1.7s ease-out infinite; }
@keyframes ringPulse { 0% { transform:scale(.9); opacity:.5; } 80%,100% { transform:scale(1.12); opacity:0; } }
.danger-button.pressed { transform: translateY(12px) scale(.97); filter: brightness(.9); }
.danger-button.pressed::before { box-shadow: inset 0 7px 15px rgba(255,255,255,.12), inset 0 -13px 20px rgba(43,0,5,.5), 0 5px 0 #310208, 0 12px 20px rgba(242,56,56,.2); }
.danger-button.moving { transition: transform .25s ease; }
.aux-target { position: absolute; z-index: 12; width: 64px; height: 54px; border-radius: 15px; background: linear-gradient(145deg,#4cc0ff,#1568cf); box-shadow: 0 6px 0 #0b3974; font-weight: 1000; }
.aux-target:active { transform: translateY(4px); box-shadow: 0 2px 0 #0b3974; }
.aux-top { top: 0; left: calc(50% - 32px); }
.aux-left { left: 3px; top: calc(50% - 27px); }
.aux-right { right: 3px; top: calc(50% - 27px); }
.tap-counter { position: absolute; right: 13%; top: 16%; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #111; background: var(--yellow); font-size: 25px; font-weight: 1000; box-shadow: 0 8px 20px rgba(255,212,59,.25); }
.feedback-burst { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; pointer-events: none; color: white; font-size: clamp(46px,14vw,74px); font-style: italic; font-weight: 1000; letter-spacing: -.08em; text-shadow: 0 7px 0 rgba(0,0,0,.45), 0 0 35px currentColor; animation: feedbackPop .55s cubic-bezier(.18,.89,.32,1.28) both; }
.feedback-burst.success { color: var(--green); }
.feedback-burst.failure { color: #ff4a50; }
@keyframes feedbackPop { 0% { opacity:0; transform:scale(.45) rotate(-6deg); } 35% { opacity:1; transform:scale(1.12) rotate(2deg); } 100% { opacity:0; transform:scale(.95); } }
.game-footer { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr 48px 1fr; align-items: center; gap: 10px; margin-top: 2px; }
.reaction-readout span, .reaction-readout strong { display:block; }
.reaction-readout span { color:var(--muted); font-size:8px; letter-spacing:.12em; }
.reaction-readout strong { margin-top:3px; font-size:14px; font-variant-numeric: tabular-nums; }
.reaction-readout.right { text-align:right; }
.pause-button { width: 46px; height: 42px; border-radius:13px; color:#aab0bd; background:rgba(255,255,255,.06); border:1px solid var(--line); font-weight:1000; }
.command-zone.waiting h2 { color:#7d8390; }
.command-zone.success h2 { color:var(--green); }
.command-zone.failure h2 { color:#ff555c; }
.app-shell.flash-success::after, .app-shell.flash-failure::after { content:""; position:fixed; inset:0; z-index:55; max-width:540px; margin:auto; pointer-events:none; animation:screenFlash .28s ease-out both; }
.app-shell.flash-success::after { background:rgba(65,223,141,.25); }
.app-shell.flash-failure::after { background:rgba(242,56,56,.35); }
@keyframes screenFlash { from { opacity:1; } to { opacity:0; } }
.app-shell.shake { animation: appShake .34s linear; }
@keyframes appShake { 0%,100%{transform:none} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(4px)} }

/* Skins */
.danger-button.skin-blue::before { background: radial-gradient(circle at 38% 28%,#a7e6ff,#249cff 34%,#0752bb 65%,#021d52); box-shadow: inset 0 10px 18px rgba(255,255,255,.2), inset 0 -24px 30px rgba(0,19,67,.55), 0 15px 0 #021532, 0 24px 45px rgba(57,168,255,.35); }
.danger-button.skin-gold::before { background: radial-gradient(circle at 38% 28%,#fff6a9,#ffc829 36%,#bb7000 67%,#4b2600); box-shadow: inset 0 10px 18px rgba(255,255,255,.28), inset 0 -24px 30px rgba(61,26,0,.5), 0 15px 0 #3d2100,0 24px 45px rgba(255,212,59,.3); }
.danger-button.skin-green::before { background: radial-gradient(circle at 38% 28%,#c2ffd7,#35df7d 34%,#0b9850 67%,#033b20); box-shadow: inset 0 10px 18px rgba(255,255,255,.25),inset 0 -24px 30px rgba(0,48,22,.55),0 15px 0 #042b18,0 24px 45px rgba(65,223,141,.3); }
.danger-button.skin-neon::before { background: radial-gradient(circle at 42% 26%,#fff,#c15cff 23%,#5028f4 52%,#071f73 79%); box-shadow:inset 0 8px 18px rgba(255,255,255,.35),inset 0 -22px 30px rgba(8,0,70,.5),0 15px 0 #05052f,0 0 50px #7f53ff; }
.danger-button.skin-mono::before { background: radial-gradient(circle at 38% 28%,#fff,#c5c6ca 38%,#5f626c 67%,#17181d); box-shadow:inset 0 10px 18px rgba(255,255,255,.28),inset 0 -24px 30px rgba(0,0,0,.55),0 15px 0 #08090b,0 24px 45px rgba(255,255,255,.12); }
.danger-button.skin-hazard::before { background: repeating-conic-gradient(#ffd43b 0 12deg,#111 12deg 24deg); box-shadow:inset 0 0 0 25px rgba(242,56,56,.95),inset 0 10px 18px rgba(255,255,255,.18),0 15px 0 #241800,0 24px 45px rgba(255,212,59,.25); }
.bg-lab { background: radial-gradient(circle at 50% 28%,rgba(57,168,255,.16),transparent 40%),linear-gradient(180deg,#06111b,#07090e 70%); }
.bg-factory { background: repeating-linear-gradient(135deg,rgba(255,212,59,.035) 0 10px,transparent 10px 30px),radial-gradient(circle at 50% 35%,rgba(255,212,59,.12),transparent 44%),#0c0b09; }
.bg-space { background: radial-gradient(circle at 20% 20%,#fff 0 1px,transparent 2px),radial-gradient(circle at 75% 42%,#fff 0 1px,transparent 2px),radial-gradient(circle at 53% 15%,rgba(127,83,255,.22),transparent 38%),#050713; background-size:100px 100px,140px 140px,auto,auto; }
.bg-white { background:linear-gradient(180deg,#e8ebf1,#b8c0ce); color:#15171d; }
.bg-white .topbar, .bg-white .bottom-nav { background:rgba(233,236,243,.92); color:#17191f; }
.bg-white .game-hud { background:rgba(255,255,255,.7); color:#17191f; }

.result-hero { text-align:center; padding-top:12px; }
.result-label { color:var(--yellow); font-size:10px; font-weight:1000; letter-spacing:.22em; }
.rank-emblem { width:125px; height:125px; margin:11px auto; display:grid; place-items:center; align-content:center; border-radius:50%; background:radial-gradient(circle,#262b36,#0d0f15 68%); border:2px solid rgba(255,212,59,.38); box-shadow:0 0 0 7px rgba(255,212,59,.05),0 18px 35px rgba(0,0,0,.38); }
.rank-emblem span { color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.14em; }
.rank-emblem strong { color:var(--yellow); font-size:60px; line-height:1; text-shadow:0 0 25px rgba(255,212,59,.25); }
.result-hero p { color:#b5bac7; margin:9px 0 16px; }
.result-score-card { position:relative; padding:15px; text-align:center; border:1px solid var(--line); border-radius:17px; background:linear-gradient(145deg,rgba(20,25,35,.84),rgba(7,10,16,.80)); backdrop-filter: blur(9px); }
.result-score-card > span { display:block; color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.15em; }
.result-score-card > strong { display:block; margin-top:2px; font-size:43px; font-variant-numeric:tabular-nums; }
.result-new-best { position:absolute; top:-10px; right:14px; padding:5px 9px; color:#151000; background:var(--yellow); border-radius:99px; font-weight:1000; transform:rotate(3deg); }
.result-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:9px; }
.result-grid > div { padding:13px; border:1px solid var(--line); border-radius:14px; background:rgba(10,14,21,.76); backdrop-filter: blur(8px); }
.result-grid span,.result-grid strong { display:block; }
.result-grid span { color:var(--muted); font-size:10px; }
.result-grid strong { margin-top:4px; font-size:17px; font-variant-numeric:tabular-nums; }
.reward-card { margin-top:9px; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid rgba(255,212,59,.18); border-radius:16px; background:rgba(255,212,59,.075); backdrop-filter: blur(8px); }
.reward-card > div { display:grid; grid-template-columns:auto auto; align-items:center; gap:7px; }
.reward-card strong { font-size:22px; }
.reward-card small { grid-column:1 / -1; color:var(--muted); font-size:9px; }
.reward-card p { max-width:55%; margin:0; color:#b9beca; font-size:10px; line-height:1.5; text-align:right; }
.result-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:13px; }
.result-actions .ghost-action { grid-column:1 / -1; }
.modal-layer { position:fixed; inset:0; z-index:100; max-width:540px; margin:auto; padding:20px; display:grid; place-items:center; background:rgba(0,0,0,.74); backdrop-filter:blur(8px); }
.modal-card { width:min(360px,100%); padding:25px; text-align:center; border:1px solid var(--line); border-radius:22px; background:#151820; box-shadow:0 25px 70px rgba(0,0,0,.5); }
.modal-icon { width:70px; height:70px; margin:auto; display:grid; place-items:center; border-radius:50%; color:#111; background:var(--yellow); font-size:28px; font-weight:1000; }
.modal-card h2 { margin:15px 0 7px; }
.modal-card p { color:var(--muted); font-size:12px; line-height:1.6; }
.modal-card > button { width:100%; margin-top:9px; }
.modal-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:18px; }
.toast { position:fixed; z-index:150; left:50%; bottom:calc(92px + var(--safe-bottom)); width:max-content; max-width:calc(100% - 36px); transform:translateX(-50%); padding:11px 15px; border:1px solid var(--line); border-radius:12px; color:white; background:rgba(25,28,37,.96); box-shadow:var(--shadow); font-size:12px; animation:toastIn .22s ease both; }
@keyframes toastIn { from{opacity:0;transform:translate(-50%,8px)} to{opacity:1;transform:translate(-50%,0)} }
.offline-badge { position:fixed; z-index:75; top:calc(66px + var(--safe-top)); right:max(12px,calc((100vw - 540px)/2 + 12px)); padding:5px 8px; border-radius:7px; color:#111; background:var(--yellow); font-size:9px; font-weight:1000; letter-spacing:.1em; }

@media (max-height: 700px) {
  .command-zone { min-height: 120px; }
  .playfield { min-height: 305px; }
  .danger-button { width: min(47vh,230px); }
  .game-screen { padding-top: 8px; }
}
@media (min-width: 541px) {
  .app-shell { min-height: 100vh; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; }
}
.app-shell.reduce-motion *, .app-shell.reduce-motion *::before, .app-shell.reduce-motion *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
.danger-button { --move-x: 0px; --move-y: 0px; transform: translate(var(--move-x), var(--move-y)); }
.danger-button.pressed { transform: translate(var(--move-x), calc(var(--move-y) + 12px)) scale(.97); }
.danger-button.cue-signal { filter: brightness(1.32); }
.danger-button.cue-signal .button-ring { border-width: 5px; border-color: #fff; animation: cueWave .42s ease-out 2; }
@keyframes cueWave { from { transform: scale(.82); opacity: 1; } to { transform: scale(1.22); opacity: 0; } }
.app-shell.left-handed .aux-left { left: auto; right: 3px; }
.app-shell.left-handed .aux-right { right: auto; left: 3px; }
.mini-button.skin-blue { background: radial-gradient(circle at 35% 25%,#a7e6ff,#249cff 38%,#0752bb 70%,#021d52); box-shadow:0 7px 0 #021532,0 11px 20px rgba(57,168,255,.25); }
.mini-button.skin-green { background: radial-gradient(circle at 35% 25%,#c2ffd7,#35df7d 38%,#0b9850 70%,#033b20); box-shadow:0 7px 0 #042b18,0 11px 20px rgba(65,223,141,.25); }
.mini-button.skin-gold { background: radial-gradient(circle at 35% 25%,#fff6a9,#ffc829 38%,#bb7000 70%,#4b2600); box-shadow:0 7px 0 #3d2100,0 11px 20px rgba(255,212,59,.25); }
.mini-button.skin-mono { background: radial-gradient(circle at 35% 25%,#fff,#c5c6ca 38%,#5f626c 70%,#17181d); box-shadow:0 7px 0 #08090b,0 11px 20px rgba(255,255,255,.12); }
.mini-button.skin-neon { background: radial-gradient(circle at 35% 25%,#fff,#c15cff 25%,#5028f4 55%,#071f73 82%); box-shadow:0 7px 0 #05052f,0 0 25px #7f53ff; }
.mini-button.skin-hazard { background:repeating-conic-gradient(#ffd43b 0 12deg,#111 12deg 24deg); box-shadow:inset 0 0 0 13px rgba(242,56,56,.95),0 7px 0 #241800,0 11px 20px rgba(255,212,59,.25); }
.legal-links { display:grid; gap:8px; }
.legal-links a { padding:11px 12px; border:1px solid var(--line); border-radius:11px; color:#65baff; background:rgba(57,168,255,.05); text-decoration:none; font-size:12px; font-weight:800; }
.legal-links #inappropriate-ad-report-button { color:#ffd2d2; border-color:rgba(242,56,56,.45); background:rgba(242,56,56,.08); }
.legal-card > small { display:block; margin-top:10px; color:#9fa6b5; line-height:1.55; }
.legal-card #privacy-options-button { width:100%; margin-top:12px; }
.topbar > .back-button.hidden { display: block !important; visibility: hidden; pointer-events: none; }
.reward-action { grid-column:1 / -1; min-height:48px; border-radius:13px; color:#130f00; background:linear-gradient(145deg,#ffe56b,#ffba16); box-shadow:0 5px 0 #8e5a00; font-weight:1000; }
.reward-action:disabled { opacity:.6; }
.premium-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.premium-actions button { min-height:44px; }
.ad-privacy-summary { display:grid; gap:8px; margin:12px 0 14px; padding:12px; border:1px solid var(--line); border-radius:12px; background:rgba(0,0,0,.18); }
.ad-privacy-summary > div { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.ad-privacy-summary span { color:var(--muted); font-size:12px; }
.ad-privacy-summary strong { color:#f2f4f8; font-size:12px; text-align:right; }
.ad-privacy-summary small { color:#aeb5c2; line-height:1.55; }
.ad-privacy-summary .ad-policy-note { padding-top:8px; border-top:1px solid var(--line); }
.ranking-rules-link { display:flex; min-height:44px; margin-top:14px; align-items:center; justify-content:center; color:#65baff; font-size:12px; font-weight:800; text-decoration:none; border:1px solid var(--line); border-radius:11px; background:rgba(57,168,255,.05); }

/* v1.2.0 — Coin shop, boosters and online ranking */
.boost-loadout {
  margin: 14px 0 4px; padding: 12px 13px; display: grid; grid-template-columns: 38px 1fr auto;
  align-items: center; gap: 10px; border: 1px solid rgba(57,168,255,.20); border-radius: 16px;
  background: linear-gradient(135deg, rgba(57,168,255,.09), rgba(10,13,20,.82)); backdrop-filter: blur(8px);
}
.boost-loadout-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #07121e; background: var(--blue); font-weight: 1000; }
.boost-loadout span, .boost-loadout strong, .boost-loadout small { display: block; }
.boost-loadout span { color: var(--blue); font-size: 8px; font-weight: 1000; letter-spacing: .15em; }
.boost-loadout strong { margin-top: 3px; font-size: 12px; }
.boost-loadout small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.boost-loadout button { padding: 9px 11px; border-radius: 10px; color: #07121e; background: var(--blue); font-size: 10px; font-weight: 1000; }

.shop-wallet {
  margin-bottom: 12px; padding: 14px 15px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  border: 1px solid rgba(255,212,59,.25); border-radius: 17px; background: linear-gradient(135deg, rgba(255,212,59,.11), rgba(14,15,20,.88));
}
.shop-wallet small, .shop-wallet strong { display: block; }
.shop-wallet small { color: var(--muted); font-size: 9px; }
.shop-wallet strong { margin-top: 2px; color: var(--yellow); font-size: 25px; font-variant-numeric: tabular-nums; }
.shop-wallet > span:last-child { padding: 6px 9px; border-radius: 99px; color: var(--green); background: rgba(65,223,141,.08); font-size: 9px; font-weight: 900; }
.shop-tabs { overflow-x: auto; grid-auto-columns: minmax(70px,1fr); scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs button { white-space: nowrap; font-size: 10px; }
.collection-grid.booster-grid { grid-template-columns: 1fr; }
.booster-card {
  position: relative; padding: 15px; display: grid; grid-template-columns: 58px 1fr; gap: 12px;
  border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(24,29,39,.98), rgba(10,12,17,.98));
}
.booster-card.armed { border-color: rgba(65,223,141,.48); box-shadow: inset 0 0 0 1px rgba(65,223,141,.12), 0 0 24px rgba(65,223,141,.06); }
.booster-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; color: #0b0d11; background: linear-gradient(145deg,#ffe774,#ffb70c); font-size: 22px; font-weight: 1000; box-shadow: 0 7px 17px rgba(255,190,25,.18); }
.booster-card:nth-child(2) .booster-icon { color: white; background: linear-gradient(145deg,#55baff,#1855d1); }
.booster-card:nth-child(3) .booster-icon { color: white; background: linear-gradient(145deg,#b869ff,#5a2bd6); }
.booster-copy h3 { margin: 1px 0 4px; font-size: 15px; }
.booster-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.booster-meta { margin-top: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.booster-count, .booster-ranked { padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 900; }
.booster-count { color: var(--yellow); background: rgba(255,212,59,.09); }
.booster-ranked { color: var(--green); background: rgba(65,223,141,.08); }
.booster-ranked.assist { color: #ffb7bc; background: rgba(242,56,56,.10); }
.booster-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.booster-actions button { min-height: 41px; border-radius: 11px; font-size: 11px; font-weight: 1000; }
.booster-buy { color: #151000; background: var(--yellow); }
.booster-arm { color: white; background: #252a35; border: 1px solid var(--line); }
.booster-arm.active { color: #07120c; background: var(--green); }
.booster-actions button:disabled { opacity: .45; cursor: default; }
.badge-preview { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: var(--yellow); background: radial-gradient(circle,#2b303b,#0d0f15 70%); border: 2px solid rgba(255,212,59,.32); font-size: 25px; font-weight: 1000; box-shadow: 0 0 0 6px rgba(255,212,59,.035); }

.game-boost-status { position: relative; z-index: 4; width: max-content; max-width: 100%; margin: 4px auto 0; padding: 5px 9px; border: 1px solid rgba(65,223,141,.22); border-radius: 99px; color: #aef4ca; background: rgba(6,25,16,.74); font-size: 9px; font-weight: 900; backdrop-filter: blur(7px); }
.command-zone.protected h2 { color: var(--yellow); }
.feedback-burst.protected { color: var(--yellow); }
.assist-result-badge { display: inline-block; margin: 8px 0 0; padding: 5px 9px; border-radius: 99px; color: #241400; background: var(--yellow); font-size: 9px; font-weight: 1000; letter-spacing: .12em; }
.result-online-card { margin-top: 9px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(57,168,255,.22); border-radius: 15px; background: rgba(57,168,255,.065); backdrop-filter: blur(8px); }
.online-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px rgba(57,168,255,.55); }
.result-online-card.offline .online-dot { background: var(--muted); box-shadow: none; }
.result-online-card.assisted .online-dot { background: var(--yellow); box-shadow: 0 0 12px rgba(255,212,59,.35); }
.result-online-card small, .result-online-card strong { display: block; }
.result-online-card small { color: var(--blue); font-size: 8px; font-weight: 1000; letter-spacing: .14em; }
.result-online-card strong { margin-top: 3px; font-size: 12px; }
.shop-action { grid-column: 1 / -1; min-height: 45px; border-radius: 13px; color: var(--yellow); background: rgba(255,212,59,.07); border: 1px solid rgba(255,212,59,.22); font-weight: 1000; }

.ranking-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-bottom: 11px; }
.ranking-summary > div { min-width: 0; padding: 11px 8px; text-align: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(18,22,30,.82); }
.ranking-summary span, .ranking-summary strong { display: block; }
.ranking-summary span { color: var(--muted); font-size: 8px; }
.ranking-summary strong { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.ranking-self-card { margin-bottom: 10px; padding: 11px 13px; border: 1px solid rgba(255,212,59,.38); border-radius: 14px; background: rgba(255,212,59,.065); }
.ranking-self-card .rank-row { min-height: 52px; padding: 0; border: 0; background: transparent; }
.rank-row { grid-template-columns: 42px 34px 1fr auto; }
.rank-profile-badge { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: var(--yellow); background: #0b0d12; border: 1px solid rgba(255,212,59,.26); font-size: 15px; font-weight: 1000; }
.rank-row.top-one { border-color: rgba(255,212,59,.35); }
.ranking-demo-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; color: #d5b75b; background: rgba(255,212,59,.06); font-size: 9px; line-height: 1.5; }

.profile-strip > div:first-child { position: relative; padding-left: 45px; }
.home-profile-badge { position: absolute; left: 10px; top: 50%; width: 27px; height: 27px; transform: translateY(-50%); display: grid; place-items: center; border-radius: 50%; color: var(--yellow); background: #090b10; border: 1px solid rgba(255,212,59,.28); font-size: 13px; font-weight: 1000; }

@media (max-width: 390px) {
  .shop-tabs { grid-auto-columns: minmax(66px,1fr); }
  .shop-tabs button { padding-left: 4px; padding-right: 4px; font-size: 9px; }
  .ranking-summary strong { font-size: 11px; }
}

/* v1.3.0 — mobile hierarchy, accessibility, shop clarity and leaderboard states */
.skip-link {
  position: fixed; z-index: 300; top: 0; left: max(8px,var(--safe-left));
  min-height:44px; display:flex; align-items:center; padding: 11px 15px; border-radius: 11px; color: #111; background: var(--yellow); font-weight: 900;
  transform: translateY(calc(-100% - 2px)); transition: transform .16s ease; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: max(8px,var(--safe-top)); transform: translateY(0); }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}
.app-shell { overflow: clip; }
.topbar {
  padding-left: max(18px,var(--safe-left)); padding-right: max(18px,var(--safe-right));
}
.icon-button { width: 44px; height: 44px; }
.screen {
  padding-left: max(18px,var(--safe-left)); padding-right: max(18px,var(--safe-right));
  padding-bottom: calc(104px + var(--safe-bottom) + var(--banner-slot-height));
}
.bottom-nav {
  bottom: var(--banner-slot-height);
  height: calc(76px + var(--safe-bottom));
  padding-left: max(9px,var(--safe-left)); padding-right: max(9px,var(--safe-right));
  transition: bottom .2s ease, height .2s ease, padding-bottom .2s ease;
  /* Native ads are sibling UIKit views above the WKWebView. Reserving the
     measured slot keeps every navigation target outside the ad hit region. */
  isolation: isolate;
}
.bottom-nav button { min-height: 56px; }
.app-shell.banner-visible .bottom-nav {
  bottom: calc(var(--banner-slot-height) + var(--safe-bottom));
  height: 76px;
  padding-bottom: 7px;
}
.app-shell.banner-visible .toast { bottom: calc(92px + var(--safe-bottom) + var(--banner-slot-height)); }
.modal-layer { padding: max(20px,var(--safe-top)) max(20px,var(--safe-right)) max(20px,var(--safe-bottom)) max(20px,var(--safe-left)); }

.home-hero { padding-top: clamp(20px,5vh,34px); }
.home-hero p { color: #d0d4de; font-weight: 650; }
.profile-strip .label, .mode-card small, .daily-copy small, .page-title p, .collection-card p, .booster-copy p { color: #aeb4c2; }
.boost-loadout { grid-template-columns: 42px minmax(0,1fr) auto; }
.boost-loadout-icon { width: 40px; height: 40px; }
.boost-loadout-copy { min-width: 0; }
.boost-loadout-copy strong, .boost-loadout-copy small { overflow-wrap: anywhere; }
.boost-loadout button { min-width: 66px; min-height: 44px; padding: 9px 11px; }
.rank-eligibility {
  display: inline-flex !important; width: fit-content; margin-top: 7px; padding: 4px 8px; border-radius: 99px;
  color: #8ff0b8; background: rgba(65,223,141,.12); border: 1px solid rgba(65,223,141,.2);
  font-size: 9px; font-style: normal; font-weight: 900; letter-spacing: .02em;
}
.rank-eligibility.assisted { color: #ffe27a; background: rgba(255,212,59,.1); border-color: rgba(255,212,59,.24); }
.primary-launch { min-height: 112px; }
.mode-card { min-height: 88px; }
.text-button, .compact-button { min-height: 44px; }

.segmented button { min-height: 44px; padding: 10px 7px; }
.segmented button[aria-selected="true"] { background: #f3f4f7; color: #0b0d12; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ranking-state {
  min-height: 64px; margin-bottom: 13px; padding: 11px 12px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px;
  border: 1px solid rgba(57,168,255,.24); border-radius: 15px; background: rgba(57,168,255,.075);
}
.ranking-state.demo { border-color: rgba(255,212,59,.3); background: rgba(255,212,59,.08); }
.ranking-state.error { border-color: rgba(255,90,96,.34); background: rgba(242,56,56,.09); }
.ranking-state.online { border-color: rgba(65,223,141,.28); background: rgba(65,223,141,.07); }
.ranking-state-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #07121e; background: var(--blue); font-weight: 1000; }
.ranking-state.demo .ranking-state-icon { color: #181200; background: var(--yellow); }
.ranking-state.error .ranking-state-icon { color: white; background: var(--red); }
.ranking-state.online .ranking-state-icon { color: #07150d; background: var(--green); }
.ranking-state strong, .ranking-state small { display: block; }
.ranking-state strong { font-size: 12px; }
.ranking-state small { margin-top: 3px; color: #aeb4c2; font-size: 10px; line-height: 1.45; }
.ranking-state-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.ranking-state button { width: 100%; min-width: 0; padding: 0 12px; border-radius: 10px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.ranking-retry { color: white; background: var(--red); }
.ranking-demo-button { color: #141000; background: var(--yellow); }

.ranking-podium {
  margin: 16px 0 14px; padding: 13px 8px 11px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 7px;
  border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg,rgba(28,32,42,.9),rgba(10,12,17,.9));
}
.podium-card { min-width: 0; text-align: center; }
.podium-card.first { order: 2; }
.podium-card.second { order: 1; }
.podium-card.third { order: 3; }
.podium-avatar {
  position: relative; width: 48px; height: 48px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 50%;
  color: #181200; background: linear-gradient(145deg,#fff2a0,#e4a900); border: 3px solid rgba(255,255,255,.18); font-size: 21px; font-weight: 1000;
}
.podium-card.first .podium-avatar { width: 60px; height: 60px; box-shadow: 0 0 30px rgba(255,212,59,.18); }
.podium-card.second .podium-avatar { color: #17181b; background: linear-gradient(145deg,#fff,#9ea5b2); }
.podium-card.third .podium-avatar { color: #22130c; background: linear-gradient(145deg,#ffd0a5,#b96a31); }
.podium-position { position: absolute; right: -3px; bottom: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: #10131a; border: 2px solid #303541; font-size: 10px; }
.podium-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.podium-score { display: block; margin-top: 3px; color: var(--yellow); font-size: 13px; font-variant-numeric: tabular-nums; }
.podium-demo { display: block; margin-top: 3px; color: #e0c36e; font-size: 8px; font-weight: 900; }
.ranking-list-heading { margin: 14px 2px 8px; display: flex; align-items: end; justify-content: space-between; }
.ranking-list-heading span { color: var(--blue); font-size: 8px; font-weight: 1000; letter-spacing: .16em; }
.ranking-list-heading strong { font-size: 12px; }
.ranking-self-card { padding: 12px 13px; }
.ranking-self-card > small { display: block; margin-bottom: 7px; color: var(--yellow); font-size: 9px; font-weight: 1000; letter-spacing: .09em; }
.ranking-self-card .rank-row { grid-template-columns: 42px 34px minmax(0,1fr) auto; }
.rank-row { grid-template-columns: 42px 34px minmax(0,1fr) auto; min-height: 66px; }
.rank-row[aria-current="true"] { border-color: rgba(255,212,59,.48); background: rgba(255,212,59,.075); }
.rank-name { min-width: 0; }
.rank-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score span, .rank-score small { display: block; }
.rank-score small { margin-top: 3px; color: #aeb4c2; font-size: 8px; font-weight: 700; }
.ranking-demo-note { padding: 11px 12px; color: #ffe27a; border: 1px solid rgba(255,212,59,.2); font-size: 10px; }
.empty-state.error { border-style: solid; border-color: rgba(242,56,56,.28); color: #ffc1c4; background: rgba(242,56,56,.06); }

.shop-rank-status {
  margin: 0 0 12px; padding: 11px 13px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px;
  border: 1px solid rgba(65,223,141,.25); border-radius: 14px; background: rgba(65,223,141,.075);
}
.shop-rank-status > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #07150d; background: var(--green); font-weight: 1000; }
.shop-rank-status strong, .shop-rank-status small { display: block; }
.shop-rank-status strong { font-size: 12px; }
.shop-rank-status small { margin-top: 3px; color: #b5bbc8; font-size: 10px; line-height: 1.45; }
.shop-rank-status.assisted { border-color: rgba(255,212,59,.28); background: rgba(255,212,59,.08); }
.shop-rank-status.assisted > span { color: #171100; background: var(--yellow); }
.booster-card { grid-template-columns: 58px minmax(0,1fr); }
.booster-card.armed::after { content: "次回使用"; position: absolute; top: 10px; right: 10px; padding: 4px 7px; border-radius: 99px; color: #07150d; background: var(--green); font-size: 8px; font-weight: 1000; }
.booster-copy { min-width: 0; padding-right: 2px; }
.booster-card.armed .booster-copy { padding-right: 58px; }
.booster-count, .booster-ranked { font-size: 10px; }
.booster-actions button { min-height: 44px; }
.booster-buy:disabled { color: #777d89; background: #252934; }
.collection-card { min-height: 184px; }
.collection-card[aria-pressed="true"] .collection-state { color: #181200; background: var(--yellow); }
.collection-state { padding: 4px 7px; border-radius: 99px; background: rgba(65,223,141,.08); }

.setting-row input:focus-visible + i { outline: 3px solid var(--yellow); outline-offset: 3px; }
.name-editor button, .legal-links a { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.callsign-preview { margin-top: 12px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 11px; background: rgba(57,168,255,.07); border: 1px solid rgba(57,168,255,.17); }
.callsign-preview span { color: #aeb4c2; font-size: 10px; }
.callsign-preview strong { color: #8dceff; font-size: 12px; font-variant-numeric: tabular-nums; }
.online-participation-card { border-color: rgba(57,168,255,.22); }
.online-participation-toggle { margin: 0 -4px; padding: 12px 4px; border-top: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.online-participation-toggle input:disabled + i { opacity: .42; }
.online-participation-card > p { margin: 12px 0 6px; color: #d5d9e2; }
.online-participation-card > small { margin: 0 0 12px; line-height: 1.55; }
.online-participation-card > button { width: 100%; }
.online-data-card { border-color: rgba(255,212,59,.18); }
.online-data-card > button { width: 100%; }
.online-data-card > button:disabled { opacity: .45; cursor: default; }
.online-consent-card { text-align: left; }
.online-consent-card h2 { margin-top: 0; }
.online-consent-card > p { margin-bottom: 8px; color: #d1d5de; }
.online-consent-privacy { min-height: 44px; display: inline-flex; align-items: center; color: #8dceff; font-size: 12px; font-weight: 800; }
.online-consent-card > button { width: 100%; }
.game-screen {
  min-height: 100dvh;
  padding: calc(12px + var(--safe-top)) max(14px,var(--safe-right)) calc(20px + var(--safe-bottom)) max(14px,var(--safe-left));
}
.game-screen::before { inset: 0; }
.pause-button { width: 48px; height: 44px; }
.aux-target { min-width: 64px; min-height: 54px; }
.command-zone p { color: #c0c5d0; }
.offline-badge { top: calc(66px + var(--safe-top)); text-transform: uppercase; }

@media (max-width: 390px) {
  .screen { padding-left: max(14px,var(--safe-left)); padding-right: max(14px,var(--safe-right)); }
  .boost-loadout { grid-template-columns: 38px minmax(0,1fr); }
  .boost-loadout button { grid-column: 1 / -1; width: 100%; }
  .ranking-state { grid-template-columns: 34px minmax(0,1fr); }
  .ranking-state-actions { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 38px 31px minmax(0,1fr) auto; gap: 7px; padding-left: 9px; padding-right: 9px; }
  .rank-score { font-size: 12px; }
  .podium-avatar { width: 44px; height: 44px; }
  .podium-card.first .podium-avatar { width: 54px; height: 54px; }
  .podium-name { font-size: 9px; }
}

@media (max-height: 700px) {
  .game-screen { padding-top: calc(8px + var(--safe-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .launch-glow, .button-ring, .danger-button.cue-signal .button-ring { animation: none !important; }
}
.app-shell.reduce-motion .launch-glow,
.app-shell.reduce-motion .button-ring,
.app-shell.reduce-motion .danger-button.cue-signal .button-ring { animation: none !important; }

/* September playability pass: one clear primary action and compact preparation. */
.back-button.hidden + .brand-mini { grid-column: 1 / 3; justify-content: flex-start; }
#screen-home { padding-top: 10px; }
.home-hero { padding: 14px 4px 16px; }
.home-hero h1 span { font-size: clamp(30px,8.8vw,43px); }
.home-hero h1 strong { font-size: clamp(36px,10vw,51px); }
.home-hero p { font-size: 12px; margin-top: 12px; }
.home-hero .eyebrow { font-size: 9px; letter-spacing: .22em; }
.primary-launch { margin: 0 0 15px; min-height: 100px; padding: 16px 20px; border-radius: 20px; }
.primary-launch strong { font-size: 28px; }
.primary-launch small { font-size: 12px; }
.launch-button-art { position: absolute; right: 17px; top: 12px; width: 78px; height: 78px; border: 7px solid #42424a; border-radius: 50%; background: radial-gradient(circle at 35% 25%,#ffb7af,#f53539 36%,#8f0315 76%); box-shadow: 0 5px 0 #3c0610, inset 0 -5px 9px #530013, 0 10px 20px #6a0c1a; }
.launch-button-art::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; font-weight: 1000; color: #fff7ed; }
.practice-entry { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 10px 12px; margin: 0 0 13px; border: 1px solid rgba(57,168,255,.25); border-radius: 13px; background: rgba(18,35,50,.8); text-align: left; }
.practice-entry > span { color: #7bceff; font-size: 21px; }
.practice-entry strong { font-size: 13px; }
.practice-entry small { flex: 1; font-size: 11px; color: #b8c9db; }
.profile-strip { border-radius: 13px; margin-bottom: 14px; box-shadow: none; }
.profile-strip > div { padding: 9px 10px; }
.profile-strip .label { font-size: 10px; }
.profile-strip strong { font-size: 13px; }
.boost-loadout { margin: 12px 0; padding: 10px; grid-template-columns: 30px minmax(0,1fr) auto; }
.boost-loadout-icon { width: 30px; height: 30px; font-size: 15px; }
.boost-loadout button { grid-column: auto; width: auto; min-width: 60px; }
.boost-loadout-copy > span { display: none; }
.boost-loadout-copy strong { font-size: 12px; }
.boost-loadout-copy small { font-size: 10px; }
.rank-eligibility { font-size: 10px; margin-top: 4px; padding: 2px 6px; }
.section-heading h2 { font-size: 20px; }
.mode-grid { gap: 8px; }
.mode-card { min-height: 78px; padding: 11px 10px; gap: 9px; border-radius: 14px; }
.mode-icon { width: 34px; height: 38px; border-radius: 10px; font-size: 17px; }
.mode-card strong { font-size: 13px; }
.mode-card small { font-size: 11px; }
.daily-banner { padding: 12px; border-radius: 14px; }
.daily-copy .tag { display: none; }
.daily-copy strong { margin-top: 0; }
.daily-copy small { font-size: 11px; }
.next-skin-card { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 12px; align-items: center; margin: 14px 0; padding: 14px; border: 1px solid rgba(255,212,59,.23); border-radius: 16px; background: linear-gradient(120deg,rgba(51,39,15,.82),rgba(13,16,24,.93)); }
.next-skin-card .mini-button { width: 48px; height: 48px; }
.next-skin-card strong,.next-skin-card small,.next-skin-card [data-next-skin-shortfall] { display: block; }
.next-skin-card small { color: #eac96a; font-size: 9px; letter-spacing: .1em; }
.next-skin-card strong { font-size: 13px; margin: 3px 0; }
.next-skin-card [data-next-skin-price],.next-skin-card [data-next-skin-shortfall] { color: #c7c3b5; font-size: 11px; }
.next-skin-card .text-button { color: #fff0b2; background: rgba(255,212,59,.12); }
.shop-premium-card { margin: 0 0 16px; padding: 17px; border: 1px solid #99732e; background: radial-gradient(ellipse at top right,rgba(202,158,51,.22),transparent 65%),#171923; }
.premium-label { display: block; color: #eac96a; letter-spacing: .2em; font-size: 10px; font-weight: 900; margin-bottom: 7px; }
.shop-premium-card h3 { font-size: 19px; margin-bottom: 8px; }
.shop-premium-card p { color: #ddd9cf; }
.premium-actions { display: grid; gap: 8px; }
.premium-actions button { width: 100%; }
.shop-premium-card .secondary-action { background: #ffe6a2; }
#ranking-join-button { margin-bottom: 18px; }
#result-join-ranking-button { margin-top: 10px; }
.practice-status { display: flex; align-items: center; justify-content: space-between; color: #ffd43b; }
.practice-status button { min-height: 44px; }
.practice-screen .command-zone { min-height: 130px; padding: 20px 0 10px; }
.practice-screen .command-zone h2 { font-size: clamp(26px,7.3vw,36px); }
.practice-playfield { position: relative; display: grid; place-items: center; min-height: 240px; padding: 12px; }
.practice-playfield .danger-button { width: 210px; }
#practice-counter { position: absolute; right: 25px; top: 12px; color: #ffe49c; font-size: 23px; font-weight: 900; }
#practice-feedback { min-height: 46px; margin: 9px 0; text-align: center; color: #bcecd4; font-size: 14px; line-height: 1.6; }
.practice-actions { display: grid; gap: 10px; }
.practice-screen { padding-bottom: calc(25px + var(--safe-bottom)); }
.result-actions .primary-action { min-height: 55px; font-size: 19px; }
#screen-result.result-failed { background-image: linear-gradient(180deg,rgba(17,5,11,.48),rgba(4,6,10,.92)),url('assets/backgrounds/home-command-deck-v2.png'); }
#screen-result.result-failed .rank-emblem { filter: saturate(.55); }
@media (max-width:350px) { .practice-entry small { font-size: 10px; } .launch-button-art { width:65px; height:65px; top:20px; } .mode-card { gap:6px; } .mode-icon { width:27px; } }
@media (max-height:720px) { .home-hero { padding-top:8px; } .home-hero h1 span { font-size:30px; } .home-hero h1 strong { font-size:37px; } .practice-playfield { min-height:200px; } .practice-playfield .danger-button { width:180px; } }
