/* ═══════════════════════════════════════════════════════
   RusGuessr Mobile — CSS
   Mobile-first, touch-friendly
═══════════════════════════════════════════════════════ */

/* ═══ RESET ═══ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #131836;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-card: rgba(19, 24, 54, 0.7);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-purple: #7c3aed;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.2s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 56px;
    --bottom-nav-height: 64px;
}

html, body {
    height: 100%;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

body {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ═══ BACKGROUND ═══ */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.12) 0%, transparent 50%);
}
.bg-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent);
    background-size: 200% 200%;
    opacity: 0.3;
}

/* ═══ HEADER ═══ */
.m-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 100;
}
.m-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}
.m-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}
.m-logo-icon { font-size: 1.5rem; }
.m-logo-accent {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.m-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.m-auth-buttons { display: flex; gap: 8px; }
.m-user-menu { position: relative; }
.m-user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.m-user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    overflow: hidden;
}
.m-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ USER DROPDOWN ═══ */
.m-user-dropdown {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    right: 12px;
    width: calc(100vw - 24px);
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    z-index: 200;
    overflow: hidden;
}
.m-user-dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.m-user-dropdown-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 4px 0;
}
.m-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}
.m-user-dropdown-item:hover,
.m-user-dropdown-item:active {
    background: var(--bg-glass);
}
.m-user-dropdown-icon { font-size: 1.2rem; }

/* ═══ MAIN ═══ */
.m-main {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}
.m-page-container {
    padding: 16px;
    animation: m-fade-in 0.3s ease;
}
@keyframes m-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.m-page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.m-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: m-spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes m-spin { to { transform: rotate(360deg); } }
.m-loader-text { font-size: 0.9rem; }

/* ═══ BOTTOM NAV ═══ */
.m-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 100;
}
.m-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: var(--transition);
    padding: 8px 4px;
    position: relative;
}
.m-bottom-nav-icon { font-size: 1.4rem; line-height: 1; }
.m-bottom-nav-label { font-weight: 500; }
.m-bottom-nav-item.active {
    color: var(--accent-cyan);
}
.m-bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    border-radius: 0 0 2px 2px;
}

/* ═══ BUTTONS ═══ */
.m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: 1px solid transparent;
    min-height: 48px;
    user-select: none;
}
.m-btn:active { transform: scale(0.97); }
.m-btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
}
.m-btn-primary:active { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3); }
.m-btn-ghost {
    background: var(--bg-glass);
    border-color: var(--border-glass);
}
.m-btn-outline {
    background: transparent;
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.m-btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}
.m-btn-lg { padding: 16px 24px; font-size: 1.05rem; }
.m-btn-sm { padding: 10px 14px; font-size: 0.875rem; min-height: 40px; }
.m-btn-block { width: 100%; }
.m-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ GLASS CARD ═══ */
.m-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 20px;
    margin-bottom: 16px;
}
.m-card-flat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

/* ═══ INPUTS ═══ */
.m-input-group { margin-bottom: 16px; }
.m-input-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
.m-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    min-height: 48px;
}
.m-input::placeholder { color: var(--text-muted); }
.m-input:focus {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.05);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
textarea.m-input { min-height: 100px; resize: vertical; }
select.m-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1.2rem;
    padding-right: 40px;
}
select.m-input option { background: var(--bg-secondary); color: var(--text-primary); }

/* ═══ SECTION TITLE ═══ */
.m-section-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.m-section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ═══ TOAST ═══ */
.m-toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    left: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.m-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    pointer-events: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}
.m-toast.show { transform: translateY(0); opacity: 1; }
.m-toast-success { border-left: 4px solid var(--accent-green); }
.m-toast-error { border-left: 4px solid var(--accent-red); }
.m-toast-warning { border-left: 4px solid var(--accent-amber); }
.m-toast-info { border-left: 4px solid var(--accent-cyan); }
.m-toast-close {
    margin-left: auto;
    font-size: 1.2rem;
    opacity: 0.5;
    padding: 4px;
}

/* ═══ MODAL ═══ */
.m-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: m-modal-fade 0.2s ease;
}
@keyframes m-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.m-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    animation: m-modal-slide 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes m-modal-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.m-modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border-glass);
    border-radius: 2px;
    margin: 0 auto 16px;
}
.m-modal-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
    text-align: center;
}

/* ═══ AUTH PAGES ═══ */
.m-auth-container {
    max-width: 440px;
    margin: 20px auto;
    padding: 24px 20px;
}
.m-auth-title {
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.m-auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
    font-size: 0.95rem;
}
.m-auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.m-auth-footer a { color: var(--accent-cyan); font-weight: 600; }

/* ═══ HOME PAGE ═══ */
.m-hero {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 20px;
}
.m-hero-icon { font-size: 4rem; margin-bottom: 16px; }
.m-hero-title {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 12px;
}
.m-hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
.m-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.m-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.m-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
}
.m-quick-action:active { transform: scale(0.97); }
.m-quick-action-icon { font-size: 1.75rem; }
.m-quick-action-label { font-size: 0.85rem; font-weight: 600; }

