@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========== Design tokens ========== */
:root {
    --bg: #0f1115;
    --surface: #1a1d23;
    --surface-hover: #22262e;
    --border: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --radius: 6px;
    --transition: 0.2s ease;
    --accent: var(--primary);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
}

.hidden { display: none !important; }

.font-orbitron { font-family: inherit; }

/* ========== Screens ========== */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}
.screen.active { display: flex; }

.app-screen--menu {
    flex-direction: column;
    background: var(--bg);
}

.app-menu-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px 32px;
}

/* ========== Slim top bar ========== */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.app-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.geo-logotype {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
}

.geo-part {
    color: #00d1ff;
}

.master-part {
    color: #ffffff;
}

.app-topbar__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.top-nav-link {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.top-nav-link:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.app-topbar__end {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-coins {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.coin-icon { margin-right: 4px; opacity: 0.9; }

.menu-user-area { display: flex; align-items: center; }
.menu-user { display: flex; align-items: center; gap: 10px; }
.menu-guest-hint { font-size: 13px; color: var(--text-muted); }
.menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.menu-user-meta { text-align: left; }
.menu-player-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.menu-player-name { font-size: 13px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
}

.btn--primary {
    background: var(--primary);
    color: var(--text);
    border-color: var(--primary);
    padding: 12px 20px;
}
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    padding: 12px 20px;
}
.btn--secondary:hover { background: var(--surface-hover); }

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    padding: 8px 12px;
}
.btn--ghost:hover { color: var(--text); background: var(--surface); }

.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }

.menu-play-cta {
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
    font-size: 15px;
}

/* ========== Menu two-column grid (6+6) ========== */
.menu-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    flex: 1;
    min-height: 0;
    margin-top: 24px;
    align-items: start;
}

.menu-col--left { grid-column: span 6; }
.menu-col--right { grid-column: span 6; }

@media (max-width: 960px) {
    .menu-col--left,
    .menu-col--right { grid-column: span 12; }
    .app-topbar__nav { flex-wrap: wrap; }
}

.panel-surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.menu-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 280px;
}

