:root {
    --bg-dark: #050a10;
    --accent-blue: #00f2ff;
    --accent-pink: #ff00ff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e6ed;
    --text-muted: #8892b0;
    --shadow-glow: 0 0 20px rgba(0, 242, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Space Grotesk', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background: radial-gradient(circle at center, #0a1420 0%, #050a10 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#game-wrapper {
    width: 100%;
    max-width: 700px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 72px;
    box-sizing: border-box;
    background: transparent;
    overflow: hidden;
}

@media (max-width: 768px) {
    #game-wrapper {
        justify-content: center;
        padding-top: 72px;
        padding-bottom: 16px;
        min-height: 100vh;
    }

    #game-area {
        min-height: calc(100vh - 72px - 280px); /* максимум блока меню */
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

#top-bar {
    --header-height: 72px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 10px;
    background: rgba(5, 10, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mode-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 100%;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

#stats-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

#stats-panel .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#stats-panel .label,
#mode-panel .label {
    margin: 0;
    color: var(--text-muted);
}

#menu-checkbox {
    display: none;
}

.burger-btn {
    display: none;
    width: 36px;
    height: 30px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-bg);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.35);
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-blue);
}

#mobile-menu {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 180;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
    background: var(--glass-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobile-menu.open {
    max-height: 280px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#mobile-menu .setting-group {
    padding: 10px 16px;
}

#game-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
}

#game-container {
    width: min(94vw, 620px);
    max-width: 600px;
    height: auto;
    max-height: calc(100vh - 96px);
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    background: #050a10;
}

#mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    #mode-panel {
        display: none;
    }

    #top-bar {
        justify-content: center;
    }

    .burger-btn {
        display: flex;
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
    }

    #stats-panel {
        justify-content: center;
    }

    #menu-checkbox {
        display: none;
    }

    #mobile-menu {
        display: block;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }

    #game-container {
        width: min(92vw, 420px);
        max-height: calc(100vh - 140px);
    }
}

@media (max-width: 420px) {
    #game-container {
        width: min(88vw, 340px);
        max-height: calc(100vh - 130px);
    }
}


#reset-stats-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s;
    margin-left: 10px;
    padding: 5px;
}

#reset-stats-btn:hover {
    color: var(--accent-pink);
}


.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-group button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

.toggle-group button.active {
    background: rgba(0, 242, 255, 0.1);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.toggle-group button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-weight: 700;
}

.value {
    font-size: 1.2rem;
    color: var(--accent-blue);
    font-weight: 700;
}


/* Base styles for Notifications */
#notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
}

.notification-content {
    text-align: center;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
    opacity: 0;
}

.cyber-button {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cyber-button:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-blue);
}

.rarity-tag {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 10px;
}

.common {
    color: #8892b0;
    border: 1px solid #8892b0;
}

.rare {
    color: #00f2ff;
    border: 1px solid #00f2ff;
    box-shadow: 0 0 8px #00f2ff;
}

.legendary {
    color: #ff00ff;
    border: 1px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

#loot-box {
    font-size: 3rem;
    margin: 20px 0;
}

/* Desktop helpers */
#stats-panel .stat-item {
    align-items: center;
}

/* Mobile styling */
@media (max-width: 768px) {
    body {
        overflow: hidden;
    }

    #game-wrapper {
        max-width: 100%;
        padding: 12px;
        height: 100vh;
    }

    #top-bar {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    #left-side,
    #right-side {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #right-side {
        order: -1;
    }

    #stats-panel {
        width: 100vw;
        justify-content: center;
        gap: 12px;
    }

    #settings-menu {
        display: none;
        position: absolute;
        top: 52px;
        left: 8px;
        right: 8px;
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    }

    .burger-btn {
        display: flex;
    }

    .menu-checkbox:checked + .burger-btn + #settings-menu {
        display: flex;
        opacity: 1;
        visibility: visible;
        max-height: 280px;
    }

    #top-bar {
        padding: 8px 12px;
        justify-content: flex-start;
    }

    #left-side {
        width: 100%;
        justify-content: flex-start;
    }

    #settings-menu .setting-group {
        gap: 6px;
    }

    .toggle-group button {
        padding: 8px 10px;
        font-size: 0.65rem;
    }

    #game-container {
        max-height: calc(100vh - 180px);
        width: min(92vw, 420px);
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 420px) {
    #game-container {
        width: min(88vw, 340px);
        max-height: calc(100vh - 160px);
    }

    #stats-panel {
        gap: 6px;
        padding: 8px;
    }
}