/* ═══ PLAY PAGE ═══ */
.m-mode-card {
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.m-mode-icon { font-size: 3rem; margin-bottom: 12px; }
.m-mode-title { font-size: 1.25rem; margin-bottom: 8px; }
.m-mode-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}
.m-mode-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.m-mode-feature {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-secondary);
}

/* ═══ GAME PAGE ═══ */
.m-game-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    z-index: 500;
}
.m-game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    backdrop-filter: blur(10px);
    z-index: 10;
    gap: 8px;
}
.m-game-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.m-game-hud-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.m-game-hud-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
}
.m-game-timer {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}
.m-game-timer.warning { color: var(--accent-amber); }
.m-game-timer.danger { color: var(--accent-red); animation: m-pulse 1s ease-in-out infinite; }
@keyframes m-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Панорама — на весь экран */
.m-panorama-container {
    flex: 1;
    position: relative;
    background: #000;
    min-height: 0;
}
/* ─── Мини-карта: свёрнута в угол, раскрывается тапом ─── */
.m-minimap-wrapper {
    position: absolute;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    width: 110px;
    height: 110px;
    background: #0a0e27;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 5;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.28s ease;
    /* Тап по свёрнутой карте перехватываем сами, чтобы не поставить метку случайно */
}

.m-minimap-wrapper.expanded {
    width: calc(100vw - 24px);
    height: 55vh;
    max-height: 480px;
    border-radius: var(--radius-lg);
}

.m-minimap {
    flex: 1;
    width: 100%;
    min-height: 0;
    background: #0a0e27;
}

/* В свёрнутом виде карта не должна принимать тапы на себя —
   тап ловит обёртка и раскрывает */
.m-minimap-wrapper:not(.expanded) .m-minimap {
    pointer-events: none;
}

.m-minimap-confirm {
    display: none;
    margin: 8px;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    min-height: 44px;
    flex-shrink: 0;
}
.m-minimap-wrapper.expanded .m-minimap-confirm {
    display: block;
}
.m-minimap-confirm:disabled { opacity: 0.5; }
.m-minimap-confirm:active:not(:disabled) { transform: scale(0.98); }

/* ─── Прячем плашки Яндекса: названия улиц/домов, "открыть в Я.Картах", копирайты ─── */
.ymaps-2-1-79-controls__control_toolbar,
.ymaps-2-1-79-zoom,
.ymaps-2-1-79-copyright,
.ymaps-2-1-79-copyrights-panel,
.ymaps-2-1-79-map-copyrights-promo,
.ymaps-2-1-79-panorama-gotoymaps,
.ymaps-2-1-79-panorama-gotoymaps__container,
.ymaps-2-1-79-panorama__address,
.ymaps-2-1-79-panorama__address-container,
.ymaps-2-1-79-panorama-layer__map-type,
.ymaps-2-1-79-panorama-layer__address,
.ymaps-2-1-79-panorama-layer__balloon,
[class*="panorama-gotoymaps"],
[class*="panorama__address"],
[class*="map-copyrights-promo"],
[class*="panorama-layer__address"] {
    display: none !important;
}
.m-game-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}
.m-game-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ═══ LEADERBOARD ═══ */
.m-lb-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.m-lb-tab {
    padding: 10px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}
.m-lb-tab.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    border-color: transparent;
}

.m-lb-top3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.m-lb-top3-card {
    padding: 16px 8px;
    text-align: center;
    border-radius: var(--radius-md);
    position: relative;
}
.m-lb-top3-card.gold { background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05)); border: 1px solid rgba(255, 215, 0, 0.3); }
.m-lb-top3-card.silver { background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05)); border: 1px solid rgba(192, 192, 192, 0.3); }
.m-lb-top3-card.bronze { background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05)); border: 1px solid rgba(205, 127, 50, 0.3); }
.m-lb-top3-medal { font-size: 2rem; margin-bottom: 4px; }
.m-lb-top3-name { font-size: 0.8rem; font-weight: 600; margin: 6px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-lb-top3-score { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 700; color: var(--accent-amber); }

.m-lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.m-lb-item.current-user {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.3);
}
.m-lb-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.m-lb-rank.rank-1 { background: linear-gradient(135deg, #ffd700, #ffed4e); color: #000; }
.m-lb-rank.rank-2 { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); color: #000; }
.m-lb-rank.rank-3 { background: linear-gradient(135deg, #cd7f32, #e8a87c); color: #000; }
.m-lb-info { flex: 1; min-width: 0; }
.m-lb-name { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-lb-level { font-size: 0.75rem; color: var(--text-muted); }
.m-lb-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--accent-amber);
    font-size: 1rem;
    text-align: right;
}

/* ═══ SEASON ═══ */
.m-season-header {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.15));
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.m-season-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-amber);
    margin-bottom: 4px;
}
.m-season-name { font-size: 1.1rem; margin-bottom: 12px; }
.m-season-timer {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--accent-cyan);
}