.avatar-panel {
    flex: 1;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.avatar-panel__placeholder {
    width: 80px;
    height: 120px;
    border-radius: 40px 40px 12px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.avatar-panel__hint {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.wardrobe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wardrobe-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.menu-inline-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.wardrobe-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.wardrobe-tab {
    flex: 1;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.wardrobe-tab:hover { color: var(--text); }
.wardrobe-tab.active {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--primary);
}

.wardrobe-panels { flex: 1; min-height: 0; overflow: hidden; }
.wardrobe-panel { max-height: 320px; overflow-y: auto; }

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.store-card {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.rarity {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
    color: var(--text);
}
.rarity-legendary { background: #78350f; color: #fef3c7; }
.rarity-epic { background: #4c1d95; color: #e9d5ff; }
.rarity-rare { background: #1e3a5f; color: #bfdbfe; }

.store-card-thumb {
    height: 64px;
    border-radius: var(--radius);
    background: var(--surface-hover);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}
.store-card-thumb--2, .store-card-thumb--3, .store-card-thumb--4,
.store-card-thumb--anim, .store-card-thumb--anim2,
.store-card-thumb--emote, .store-card-thumb--emote2 {
    background: var(--surface);
}

.store-card-meta { display: flex; flex-direction: column; gap: 4px; }
.store-card-name { font-size: 13px; font-weight: 600; }
.store-card-price { font-size: 12px; color: var(--text-muted); }

/* ========== Auth modal ========== */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-modal.is-open { display: flex; }

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, 0.85);
}

.auth-modal-panel {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    padding: 28px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.auth-modal-close:hover { color: var(--text); background: var(--surface-hover); }

.auth-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.auth-modal-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.is-hidden { display: none; }

.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.auth-input {
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}
.auth-input:focus { border-color: var(--primary); }

.auth-message { font-size: 13px; min-height: 1.2em; color: #f87171; font-weight: 500; }
.auth-message.success { color: #4ade80; }

.auth-actions { display: flex; flex-direction: column; gap: 8px; }

.auth-divider {
    position: relative;
    text-align: center;
    margin: 8px 0;
}
.auth-divider::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: var(--border);
}
.auth-divider span {
    position: relative;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
}

.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: #0f1115;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}
.google-btn:hover { background: #f1f5f9; }
.google-btn img { width: 18px; height: 18px; }

.auth-logged-view.hidden { display: none; }
.auth-logged-view:not(.hidden) { display: flex; flex-direction: column; gap: 12px; }

/* ========== Rules screen ========== */
.app-screen--rules {
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.rules-shell {
    width: min(480px, 100%);
    padding: 32px;
    text-align: center;
}

.rules-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.rules-lead { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

.rules-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; text-align: left; }

.rule-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px;
    width: 100%;
    font-family: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.rule-card:hover { border-color: var(--primary); background: var(--surface-hover); }

.rule-card__name { font-size: 16px; font-weight: 700; color: var(--text); }
.rule-card__desc { font-size: 13px; color: var(--text-muted); font-weight: 400; }

.rules-back { margin: 0 auto; }

/* ========== Room modal ========== */
.room-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 21, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}
.room-modal.active { display: flex; }

.room-modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: min(440px, calc(100vw - 40px));
    text-align: center;
}

.room-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    text-align: center;
    outline: none;
}
.room-input:focus { border-color: var(--primary); }

.flex.gap-4 { display: flex; gap: 16px; }
.flex-1 { flex: 1; }

/* ========== Game screen ========== */
#game-screen { flex-direction: column; }

#pano {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}
#pano, #pano *, #map, #map * { cursor: default !important; }

/* ========== NMPZ Overlay (Blokada TYLKO Street View) ========== */
#pano-nmpz-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
    cursor: not-allowed !important;
    background: transparent;
    display: none;
}
#pano-nmpz-overlay.active {
    display: block;
    pointer-events: auto;
}

#map-wrapper {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    opacity: 0.5;
    transition: opacity 0.3s ease, width 0.25s ease;
    width: 320px;
    gap: 10px;
}

#map-wrapper:hover {
    opacity: 1.0;
    width: 560px;
}

#map {
    width: 100%;
    height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: height 0.25s ease;
    box-shadow: 0 14px 40px rgba(15, 17, 21, 0.24);
}

#map-wrapper:hover #map {
    height: 420px;
}

.guess-btn {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--text);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.guess-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.guess-btn.guess-ready {
    background-color: #61b832;
    color: white;
    opacity: 1 !important;
    border: none;
    font-weight: bold;
    border-radius: 6px;
}

.guess-btn.guess-ready:hover {
    background: #4ade80; /* dostosować kolor hover, może jaśniejszy */
}

.guess-btn.guess-ready--pulse {
    animation: readyGuessPulse 1.7s ease-in-out infinite;
}

@keyframes readyGuessPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(97, 184, 50, 0.35), 0 10px 22px rgba(97, 184, 50, 0.22); }
    50% { box-shadow: 0 0 0 8px rgba(97, 184, 50, 0.12), 0 14px 28px rgba(97, 184, 50, 0.35); }
}

.map-controls {
    position: absolute;
    inset: 8px;
    pointer-events: none;
}
.map-btn {
    pointer-events: auto;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--transition);
}
.map-btn:hover { background: var(--surface-hover); }
#btn-zoom-in { position: absolute; right: 0; top: 0; }
#btn-zoom-out { position: absolute; right: 0; top: 40px; }
#btn-flag-reset { position: absolute; left: 0; top: 0; }

/* ========== Compass (minimal) ========== */
#compass-stack {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

#compass-modern {
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 6px;
}

#compass-window {
    --px-per-deg: 2.2px;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

#compass-viewport {
    position: relative;
    width: 260px;
    height: 32px;
    overflow: hidden;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
}

#compass-strip {
    width: calc(1080 * var(--px-per-deg));
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    will-change: transform;
    transform: translateX(0);
    transition: none !important;
}

