:root {
  color-scheme: dark;
  --bg: #cfe4f2;
  --panel: rgba(14, 16, 22, 0.86);
  --panel-solid: #11131a;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f4f4f0;
  --muted: #9a9ca6;
  --accent: #d8ff3e;
  --accent-2: #9eee39;
  --danger: #ff5c72;
  --radius: 18px;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.3); backdrop-filter: blur(18px); }

.brand-fab { position: fixed; z-index: 1000; top: 14px; left: 14px; height: 58px; border-radius: 18px; display: flex; align-items: center; gap: 10px; padding: 8px 13px 8px 8px; color: var(--text); text-align: left; transition: transform .16s ease, background .16s ease; }
.brand-fab:hover { transform: translateY(-1px); background: rgba(14,16,22,.94); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #10120a; background: var(--accent); font-weight: 950; font-size: 22px; transform: rotate(-3deg); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 18px; letter-spacing: -.6px; }
.brand-copy small { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

.map-tools { position: fixed; z-index: 1100; top: 84px; left: 14px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(40,61,80,.16); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 5px 16px rgba(53,78,103,.2); backdrop-filter: blur(12px); }
.map-tool { width: 43px; height: 43px; display: grid; place-items: center; border: 0; border-bottom: 1px solid rgba(40,61,80,.12); color: #31445d; background: transparent; font-size: 20px; font-weight: 800; transition: background .15s ease, color .15s ease; }
.map-tool:first-child { color: #176be8; font-family: Georgia, serif; font-size: 18px; font-style: italic; }
.map-tool:last-child { border-bottom: 0; }
.map-tool:hover { color: #111; background: #fff; }
.map-debug { position: fixed; z-index: 1100; top: 230px; left: 14px; min-width: 112px; display: grid; gap: 2px; padding: 9px 11px; border-radius: 12px; color: var(--text); pointer-events: none; }
.map-debug span { color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.map-debug strong { font: 800 14px/1.25 ui-monospace, SFMono-Regular, Consolas, monospace; }
.map-debug small { color: var(--muted); font-size: 9px; line-height: 1.35; }

.map-actions { position: fixed; z-index: 1100; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 9px; }
.map-action { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(40,61,80,.16); border-radius: 50%; color: #31445d; background: rgba(255,255,255,.94); box-shadow: 0 5px 16px rgba(53,78,103,.2); backdrop-filter: blur(12px); transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.map-action:hover, .map-action[aria-expanded="true"] { transform: scale(1.06); background: #fff; box-shadow: 0 7px 22px rgba(53,78,103,.28); }
.action-glyph { font-size: 21px; line-height: 1; font-weight: 900; }
.map-search-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-trophy-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.search-glyph { position: relative; width: 19px; height: 19px; display: inline-block; border: 2px solid currentColor; border-radius: 50%; }
.search-glyph::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 7px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
.brand-glyph { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #162007; background: var(--accent); font-size: 16px; transform: rotate(-3deg); }
.action-badge { position: absolute; right: -4px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid white; border-radius: 99px; color: white; background: #3456b2; font-size: 9px; font-weight: 900; }
.resource-popover { position: fixed; z-index: 1090; top: 14px; right: 76px; width: 250px; padding: 15px; border-radius: 20px; }
.resource-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.resource-heading strong, .resource-heading small { display: block; }
.resource-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.resource-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px 0; color: var(--muted); font-size: 12px; }
.resource-row strong { color: var(--text); font-size: 14px; }
.profile-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; object-fit: cover; }
.popover-logout { width: 100%; margin-top: 13px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.045); font-size: 11px; font-weight: 800; }
.popover-logout:hover { color: var(--text); background: rgba(255,255,255,.09); }
.popover-my-tracks { width: 100%; margin-top: 13px; padding: 10px; border: 1px solid rgba(216,255,62,.35); border-radius: 10px; color: #10180a; background: var(--accent); font-size: 12px; font-weight: 900; cursor: pointer; }
.my-tracks-card { width: min(700px, 100%); }
.leaderboard-card { width: min(680px, 100%); }
.leaderboard-tabs, .leaderboard-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.leaderboard-tabs { padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.leaderboard-tabs button, .leaderboard-metrics button { border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 900; }
.leaderboard-tabs button { padding: 11px; }
.leaderboard-tabs button.active { color: #12170a; background: var(--accent); }
.leaderboard-metrics { margin-top: 11px; }
.leaderboard-metrics button { padding: 9px; border: 1px solid var(--line); }
.leaderboard-metrics button.active { color: var(--text); border-color: rgba(216,255,62,.52); background: rgba(216,255,62,.09); }
.leaderboard-note { margin: 13px 2px 11px; color: var(--muted); font-size: 11px; }
.leaderboard-list { display: grid; gap: 8px; }
.leaderboard-row { width: 100%; min-height: 66px; display: grid; grid-template-columns: 44px 50px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: rgba(255,255,255,.04); text-align: left; }
button.leaderboard-row:hover, button.leaderboard-row:focus-visible { border-color: rgba(216,255,62,.55); background: rgba(216,255,62,.07); outline: none; }
.leaderboard-row.top-three { border-color: rgba(255,213,77,.28); background: linear-gradient(90deg, rgba(255,198,47,.09), rgba(255,255,255,.035)); }
.leaderboard-rank { color: var(--muted); font-size: 12px; font-weight: 950; text-align: center; }
.leaderboard-row.top-three .leaderboard-rank { color: #ffe171; font-size: 15px; }
.leaderboard-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 12px; object-fit: cover; color: #172007; background: var(--accent); font-size: 18px; font-weight: 950; overflow: hidden; }
.leaderboard-copy { min-width: 0; }
.leaderboard-copy b, .leaderboard-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-copy b { font-size: 13px; }
.leaderboard-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.leaderboard-score { color: var(--accent); font-size: 12px; font-weight: 950; white-space: nowrap; }
.leaderboard-empty, .leaderboard-loading, .leaderboard-error { min-height: 190px; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: 12px; }
.leaderboard-pagination { display: grid; grid-template-columns: 78px 1fr 78px; align-items: center; gap: 8px; margin-top: 13px; }
.leaderboard-pagination button { padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.06); font-size: 11px; font-weight: 900; }
.leaderboard-pagination button:hover:not(:disabled) { border-color: rgba(216,255,62,.5); background: rgba(216,255,62,.09); }
.leaderboard-pagination button:disabled { cursor: default; opacity: .35; }
.leaderboard-pagination span { color: var(--muted); font-size: 10px; text-align: center; }
.my-tracks-note { margin: -8px 0 16px; color: var(--muted); font-size: 12px; }
.my-tracks-list { display: grid; gap: 10px; }
.my-track-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.04); }
.my-track-card.under-attack { border-color: rgba(255,103,60,.6); box-shadow: inset 0 0 24px rgba(255,74,35,.08); }
.my-track-cover { position: relative; align-self: start; width: 92px; height: 92px; }
.my-track-cover > img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.my-track-cover > .winner-crown { position: absolute; top: 0; left: 0; transform: translate(-24%,-62%) rotate(-18deg); transform-origin: 72% 92%; }
.my-track-cover > .winner-crown.crown-world { transform: translate(-22%,-60%) rotate(-16deg); }
.my-track-cover > .winner-crown.crown-continent { transform: translate(-23%,-61%) rotate(-17deg); }
.my-track-body { min-width: 0; }.my-track-title { display: flex; align-items: center; gap: 8px; }.my-track-title h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }.my-track-body > p { margin: 4px 0 9px; color: var(--muted); font-size: 11px; }
.my-track-status { padding: 3px 6px; border-radius: 6px; color: #182000; background: var(--accent); font-size: 9px; font-weight: 900; white-space: nowrap; }.my-track-status.extinct { color: #fff; background: var(--danger); }
.my-track-actions { position: relative; margin-left: auto; flex: 0 0 auto; }
.my-track-more { width: 30px; height: 28px; display: grid; place-items: center; padding: 0 0 8px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 18px; font-weight: 900; letter-spacing: 1px; line-height: 1; cursor: pointer; }
.my-track-more:hover, .my-track-more[aria-expanded="true"] { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.07); }
.my-track-menu { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; min-width: 92px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #171a20; box-shadow: 0 10px 28px rgba(0,0,0,.38); }
.my-track-menu button { width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; color: var(--text); background: transparent; font-size: 11px; font-weight: 800; text-align: left; cursor: pointer; }.my-track-menu button:hover { color: #111; background: var(--accent); }
.my-track-crowns { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 9px; }.my-track-crown { padding: 4px 7px; border: 1px solid rgba(255,207,74,.35); border-radius: 999px; color: #ffe69a; background: rgba(255,198,43,.1); font-size: 9px; font-weight: 900; white-space: nowrap; }
.my-track-battle-alert { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 7px 9px; border: 1px solid rgba(255,104,65,.38); border-radius: 9px; color: #fff4dc; background: rgba(143,30,8,.22); }.my-track-battle-icon { font-size: 17px; filter: drop-shadow(0 0 6px rgba(255,82,32,.75)); animation: invasion-flame 1.15s ease-in-out infinite alternate; }.my-track-battle-alert b, .my-track-battle-alert small { display: block; }.my-track-battle-alert b { font-size: 10px; }.my-track-battle-alert small { margin-top: 2px; color: #ffc7b5; font-size: 9px; }
@keyframes invasion-flame { from { transform: translateY(0) scale(1); filter: saturate(1) drop-shadow(0 0 4px rgba(255,82,32,.55)); } to { transform: translateY(-2px) scale(1.08); filter: saturate(1.4) drop-shadow(0 0 8px rgba(255,82,32,.85)); } }
.my-track-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 11px; }.my-track-card dt { color: var(--muted); font-size: 9px; }.my-track-card dd { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }.my-track-map-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-color: rgba(216,255,62,.22); color: var(--text); background: rgba(216,255,62,.075); font-size: 11px; }.my-track-map-button:hover { border-color: rgba(216,255,62,.48); background: rgba(216,255,62,.13); }.my-tracks-empty, .my-tracks-loading, .my-tracks-error { display: grid; place-items: center; gap: 15px; min-height: 180px; color: var(--muted); text-align: center; }.my-tracks-empty strong { color: var(--text); font-size: 17px; }
.track-search-panel { position: fixed; z-index: 1200; top: 14px; right: 76px; width: min(380px, calc(100vw - 100px)); max-height: calc(100vh - 28px); overflow-y: auto; padding: 17px; border-radius: 20px; }
.track-search-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.track-search-heading small, .track-search-heading strong { display: block; }
.track-search-heading small { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.track-search-heading strong { margin-top: 4px; font-size: 18px; }
.track-search-input { height: 46px; display: flex; align-items: center; gap: 11px; margin-top: 15px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.05); }
.track-search-input:focus-within { color: var(--accent); border-color: rgba(216,255,62,.6); }
.track-search-input .search-glyph { width: 15px; height: 15px; flex: 0 0 15px; }
.track-search-input input { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.track-search-input input:focus { border-color: transparent; }
.track-search-hint { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.map-track-search-results { display: grid; gap: 8px; margin-top: 12px; }
.map-track-search-result { width: 100%; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.045); text-align: left; }
.map-track-search-result:hover, .map-track-search-result:focus-visible { border-color: rgba(216,255,62,.58); background: rgba(216,255,62,.07); outline: none; }
.map-track-search-result img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; }
.map-track-search-result span { min-width: 0; }
.map-track-search-result b, .map-track-search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-track-search-result b { font-size: 12px; }
.map-track-search-result small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.map-track-search-result em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 900; white-space: nowrap; }
.profile-action.logged-out { color: #31445d; }
.profile-action.logged-out .brand-glyph { position: relative; width: 24px; height: 24px; border-radius: 0; color: inherit; background: transparent; transform: none; }
.profile-action.logged-out .brand-glyph::before { content: ""; position: absolute; top: 1px; left: 50%; width: 7px; height: 7px; border: 2px solid currentColor; border-radius: 50%; transform: translateX(-50%); }
.profile-action.logged-out .brand-glyph::after { content: ""; position: absolute; bottom: 1px; left: 50%; width: 17px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 11px 11px 3px 3px; transform: translateX(-50%); }
.profile-action.logged-out .action-badge { display: none; }
.coin-dot { width: 10px; height: 10px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #ffd65a; }
button.primary, button.secondary { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 800; transition: .16s ease; }
button.primary { color: #11140a; background: var(--accent); } button.primary:hover { background: #e5ff75; transform: translateY(-1px); }
button.secondary { background: rgba(255,255,255,.08); border: 1px solid var(--line); } button.secondary:hover { background: rgba(255,255,255,.14); }
button.full { width: 100%; padding: 15px; }

main, #map { width: 100%; height: 100%; }
.leaflet-container { background: #b7d7ed; font-family: inherit; }
.leaflet-tile-pane { filter: none; }
.leaflet-control-zoom { overflow: hidden; border: 1px solid rgba(40,61,80,.16) !important; border-radius: 13px !important; box-shadow: 0 5px 16px rgba(53,78,103,.18) !important; }
.leaflet-control-zoom a { background: rgba(255,255,255,.94) !important; color: #31445d !important; border-color: rgba(40,61,80,.12) !important; }
.leaflet-control-attribution { background: rgba(255,255,255,.78) !important; color: #6f7e8d !important; }
.leaflet-control-attribution a { color: #46647f !important; }

.panel-heading { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.panel-heading small { color: var(--accent); font-weight: 800; font-size: 10px; letter-spacing: .14em; }
.panel-heading h2 { margin: 4px 0 16px; font-size: 22px; letter-spacing: -.7px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 20px; }

.register-cta { position: fixed; z-index: 1000; left: 50%; bottom: 18px; transform: translateX(-50%); min-width: 190px; height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 20px; border: 0; border-radius: 99px; color: #10180a; background: var(--accent); box-shadow: 0 10px 28px rgba(34,54,71,.3), inset 0 -2px 0 rgba(84,116,0,.18); transition: transform .16s ease, background .16s ease, opacity .12s ease; }
.register-cta:hover { transform: translateX(-50%) translateY(-2px); background: #e5ff75; }
.register-cta.toast-covered { visibility: hidden; opacity: 0; pointer-events: none; }
.register-cta strong { font-size: 17px; }
.register-cta small { padding-left: 8px; border-left: 1px solid rgba(16,24,10,.2); font-size: 11px; font-weight: 900; }
.register-icon { font-size: 25px; line-height: 1; font-weight: 500; }
.player-card { position: fixed; z-index: 900; right: 78px; top: 14px; width: min(540px, calc(100vw - 106px)); border-radius: 22px; padding: 18px; }
.player-close { position: absolute; right: 10px; top: 10px; z-index: 2; }
.player-share { position: absolute; z-index: 2; right: 50px; top: 10px; height: 32px; display: inline-flex; align-items: center; gap: 5px; padding: 0 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); background: rgba(255,255,255,.08); font-size: 11px; font-weight: 850; }
.player-share:hover { background: rgba(255,255,255,.14); }
.player-share span { font-size: 15px; line-height: 1; }
.player-info { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding-right: 104px; margin-bottom: 14px; }
.player-info img { width: 72px; height: 72px; border-radius: 15px; object-fit: cover; }
.player-info small { color: var(--accent); font-size: 11px; font-weight: 800; }.player-info h3 { margin: 3px 0; font-size: 23px; }.player-info p { margin: 0; color: var(--muted); }
.youtube-player { width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; }
.youtube-player iframe { display: block; width: 100%; height: 100%; border: 0; }
.youtube-failure { width: 100%; height: 100%; display: grid; place-content: center; gap: 7px; padding: 28px; text-align: center; color: var(--text); background: rgba(255,94,94,.08); border: 1px solid rgba(255,94,94,.25); }
.youtube-failure b { font-size: 15px; }.youtube-failure span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.youtube-replace { width: 100%; margin-top: 11px; }
.play-progress { margin-top: 13px; }.progress-copy { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }.progress-copy strong { color: var(--text); }
.progress-track { margin-top: 7px; height: 7px; background: rgba(255,255,255,.09); border-radius: 9px; overflow: hidden; }.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }
.influence-burst { position: relative; margin-top: 12px; text-align: center; }
.influence-actions { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.influence-actions button { height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; user-select: none; touch-action: none; transition: transform .08s ease, filter .12s ease, background .12s ease; }
.influence-single { color: #10140a; background: var(--accent); box-shadow: inset 0 -3px 0 rgba(63,84,0,.18), 0 8px 24px rgba(0,0,0,.22); }
.influence-bulk-open { flex-direction: column; gap: 1px !important; border: 1px solid rgba(216,255,62,.36) !important; color: var(--accent); background: rgba(216,255,62,.1); }
.influence-actions button:hover { filter: brightness(1.08); }
.influence-actions button:active, .influence-actions button.is-spending { transform: scale(.975); filter: brightness(.96); }
.influence-actions button:disabled { cursor: not-allowed; filter: grayscale(.65); opacity: .48; transform: none; }
.influence-single > span { font-size: 24px; line-height: 1; }.influence-single strong { font-size: 15px; }.influence-single small { padding-left: 9px; border-left: 1px solid rgba(16,20,10,.22); font-size: 11px; font-weight: 900; }
.influence-bulk-open > span { font-size: 16px; line-height: 1; }.influence-bulk-open strong { font-size: 11px; }
.influence-burst p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.influence-pop-layer { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.influence-pop { position: absolute; left: 50%; top: 7px; z-index: 3; color: var(--accent); font-size: 22px; font-weight: 950; text-shadow: 0 2px 8px #000, 0 0 12px rgba(216,255,62,.8); animation: influence-pop .72s cubic-bezier(.16,.8,.3,1) forwards; }
@keyframes influence-pop { 0% { opacity: 0; transform: translate(calc(-50% + var(--pop-x)), 12px) scale(.65) rotate(var(--pop-r)); } 18% { opacity: 1; transform: translate(calc(-50% + var(--pop-x)), 0) scale(1.15) rotate(var(--pop-r)); } 100% { opacity: 0; transform: translate(calc(-50% + var(--pop-x)), -66px) scale(1.35) rotate(var(--pop-r)); } }
.influence-bulk-card { width: min(440px, 100%); }
.influence-bulk-card .panel-heading h2 { margin-bottom: 10px; }
.influence-bulk-card > p { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.55; }.influence-bulk-card > p strong { color: var(--text); }
.influence-bulk-balance { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid rgba(216,255,62,.2); border-radius: 13px; background: rgba(216,255,62,.055); font-size: 12px; }.influence-bulk-balance span { color: var(--muted); }.influence-bulk-balance strong { color: var(--accent); font-size: 17px; }
.influence-bulk-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }.influence-bulk-presets button { padding: 9px 5px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.055); font-size: 11px; font-weight: 900; }.influence-bulk-presets button:hover, .influence-bulk-presets button.active { border-color: rgba(216,255,62,.55); color: var(--accent); background: rgba(216,255,62,.1); }.influence-bulk-presets button:disabled { cursor: not-allowed; opacity: .35; }
.influence-bulk-input { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.04); font-size: 12px; font-weight: 800; }.influence-bulk-input:focus-within { border-color: rgba(216,255,62,.65); }.influence-bulk-input > span:last-child { display: flex; align-items: center; gap: 6px; }.influence-bulk-input input { width: 150px; padding: 0; border: 0; color: var(--text); background: transparent; font-size: 22px; font-weight: 950; text-align: right; outline: 0; }.influence-bulk-input b { color: var(--accent); }
.influence-bulk-summary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 10px; padding: 14px; border-radius: 13px; color: var(--text); background: rgba(0,0,0,.2); font-size: 13px; }.influence-bulk-summary span { text-align: right; font-weight: 900; }.influence-bulk-summary i { color: var(--muted); font-style: normal; }.influence-bulk-summary strong { color: var(--accent); }
.influence-bulk-card .influence-bulk-note { margin: 9px 2px 0; font-size: 10px; line-height: 1.5; }
.influence-bulk-progress { margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); }.influence-bulk-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }.influence-bulk-progress span { color: var(--muted); }.influence-bulk-progress .progress-track { margin-top: 9px; }
.influence-bulk-actions { display: grid; grid-template-columns: 90px 1fr; gap: 8px; margin-top: 14px; }.influence-bulk-actions button { min-height: 46px; }.influence-bulk-actions button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.region-marker { position: relative; transform: translate(calc(-50% + var(--marker-offset-x, 0px)),calc(-50% + var(--marker-offset-y, 0px))); display: inline-flex; flex-direction: column; align-items: flex-start; max-width: 190px; color: #17191f; white-space: nowrap; }
.region-card { position: relative; display: flex; align-items: center; gap: 7px; max-width: 190px; padding: 5px 9px 5px 5px; border: 1px solid rgba(20,25,35,.16); border-radius: 11px; background: rgba(255,255,255,.92); box-shadow: 0 5px 18px rgba(30,40,55,.16); }
.region-marker.pixel-overlap { transform: translate(-50%,calc(-100% - 12px)); }
.region-marker.pixel-overlap::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 1px; height: 8px; background: rgba(20,25,35,.55); }
.region-marker.tag-selected { filter: brightness(1.08); }
.region-marker.tag-selected .region-card { box-shadow: 0 0 0 3px rgba(216,255,62,.72), 0 8px 26px rgba(30,40,55,.26); }
.region-marker.tag-selected .region-card::before { content: ""; position: absolute; inset: -5px; border: 2px solid var(--accent); border-radius: 15px; pointer-events: none; opacity: .85; }
.region-marker.tag-clicked { animation: tag-click-flash 1.1s ease-out; }
.region-marker.tag-clicked::before { content: ""; position: absolute; inset: -5px; border: 3px solid var(--accent); border-radius: 15px; pointer-events: none; animation: tag-click-ring 1.1s ease-out; }
@keyframes tag-click-flash { 0%,100% { filter: brightness(1); } 18%,48% { filter: brightness(1.25); box-shadow: 0 0 0 3px rgba(216,255,62,.5), 0 8px 28px rgba(30,40,55,.28); } }
@keyframes tag-click-ring { 0% { opacity: 1; transform: scale(.94); } 72% { opacity: .7; } 100% { opacity: 0; transform: scale(1.22); } }
.cover-slot { width: 28px; height: 28px; flex: 0 0 28px; }
.region-marker .cover { width: 100%; height: 100%; border-radius: 7px; background-position: center; background-size: cover; }
.region-marker .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.region-marker .label b { display: block; color: #111; font-size: 11px; }
.region-marker .label span { color: #626775; }
.region-marker .region-caption { position: static; max-width: calc(100% - 8px); margin: 3px 0 0 4px; overflow: hidden; color: #56708a; font-size: 9px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(255,255,255,.95), 0 0 5px #fff; }
.region-marker .region-country-caption { width: fit-content; max-width: calc(100% - 8px); display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; padding: 3px 6px; overflow: hidden; border: 1px solid rgba(86,112,138,.2); border-radius: 8px; color: #36506a; background: rgba(227,235,241,.78); box-shadow: 0 2px 6px rgba(39,57,73,.1); font-weight: 700; text-shadow: none; backdrop-filter: blur(3px); }
.region-country-caption > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-flag { display: inline-block; width: 12px; height: 9px; margin-right: 2px; object-fit: cover; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(25,42,58,.18); }
.region-country-caption .country-flag { flex: 0 0 12px; margin: 0; vertical-align: initial; }
.winner-crown { z-index: 2; display: block; width: 23px; pointer-events: none; }
.region-card > .winner-crown { position: absolute; top: 0; left: 0; transform: translate(-24%,-62%) rotate(-18deg); transform-origin: 72% 92%; }
.winner-crown svg { display: block; width: 100%; height: auto; overflow: visible; }
.winner-crown .crown-body { fill: #e7aa13; }
.winner-crown.crown-world { width: 28px; transform: translate(-22%,-60%) rotate(-16deg); }
.winner-crown.crown-world .crown-body { fill: #2449a8; }
.winner-crown.crown-world .crown-band, .winner-crown.crown-continent .crown-band { fill: #f1c55a; }
.winner-crown.crown-world .crown-globe { fill: #3b8eea; stroke: #f5d66d; stroke-width: 1; }
.winner-crown.crown-world .crown-land { fill: #72c867; }
.winner-crown.crown-world .crown-sparkle { fill: #e9aa16; }
.winner-crown.crown-continent { width: 26px; transform: translate(-23%,-61%) rotate(-17deg); }
.winner-crown.crown-continent .crown-body { fill: #00947e; }
.winner-crown.crown-continent .crown-jewel { fill: #f4bb32; }
.region-level-1 .winner-crown .crown-body { fill: #9da5ae; }
.region-level-2 .winner-crown .crown-body { fill: #bd6f3f; }
.region-marker.region-level-2, .region-marker.region-level-2 .region-card { max-width: 155px; }
.region-marker.region-level-2 .region-card { padding-right: 7px; }
.region-marker.region-level-2 .cover-slot { width: 24px; height: 24px; flex-basis: 24px; }
.battle-marker { position: relative; transform: translate(-50%,-100%); width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid rgba(255,112,36,.92); border-radius: 15px; color: #fff; background: rgba(45,20,18,.92); box-shadow: 0 0 0 4px rgba(255,84,28,.14), 0 9px 28px rgba(118,31,10,.42); animation: battle-marker-pulse 1.8s ease-in-out infinite; }
.battle-marker.battle-overview { transform: translate(-50%,calc(-100% - 34px)); }
.battle-marker::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; background: rgba(45,20,18,.92); border-right: 2px solid rgba(255,112,36,.92); border-bottom: 2px solid rgba(255,112,36,.92); transform: translateX(-50%) rotate(45deg); }
.battle-marker > span { font-size: 27px; filter: drop-shadow(0 0 7px rgba(255,126,34,.9)); animation: battle-flame 1s ease-in-out infinite alternate; }
.battle-popup { min-width: 190px; display: grid; gap: 6px; color: #222; }.battle-popup > strong { padding-bottom: 5px; border-bottom: 1px solid rgba(0,0,0,.12); }.battle-popup span, .battle-popup small { display: block; }.battle-popup small { color: #717171; }
@keyframes battle-marker-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.15); box-shadow: 0 0 0 6px rgba(255,84,28,.12), 0 10px 32px rgba(118,31,10,.52); } }
@keyframes battle-flame { from { transform: translateY(1px) rotate(-3deg) scale(.96); } to { transform: translateY(-2px) rotate(3deg) scale(1.08); } }
.pin-preview { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 3px solid #111; box-shadow: 0 6px 20px #000; }
.pin-preview.pin-checking { background: #fff; animation: pin-checking .7s ease-in-out infinite alternate; }
.pin-preview.pin-invalid { background: #ff5e5e; animation: pin-invalid .1s linear 7; }
@keyframes pin-checking { from { filter: brightness(.82); transform: rotate(-45deg) scale(.9); } to { filter: brightness(1.15); transform: rotate(-45deg) scale(1.08); } }
@keyframes pin-invalid { 0%,100% { transform: translateX(0) rotate(-45deg); } 25% { transform: translateX(-3px) rotate(-45deg); } 50% { transform: translateX(3px) rotate(-45deg); } 75% { transform: translateX(-2px) rotate(-45deg); } }

.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(4,5,8,.66); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(8px); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 24px; padding: 22px; }
.onboarding-modal { z-index: 2500; background: radial-gradient(circle at 50% 35%, rgba(75,110,143,.24), transparent 38%), rgba(4,8,13,.68); }
.onboarding-card { position: relative; width: min(700px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 30px; padding: 34px; text-align: center; background: linear-gradient(145deg, rgba(18,22,29,.96), rgba(9,11,16,.94)); animation: onboarding-arrive .42s cubic-bezier(.16,.8,.3,1) both; }
.onboarding-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.onboarding-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.onboarding-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.onboarding-brand strong { font-size: 17px; letter-spacing: -.4px; }
.onboarding-kicker { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.onboarding-card h1 { margin: 9px 0 0; font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.055em; }
.onboarding-card > p { margin: 14px auto 0; color: #b9bbc3; font-size: 14px; line-height: 1.6; }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; text-align: left; }
.onboarding-steps li { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.04); }
.onboarding-steps li div { min-width: 0; }
.onboarding-steps small, .onboarding-steps strong { display: block; }
.onboarding-steps small { margin-bottom: 4px; color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.onboarding-steps strong { font-size: 12px; line-height: 1.45; word-break: keep-all; }
.onboarding-step-icon { position: relative; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; background: rgba(216,255,62,.1); }
.onboarding-step-icon.seed::before { content: ""; position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); }
.onboarding-step-icon.seed::after { content: "+"; position: absolute; right: 3px; top: -4px; color: var(--accent); font-size: 17px; font-weight: 900; }
.onboarding-step-icon.listen::before { content: ""; position: absolute; left: 10px; top: 9px; width: 15px; height: 18px; border: 2px solid var(--accent); border-radius: 9px 9px 7px 7px; }
.onboarding-step-icon.listen::after { content: "30"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); font-size: 9px; font-weight: 950; }
.onboarding-step-icon.claim { background: linear-gradient(90deg, var(--accent) 0 46%, transparent 46% 54%, rgba(216,255,62,.45) 54%), linear-gradient(0deg, var(--accent) 0 46%, transparent 46% 54%, rgba(216,255,62,.45) 54%); transform: scale(.74); box-shadow: 0 0 22px rgba(216,255,62,.18); }
.onboarding-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
.onboarding-actions button { min-height: 50px; }
.onboarding-actions .primary { display: flex; align-items: center; justify-content: center; gap: 8px; }
.onboarding-footnote { display: block; margin-top: 12px; color: #777a84; font-size: 10px; }
@keyframes onboarding-arrive { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card { position: relative; width: min(390px, 100%); padding: 34px 30px 28px; text-align: center; }
.login-close { position: absolute; top: 12px; right: 12px; }
.login-logo { margin: 0 auto 15px; }
.login-card h2 { margin: 0; font-size: 24px; }
.login-card > p { margin: 10px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.google-login, .dev-login { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; color: #202124; background: #fff; text-decoration: none; font-size: 14px; }
.google-login span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #4285f4; border: 1px solid #dadce0; font-weight: 900; }
.google-login.disabled { pointer-events: none; opacity: .42; filter: grayscale(1); }
.dev-login { margin-top: 9px; color: var(--text); background: rgba(255,255,255,.07); cursor: pointer; }
.login-card > small { display: block; margin-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
#registration-modal { place-items: stretch end; padding: 16px; background: linear-gradient(90deg, transparent 0, transparent calc(100% - 520px), rgba(4,5,8,.28) 100%); backdrop-filter: none; pointer-events: none; }
#registration-modal .modal-card { width: min(440px, 100%); height: 100%; max-height: none; border-radius: 24px; pointer-events: auto; }
.selected-place { display: flex; justify-content: space-between; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 12px; padding: 11px 12px; margin-bottom: 14px; font-size: 12px; }.selected-place span { color: var(--muted); }
form { display: flex; flex-direction: column; gap: 13px; } form label > span { display: block; color: var(--muted); font-size: 11px; margin: 0 0 6px 2px; }
.youtube-validation-note { display: block; margin: 6px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.youtube-validation-note.error { color: #ff8c8c; }
.youtube-validation-note.success { color: var(--accent); }
.youtube-probe { position: fixed; left: -10000px; top: 0; width: 320px; height: 180px; opacity: .01; pointer-events: none; }
.recovery-card { width: min(430px, 100%); }.recovery-card > p { color: var(--muted); font-size: 12px; }
.track-edit-card { width: min(460px, 100%); }.track-edit-card > p { margin: -6px 0 15px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.track-edit-upload { min-height: 180px; }.track-edit-upload-copy { position: absolute; right: 0; bottom: 0; left: 0; padding: 34px 14px 13px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.88)); text-shadow: 0 1px 3px #000; }.track-edit-upload-copy small { color: rgba(255,255,255,.72); }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; color: var(--text); background: rgba(255,255,255,.045); outline: none; } input:focus, textarea:focus { border-color: rgba(216,255,62,.65); } textarea { min-height: 72px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.existing-track-results { display: grid; gap: 7px; margin-top: -5px; padding: 10px; border: 1px solid rgba(216,255,62,.23); border-radius: 13px; background: rgba(8,10,14,.56); }
.existing-track-results > small { color: var(--accent); font-size: 10px; font-weight: 800; }
.existing-track-result { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.045); text-align: left; cursor: pointer; }
.existing-track-result:hover, .existing-track-result:focus-visible { border-color: rgba(216,255,62,.6); background: rgba(216,255,62,.07); outline: none; }
.existing-track-result img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.existing-track-result span { min-width: 0; }
.existing-track-result b, .existing-track-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-track-result b { font-size: 11px; }
.existing-track-result small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.existing-track-result em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.upload-box { min-height: 130px; border: 1px dashed rgba(216,255,62,.45); border-radius: 14px; display: grid; place-items: center; overflow: hidden; position: relative; cursor: pointer; background: rgba(216,255,62,.035); text-align: center; }.upload-box input { position: absolute; opacity: 0; pointer-events: none; }.upload-box b, .upload-box small { display: block; }.upload-box small { color: var(--muted); margin-top: 5px; }.upload-box img { width: 100%; height: 180px; object-fit: cover; }
.pixel-growth-note { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid rgba(216,255,62,.2); border-radius: 12px; background: rgba(216,255,62,.055); }
.pixel-growth-note p { margin: 0; }
.pixel-growth-note b, .pixel-growth-note small { display: block; }
.pixel-growth-note b { color: var(--text); font-size: 12px; }
.pixel-growth-note small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pixel-growth-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 7px; background: linear-gradient(90deg, var(--accent) 0 46%, transparent 46% 54%, var(--accent) 54%), linear-gradient(0deg, var(--accent) 0 46%, transparent 46% 54%, var(--accent) 54%); box-shadow: 0 0 18px rgba(216,255,62,.14); }
.store-note { color: var(--muted); font-size: 12px; margin-top: -5px; }.store-items { display: grid; gap: 10px; }.store-items article { display: grid; grid-template-columns: 68px 1fr auto; gap: 12px; align-items: center; padding: 13px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 15px; }.store-items h3 { margin: 0 0 4px; font-size: 15px; }.store-items p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }.store-art { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 15px; font-weight: 950; font-size: 21px; color: #111; }.store-art.permanent { background: var(--accent); }.store-art.refill { background: #68d5ff; }
.help-card { width: min(500px, 100%); }
.help-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: help; }
.help-steps li { position: relative; min-height: 68px; padding: 13px 13px 13px 56px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.04); counter-increment: help; }
.help-steps li::before { content: counter(help); position: absolute; left: 13px; top: 14px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #111; background: var(--accent); font-weight: 900; }
.help-steps b, .help-steps span { display: block; }
.help-steps span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.map-info-card { width: min(500px, 100%); }
.current-map-rule { padding: 15px; border: 1px solid rgba(216,255,62,.3); border-radius: 16px; background: rgba(216,255,62,.06); }
.current-map-rule span, .current-map-rule strong, .current-map-rule small { display: block; }
.current-map-rule span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.current-map-rule strong { margin-top: 5px; font-size: 17px; }
.current-map-rule small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.map-rule-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.map-rule-list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); }
.map-rule-list b { font-size: 12px; }.map-rule-list span { color: var(--muted); font-size: 11px; text-align: right; }
.toast { position: fixed; z-index: 3000; left: 50%; bottom: 18px; transform: translateX(-50%); min-width: min(360px, calc(100vw - 32px)); min-height: 58px; display: grid; place-items: center; color: #111; background: var(--accent); border-radius: 99px; padding: 12px 22px; text-align: center; font-size: 13px; font-weight: 800; box-shadow: 0 10px 28px rgba(34,54,71,.32); }

@media (max-width: 760px) {
  .brand-fab { top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); width: 48px; height: 48px; padding: 4px; border-radius: 15px; }
  .brand-fab .brand-mark { width: 38px; height: 38px; }.brand-copy { display: none; }
  .map-tools { top: calc(max(8px, env(safe-area-inset-top)) + 56px); left: max(8px, env(safe-area-inset-left)); border-radius: 14px; }.map-tool { width: 40px; height: 40px; }
  .map-debug { display: none; }
  .map-actions { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); gap: 7px; }.map-action { width: 43px; height: 43px; }
  .resource-popover { top: calc(max(8px, env(safe-area-inset-top)) + 51px); right: max(8px, env(safe-area-inset-right)); width: min(300px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
  .track-search-panel { top: auto; right: max(8px, env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); width: auto; max-height: min(58dvh, 460px); padding: 14px; border-radius: 20px; }
  .player-card { top: auto; right: max(8px, env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); width: auto; max-height: min(72dvh, calc(100dvh - 92px)); overflow-y: auto; border-radius: 20px 20px 16px 16px; }
  .player-info { grid-template-columns: 60px minmax(0, 1fr); gap: 11px; }.player-info img { width: 60px; height: 60px; border-radius: 13px; }.player-info h3 { overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
  .register-cta { bottom: max(12px, env(safe-area-inset-bottom)); min-width: 174px; height: 54px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 8px; }.modal-card { max-height: calc(100vh - 16px); padding: 17px; }
  .onboarding-card { max-height: calc(100vh - 16px); padding: 25px 17px 19px; border-radius: 24px; }
  .onboarding-brand { margin-bottom: 14px; }
  .onboarding-card h1 { font-size: clamp(30px, 10vw, 40px); }
  .onboarding-card > p { max-width: 290px; font-size: 12px; }
  .onboarding-steps { grid-template-columns: 1fr; gap: 7px; margin-top: 20px; }
  .onboarding-steps li { padding: 10px 12px; }
  .onboarding-step-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .onboarding-step-icon.seed::before { left: 9px; top: 8px; width: 16px; height: 16px; }
  .onboarding-step-icon.listen::before { left: 9px; top: 8px; }
  .onboarding-actions { grid-template-columns: 1fr; }
  #registration-modal { place-items: end stretch; padding: 8px; background: linear-gradient(180deg, transparent 0, transparent 24%, rgba(4,5,8,.32) 100%); }
  #registration-modal .modal-card { width: 100%; height: auto; max-height: 64vh; border-radius: 22px; }
  .store-items article { grid-template-columns: 58px 1fr; }.store-art { width: 58px; height: 58px; }.store-buy { grid-column: 1 / -1; }
  .leaderboard-card { width: 100%; height: calc(100vh - 16px); max-height: none; border-radius: 22px; }
  .leaderboard-row { grid-template-columns: 36px 44px minmax(0,1fr); gap: 8px; padding: 8px; }.leaderboard-avatar { width: 44px; height: 44px; }.leaderboard-score { grid-column: 3; margin-top: -4px; }
  .my-track-card { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }.my-track-cover { width: 68px; height: 68px; }.my-track-card dl { gap: 5px; }.my-track-title h3 { font-size: 13px; }
}

/* Tablet: keep the map visible while panels use a stable, touch-friendly width. */
@media (min-width: 761px) and (max-width: 1023px) {
  .brand-fab { top: 12px; left: 12px; }
  .map-tools { top: 82px; left: 12px; }
  .map-debug { top: 226px; left: 12px; }
  .map-actions { top: 12px; right: 12px; gap: 8px; }
  .map-action { width: 46px; height: 46px; }
  .resource-popover { top: 12px; right: 70px; }
  .track-search-panel { top: 12px; right: 70px; width: min(360px, calc(100vw - 94px)); }
  .player-card { top: auto; right: 12px; bottom: 18px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 36px); overflow-y: auto; }
  #registration-modal { padding: 12px; }
  #registration-modal .modal-card { width: min(420px, 52vw); }
  .modal { padding: 16px; }
  .modal-card { max-height: calc(100dvh - 32px); }
  .onboarding-card { width: min(680px, calc(100vw - 32px)); }
  .onboarding-steps { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .register-cta { min-width: 164px; padding: 0 16px; }
  .register-cta strong { font-size: 15px; }
  .panel-heading h2 { font-size: 20px; }
  .leaderboard-tabs button, .leaderboard-metrics button { font-size: 11px; }
  .map-rule-list li { align-items: flex-start; flex-direction: column; gap: 4px; }
  .map-rule-list span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-card { animation: none; }
}