.m-season-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.m-season-stat {
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    text-align: center;
}
.m-season-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}
.m-season-stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ═══ PROFILE ═══ */
.m-profile-header {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 16px;
}
.m-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
}
.m-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.m-profile-name { font-size: 1.5rem; margin-bottom: 4px; }
.m-profile-level { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.m-profile-xp-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 8px;
}
.m-profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.m-profile-xp-text { font-size: 0.8rem; color: var(--text-muted); }

.m-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.m-profile-stat {
    padding: 16px 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}
.m-profile-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}
.m-profile-stat-label { font-size: 0.8rem; color: var(--text-muted); }

.m-profile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.m-profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.m-profile-menu-item:active { background: rgba(255, 255, 255, 0.06); }
.m-profile-menu-icon { font-size: 1.25rem; }
.m-profile-menu-label { flex: 1; font-weight: 500; }
.m-profile-menu-arrow { color: var(--text-muted); }

/* ═══ CONTEST ═══ */
.m-contest-header {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}
.m-contest-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.m-contest-timer {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin: 12px 0;
}

/* ═══ SUPPORT ═══ */
.m-support-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
}
.m-support-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
}
.m-support-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.m-support-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.m-support-msg-user .m-support-msg-bubble {
    background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
    color: white;
    border-bottom-right-radius: 4px;
}
.m-support-msg-admin .m-support-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
}
.m-support-msg-meta {
    font-size: 0.7rem;
    opacity: 0.65;
    margin-top: 4px;
}
.m-support-form {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border-glass);
}
.m-support-input {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    min-height: 44px;
    resize: none;
}
.m-support-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ═══ DUEL ═══ */
.m-duel-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    backdrop-filter: blur(10px);
    gap: 8px;
}
.m-duel-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    min-width: 90px;
}
.m-duel-player.p1 { border: 1px solid rgba(79, 172, 254, 0.3); }
.m-duel-player.p2 { border: 1px solid rgba(239, 68, 68, 0.3); }
.m-duel-player-name { font-size: 0.85rem; font-weight: 600; }
.m-duel-player-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-amber);
}
.m-duel-vs {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--accent-amber);
}

.m-lobby-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(79, 172, 254, 0.1);
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}
.m-lobby-code-value {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: #4facfe;
    letter-spacing: 0.3rem;
}

.m-player-slot {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 12px;
}
.m-player-slot.ready { border-color: var(--accent-green); background: rgba(16, 185, 129, 0.05); }
.m-player-slot.filled { border-color: rgba(16, 185, 129, 0.3); }
.m-player-slot.waiting { border-style: dashed; opacity: 0.6; }

/* ═══ FILTERS ═══ */
.m-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.m-filter-select {
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    min-height: 40px;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1rem;
}
.m-filter-select option { background: var(--bg-secondary); }

/* ═══ EMPTY STATE ═══ */
.m-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.m-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.6; }
.m-empty-title { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); }
.m-empty-text { font-size: 0.9rem; line-height: 1.5; }

/* ═══ BADGES ═══ */
.m-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.m-badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.m-badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.m-badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.m-badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }

/* ═══ GAME FULLSCREEN ═══ */
body.m-game-mode {
    padding-top: 0;
    padding-bottom: 0;
}
body.m-game-mode .m-header,
body.m-game-mode .m-bottom-nav { display: none; }
body.m-game-mode .m-main { min-height: 100vh; }

/* ═══ UTILS ═══ */
.m-text-center { text-align: center; }
.m-text-muted { color: var(--text-muted); }
.m-text-secondary { color: var(--text-secondary); }
.m-text-amber { color: var(--accent-amber); }
.m-text-cyan { color: var(--accent-cyan); }
.m-text-green { color: var(--accent-green); }
.m-text-red { color: var(--accent-red); }
.m-mt-1 { margin-top: 8px; }
.m-mt-2 { margin-top: 16px; }
.m-mt-3 { margin-top: 24px; }
.m-mb-1 { margin-bottom: 8px; }
.m-mb-2 { margin-bottom: 16px; }
.m-mb-3 { margin-bottom: 24px; }
.m-flex { display: flex; }
.m-flex-col { display: flex; flex-direction: column; }
.m-flex-center { display: flex; align-items: center; justify-content: center; }
.m-flex-between { display: flex; align-items: center; justify-content: space-between; }
.m-gap-1 { gap: 8px; }
.m-gap-2 { gap: 16px; }
.m-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.4); border-radius: 2px; }

/* ═══ YANDEX MAPS FIX ═══ */
.ymaps-2-1-79-controls__control_toolbar,
.ymaps-2-1-79-zoom,
[class*="panorama-gotoymaps"],
[class*="map-copyrights-promo"] {
    display: none !important;
}