.compass-center-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: var(--primary);
    z-index: 5;
    pointer-events: none;
}

.compass-tick {
    position: absolute;
    top: 50%;
    width: 1px;
    height: 8px;
    border-radius: 0;
    background: var(--text-muted);
    transform: translate(-0.5px, -50%);
    z-index: 1;
    opacity: 0.6;
}
.compass-tick--minor { height: 6px; opacity: 0.45; }
.compass-tick--mid {
    height: 11px;
    width: 2px;
    opacity: 0.85;
    background: var(--text);
    transform: translate(-1px, -50%);
}

.compass-tick-label {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    z-index: 2;
    line-height: 1;
}

body.compass-both .compass-center-marker {
    background: var(--primary);
}

/* Classic compass */
#compass-classic {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    pointer-events: none;
}
.classic-compass-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
}
.classic-compass-dial { position: absolute; inset: 0; border-radius: 50%; }
.classic-compass-letter {
    position: absolute;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
}
.classic-n { left: 50%; top: 6px; transform: translateX(-50%); }
.classic-e { right: 8px; top: 50%; transform: translateY(-50%); }
.classic-s { left: 50%; bottom: 6px; transform: translateX(-50%); }
.classic-w { left: 8px; top: 50%; transform: translateY(-50%); }

.classic-compass-needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 72px;
    transform: translate(-50%, -50%);
}
.needle-north {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 28px solid #dc2626;
}
.needle-south {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 28px solid var(--text-muted);
}
.needle-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
    border: 1px solid var(--border);
}

/* Timer pill */
#timer-pill {
    pointer-events: none;
    min-width: 100px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
}
.timer-pill-text {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

/* ========== Settings ========== */
.btn-settings-fab,
#btn-settings {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 3000;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background var(--transition);
}
#btn-settings:hover { background: var(--surface-hover); }

.settings-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}
.settings-modal-overlay.is-open {
    display: flex;
}

.settings-panel {
    width: min(640px, calc(100vw - 32px));
    border-radius: 24px;
    padding: 28px 28px 24px;
    background: rgba(18, 20, 27, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    color: var(--text);
}

.settings-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.settings-panel-title {
    font-weight: 700;
    font-size: 28px;
}

.settings-panel-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

.settings-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 17, 21, 0.72);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.settings-close-btn:hover {
    background: rgba(31, 35, 46, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-section-label {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 10px;
}

.settings-slider-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 14, 20, 0.38);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.settings-slider-row input[type="range"] { width: 100%; }

.settings-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 14, 20, 0.38);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.settings-list-row {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 14, 20, 0.38);
}

.settings-list-row--stacked {
    display: flex;
    flex-direction: column;
}

.settings-switch {
    width: 50px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.38);
    background: rgba(91, 33, 182, 0.35);
    padding: 3px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition), border-color var(--transition);
}
.settings-switch.is-on {
    background: #7c3aed;
    border-color: #a78bfa;
}
.settings-switch__thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f8fafc;
    display: block;
    transform: translateX(0);
    transition: transform var(--transition);
}
.settings-switch.is-on .settings-switch__thumb {
    transform: translateX(18px);
}

.settings-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.settings-toggle-row--two {
    grid-template-columns: 1fr 1fr;
}

.settings-toggle-row--three {
    grid-template-columns: 1fr 1fr 1.35fr;
}

.settings-toggle-btn {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.settings-toggle-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.5);
}
.settings-toggle-btn.active {
    border-color: #8b5cf6;
    color: #ffffff;
    background: #7c3aed;
}

.settings-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.settings-resume,
.settings-leave {
    min-width: 190px;
    padding: 14px 22px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.settings-resume {
    border: 1px solid #22c55e;
    background: #22c55e;
    color: #04110a;
}
.settings-resume:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-1px);
}

.settings-leave {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(12, 14, 20, 0.62);
    color: var(--text);
}
.settings-leave:hover {
    background: rgba(30, 34, 44, 0.92);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.settings-slider-row input[type="range"] {
    accent-color: #8b5cf6;
}

/* ===== Custom range sliders (image_36.png style) ===== */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
}

input[type=range]:focus { outline: none; }

input[type=range]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 10px;
    background: #1a1a2e;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 24px;
    border-radius: 8px;
    background: #8b5cf6;
    border: none;
    margin-top: -8px; /* center thumb on 8px track */
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.28);
}

input[type=range]::-moz-range-track {
    height: 8px;
    border-radius: 10px;
    background: #1a1a2e;
}
input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 24px;
    border-radius: 8px;
    background: #8b5cf6;
    border: none;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.28);
}

#game-top-left-controls {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 3000;
    display: flex;
    gap: 10px;
}

.game-icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 17, 21, 0.82);
    color: var(--text);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.game-icon-btn:hover {
    background: rgba(26, 29, 35, 0.96);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.game-icon-btn__glyph {
    font-size: 20px;
    line-height: 1;
}

body.reduce-ui-animations *,
body.reduce-ui-animations *::before,
body.reduce-ui-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* ========== Overlays ========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 21, 0.88);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.overlay.active { display: flex; }

.overlay-content {
    animation: fadeMinimal 0.25s ease-out;
}
@keyframes fadeMinimal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    max-width: 480px;
    width: 100%;
    padding: 28px;
    text-align: center;
}

.result-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.result-msg { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }

.result-map {
    width: 100%;
    height: 260px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: hidden;
}

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; }

.game-over-overlay { text-align: center; }
.go-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.go-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; }

/* ========== LOBBY REDESIGN (Fortnite-Inspired) ========== */

/* Lobby Background with Street View Blur */
.lobby-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(20, 15, 35, 0.85) 100%),
                radial-gradient(circle at 30% 60%, rgba(79, 70, 229, 0.15) 0%, transparent 50%);
    backdrop-filter: blur(15px);
    filter: brightness(0.4);
    animation: bgRotate 80s linear infinite;
    z-index: 0;
}

@keyframes bgRotate {
    from { transform: rotate(0deg) scale(1.1); }
    to { transform: rotate(360deg) scale(1.1); }
}

/* Lobby Navbar (Sticky Top) */
.app-screen--menu {
    position: relative;
    overflow: hidden;
}

.lobby-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 21, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 0;
    font-family: 'Oswald', sans-serif;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    gap: 40px;
}

/* Navbar Brand Logo */
.navbar-brand {
    flex-shrink: 0;
}

.navbar-brand .geo-logotype {
    font-size: 28px;
    letter-spacing: -0.5px;
}

/* Navbar Links */
.navbar-links {
    display: flex;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.navbar-link {
    position: relative;
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
    letter-spacing: 0.5px;
}

.navbar-link:hover {
    color: #00d1ff;
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00d1ff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.navbar-link.active::after {
    opacity: 1;
}

/* Navbar End (User Info & Coins) */
.navbar-end {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.navbar-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffd700;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-nick-area {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

/* Main Lobby Content */
.lobby-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    padding: 32px;
    flex: 1;
    overflow-y: auto;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Glassmorphism Side Panels */
.lobby-side-panel {
    background: rgba(15, 17, 21, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Montserrat', sans-serif;
}

.panel-header {
    border-bottom: 2px solid rgba(0, 209, 255, 0.3);
    padding-bottom: 12px;
}

.panel-title {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #00d1ff;
    letter-spacing: 1px;
    margin: 0;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Player Info Panel (Left) */
.player-avatar-section {
    text-align: center;
    margin-bottom: 12px;
}

.player-avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(0, 209, 255, 0.2));
    border: 2px solid rgba(0, 209, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-section {
    background: rgba(0, 209, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 209, 255, 0.2);
}

.level-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.level-label {
    color: var(--text-muted);
}

.level-number {
    color: #00d1ff;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d1ff, #61b832);
    border-radius: 3px;
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.challenges-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.challenge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 2px solid #61b832;
}

.challenge-name {
    flex: 1;
    color: var(--text);
}

.challenge-progress {
    font-weight: 600;
    color: #61b832;
}

/* Right Panel Header with Collapse Button */
.panel-collapse-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-collapse-btn:hover {
    color: #00d1ff;
}

/* Friends List */
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.friend-item.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #61b832;
    border-radius: 50%;
    margin-left: 4px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(0, 209, 255, 0.2));
    border-radius: 6px;
    flex-shrink: 0;
}

.friend-meta {
    flex: 1;
    font-size: 12px;
}

.friend-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.friend-status {
    color: var(--text-muted);
    font-size: 11px;
}

/* Hero Area (Center) */
.lobby-hero-area {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(15, 17, 21, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-podium {
    position: relative;
    width: 200px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podium-light {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(0, 209, 255, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.podium-avatar {
    position: relative;
    z-index: 1;
    width: 160px;
    height: 240px;
    background: linear-gradient(135deg, rgba(0, 209, 255, 0.4), rgba(97, 184, 50, 0.2));
    border: 2px solid rgba(0, 209, 255, 0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0, 209, 255, 0.3);
}

/* Action Block (Bottom Right) */
.lobby-action-block {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(15, 17, 21, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    min-width: 260px;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-label {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mode-btn {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: rgba(0, 209, 255, 0.1);
    border-color: rgba(0, 209, 255, 0.3);
    color: #00d1ff;
}

.mode-btn.active {
    background: rgba(0, 209, 255, 0.2);
    border-color: #00d1ff;
    color: #00d1ff;
}

/* Giant Play Button */
.btn-play-cta {
    padding: 20px 32px;
    background: linear-gradient(135deg, #61b832 0%, #7ec850 100%);
    border: none;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(97, 184, 50, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-play-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(97, 184, 50, 0.4);
    background: linear-gradient(135deg, #7ec850 0%, #61b832 100%);
}

.btn-play-cta:active {
    transform: translateY(0);
}

.btn-play-text {
    font-size: 16px;
}
.go-menu { margin-top: 12px; }

/* ========== Loading ========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 5000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.loading-overlay.active { display: flex; }

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

/* ========== HUD & tracker ========== */
.top-hud {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 35;
    pointer-events: none;
    display: flex;
    justify-content: center;
}
.top-hud-inner {
    width: min(960px, calc(100vw - 40px));
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.hud-side { display: flex; align-items: center; gap: 10px; }
.hud-left { justify-content: flex-start; }
.hud-right { justify-content: flex-end; }
.hud-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
}

.hp { width: min(300px, 28vw); }
.hp-top { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.hp-name, .hp-value { font-weight: 600; color: var(--text); }
.hp-track {
    height: 8px;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}
.hp-fill {
    height: 100%;
    background: var(--primary);
}
.hp-fill-opponent {
    background: var(--text-muted);
}

#sp-tracker {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    pointer-events: none;
}
.sp-tracker-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.sp-cell {
    padding: 8px 6px;
    min-width: 64px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.sp-cell:last-child { border-right: none; }
.sp-label { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.sp-score { margin-top: 4px; font-size: 13px; font-weight: 700; }
.sp-time { margin-top: 2px; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.sp-cell.active {
    background: rgba(79, 70, 229, 0.15);
}

.timer-display { font-size: 28px; font-weight: 700; }
.timer-display.warning, .timer-display.danger { color: var(--primary); }

.hud-panel { background: var(--surface); border: 1px solid var(--border); }

.hp-bar-container { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.hp-bar { transition: width 0.6s ease; }

.hotkey-badge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.gm-style-iw button img { display: none !important; }

/* Legacy menu-btn for modals / room */
.menu-btn {
    background: var(--primary);
    color: var(--text);
    font-weight: 600;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), opacity var(--transition);
}
.menu-btn:hover { background: var(--primary-hover); }
.menu-btn.secondary {
    background: var(--surface);
    border: 1px solid var(--border);
}
.menu-btn.secondary:hover { background: var(--surface-hover); }
