/* ============================================================================
   SNAKE ULTIMATE - MODERN UI
   ============================================================================ */

:root {
    --accent-color: #00ff88;
    --accent-color-rgb: 0, 255, 136;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Orbitron', monospace;
    background: radial-gradient(ellipse at top, #0f1729 0%, #050a1a 50%, #000000 100%);
    color: #e0e0e0;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Анимированные звезды на фоне */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 
        25px 25px #fff, 50px 75px #fff, 75px 25px #fff, 100px 50px #fff,
        125px 100px #fff, 150px 25px #fff, 175px 75px #fff, 200px 50px #fff,
        225px 100px #fff, 250px 25px #fff, 275px 75px #fff, 300px 50px #fff,
        325px 100px #fff, 350px 25px #fff, 375px 75px #fff, 400px 50px #fff,
        425px 100px #fff, 450px 25px #fff, 475px 75px #fff, 500px 50px #fff,
        550px 100px #fff, 600px 150px #fff, 650px 50px #fff, 700px 200px #fff,
        750px 80px #fff, 800px 120px #fff, 850px 180px #fff, 900px 60px #fff,
        950px 140px #fff, 1000px 90px #fff, 1050px 160px #fff, 1100px 110px #fff,
        1150px 70px #fff, 1200px 130px #fff, 1250px 190px #fff, 1300px 40px #fff,
        1350px 210px #fff, 1400px 85px #fff, 1450px 155px #fff, 1500px 125px #fff;
    animation: twinkle 3s infinite;
}

.stars::after {
    animation-delay: 1.5s;
    opacity: 0.5;
    box-shadow: 
        100px 200px #fff, 200px 300px #fff, 300px 100px #fff, 400px 250px #fff,
        500px 150px #fff, 600px 350px #fff, 700px 50px #fff, 800px 300px #fff,
        900px 180px #fff, 1000px 280px #fff, 1100px 120px #fff, 1200px 320px #fff,
        1300px 220px #fff, 1400px 160px #fff, 1500px 260px #fff, 1600px 90px #fff;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ============================================================================
   NEW MODERN LAYOUT
   ============================================================================ */

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1424 100%);
    border-bottom: 3px solid var(--accent-color);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 4px 30px rgba(0, 255, 136, 0.3),
        0 0 60px rgba(0, 255, 136, 0.1);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    animation: header-shine 3s infinite;
}

@keyframes header-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

.logo-emoji {
    font-size: 2rem;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 900;
    /* Fallback цвет для старых браузеров */
    color: var(--accent-color);
    /* Градиентный фон */
    background: linear-gradient(135deg, var(--accent-color) 0%, #00ccff 50%, var(--accent-color) 100%);
    background-size: 200% auto;
    /* Применяем градиент к тексту */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    margin: 0;
    animation: gradient-text 3s linear infinite;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
    position: relative;
    z-index: 1;
    /* Принудительная загрузка шрифта */
    font-family: 'Orbitron', monospace;
}

@keyframes gradient-text {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 45px;
    height: 45px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.icon-btn span {
    filter: grayscale(0);
}

/* Main Content Layout */
.app-content {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.game-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1424 100%);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: default;
}

.stat-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}

.stat-card.highlight {
    border-color: #ffd700;
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1f0a 100%);
}

.stat-card.highlight:hover {
    border-color: #ffd700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
}

.stat-card.highlight .stat-value {
    color: #ffd700;
}

/* Основная игровая область */
.game-main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Board */
.game-board {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, rgba(0, 204, 255, 0.05) 100%);
    border: 3px solid var(--accent-color);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 
        0 0 40px rgba(0, 255, 136, 0.4),
        0 0 80px rgba(0, 255, 136, 0.2),
        inset 0 0 60px rgba(0, 255, 136, 0.05);
    max-width: 520px;
    margin: 0 auto;
    overflow: hidden;
    animation: board-glow 3s ease-in-out infinite;
}

@keyframes board-glow {
    0%, 100% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.4), 0 0 80px rgba(0, 255, 136, 0.2), inset 0 0 60px rgba(0, 255, 136, 0.05); }
    50% { box-shadow: 0 0 60px rgba(0, 255, 136, 0.6), 0 0 100px rgba(0, 255, 136, 0.3), inset 0 0 80px rgba(0, 255, 136, 0.08); }
}

#gameCanvas {
    display: block;
    background: radial-gradient(ellipse at center, #0a0f20 0%, #050812 100%);
    box-sizing: content-box;
    border: none;
    border-radius: 16px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Оверлей игры */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.overlay-content {
    text-align: center;
    padding: 40px;
}

#overlayTitle {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

#overlayMessage {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.overlay-stats {
    margin: 20px 0;
    font-size: 1.1rem;
}

/* Кнопки */
.btn-primary, .btn-secondary {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 16px 40px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #00ccff 100%);
    color: #000;
    font-weight: 900;
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 255, 136, 0.7);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a4a5e 0%, #2d2d44 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(74, 74, 94, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(74, 74, 94, 0.6);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

/* Control Panel */
.panel-section {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1424 100%);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.panel-section:hover {
    border-color: var(--accent-color);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-action {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
}

.btn-action:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-color);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.btn-text {
    flex: 1;
    text-align: left;
}

/* Панель управления */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 250px;
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Keys Grid */
.keys-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.keys-row {
    display: flex;
    gap: 8px;
}

.key {
    background: rgba(0, 255, 136, 0.15);
    border: 2px solid rgba(0, 255, 136, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-color);
    text-align: center;
    min-width: 50px;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.2);
}

.key-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Футер с информацией о бонусах */
.game-footer {
    margin-top: 30px;
    text-align: center;
}

.power-ups-info h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.power-up-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.power-up {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Частицы */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 20px;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 1s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
}

/* Выбор режима игры */
.game-mode-selector {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.game-mode-selector label {
    display: block;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Mode Select */
.mode-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    color: #e0e0e0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-select:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--accent-color);
}

.mode-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.mode-select option {
    background: #1a1f3a;
    color: #e0e0e0;
    padding: 10px;
}

/* Модальное окно/* Shop Tabs */
.shop-tabs {
    display: flex;
    gap: 5px;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(0, 255, 136, 0.2);
}

.shop-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #666;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 2px;
}

.shop-tab:hover {
    color: var(--accent-color);
    background: rgba(0, 255, 136, 0.05);
}

.shop-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(0, 255, 136, 0.1);
}

.shop-tab-content {
    display: none;
}

.shop-tab-content.active {
    display: block;
}

/* Модальное окно магазина */
.shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.shop-modal-content {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1424 100%);
    border: 3px solid var(--accent-color);
    border-radius: 24px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0 60px rgba(0, 255, 136, 0.6),
        0 0 100px rgba(0, 255, 136, 0.3),
        inset 0 0 40px rgba(0, 255, 136, 0.05);
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.shop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--accent-color);
}

.shop-modal-header h2 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 0;
}

.shop-close-btn {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    line-height: 1;
}

.shop-close-btn:hover {
    background: var(--accent-color);
    color: #000;
    transform: rotate(90deg);
}

.shop-modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.shop-modal-body::-webkit-scrollbar {
    width: 10px;
}

.shop-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.shop-modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.shop-modal-body::-webkit-scrollbar-thumb:hover {
    background: #00ccff;
}

.shop-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.shop-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.5s;
}

.shop-item:hover::before {
    left: 100%;
}

.shop-item:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
}

.shop-item.active {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.1);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.3);
}

.shop-item.active::after {
    content: '✓ МАКС';
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #000;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 900;
    box-shadow: 0 2px 10px rgba(255, 204, 0, 0.5);
}

.skin-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    flex-shrink: 0;
}

.skin-info {
    flex: 1;
}

.skin-name {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.skin-price {
    color: #ffcc00;
    font-size: 0.8rem;
    margin-top: 2px;
}

.shop-button {
    background: linear-gradient(45deg, var(--accent-color), #00ccff);
    border: none;
    color: #000;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.shop-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.shop-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
}

/* Прокрутка для магазина */

/* Обертка для игрового поля */
.game-board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Активные Power-ups под полем */
/* Active Power-ups */
.active-powerups {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.active-powerup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.active-powerup-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.5);
}

.powerup-emoji {
    font-size: 1.3rem;
}

.powerup-name {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.85rem;
}

.powerup-timer {
    color: #ffcc00;
    font-weight: bold;
    font-size: 0.85rem;
    background: rgba(255, 204, 0, 0.2);
    padding: 2px 8px;
    border-radius: 8px;
}

/* Информационное окно */
.info-section {
    margin-bottom: 25px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.info-item:hover {
    border-color: var(--accent-color);
    background: rgba(0, 255, 136, 0.05);
}

.info-emoji {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
}

.info-text {
    color: var(--accent-color);
    font-size: 0.95rem;
    flex: 1;
}

.info-text strong {
    color: #00ccff;
}

.info-note {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 8px;
    color: #ffcc00;
    font-size: 0.9rem;
    text-align: center;
}

.info-tips {
    list-style: none;
    padding: 0;
}

.info-tips li {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--accent-color);
    border-radius: 5px;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.info-tips li:last-child {
    margin-bottom: 0;
}

/* Debug Console */
.debug-section {
    margin-bottom: 25px;
}

.debug-section:last-child {
    margin-bottom: 0;
}

.debug-section h3 {
    color: #ffcc00;
    font-size: 1.1rem;
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
}

.debug-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.debug-btn {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    color: var(--accent-color);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.debug-btn:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, #00cc6a 100%);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

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

.debug-btn.danger {
    border-color: #ff4444;
    color: #ff4444;
}

.debug-btn.danger:hover {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
}

.debug-info {
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 8px;
    color: #ffcc00;
    font-size: 0.9rem;
    text-align: center;
}

.debug-info kbd {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    font-size: 0.95rem;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
}

.achievement-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: #ffcc00;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(80%);
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-card-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.achievement-card-name {
    color: #ffcc00;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.achievement-card-desc {
    color: var(--accent-color);
    font-size: 0.85rem;
    line-height: 1.4;
}

.achievement-card.locked .achievement-card-name,
.achievement-card.locked .achievement-card-desc {
    color: #666;
}

.achievement-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffcc00;
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.achievement-card.locked .achievement-badge {
    background: #444;
    color: #666;
}

/* Achievement Notifications */
.achievement-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.achievement-notification {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border: 2px solid #ffcc00;
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(255, 204, 0, 0.4);
    animation: slideInRight 0.5s ease, pulse 2s ease-in-out infinite;
    pointer-events: all;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.achievement-notification:hover {
    transform: translateX(-5px);
}

.achievement-notification.hiding {
    animation: slideOutRight 0.5s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(255, 204, 0, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(255, 204, 0, 0.7);
    }
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.achievement-emoji {
    font-size: 2rem;
    line-height: 1;
}

.achievement-title {
    color: #ffcc00;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-desc {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-left: 52px;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1200px) {
    .app-content {
        flex-direction: column;
        align-items: center;
    }
    
    .control-panel {
        width: 100%;
        max-width: 600px;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   DECORATIVE ELEMENTS
   ============================================================================ */

.decorative-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.12;
    animation: float 20s infinite ease-in-out;
    filter: blur(0.5px);
}

.floating-emoji:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    animation-duration: 15s;
}

.floating-emoji:nth-child(2) {
    top: 30%;
    right: 8%;
    animation-delay: 3s;
    animation-duration: 18s;
}

.floating-emoji:nth-child(3) {
    top: 60%;
    left: 10%;
    animation-delay: 6s;
    animation-duration: 22s;
}

.floating-emoji:nth-child(4) {
    top: 80%;
    right: 15%;
    animation-delay: 9s;
    animation-duration: 20s;
}

.floating-emoji:nth-child(5) {
    top: 50%;
    left: 3%;
    animation-delay: 12s;
    animation-duration: 16s;
}

.floating-emoji:nth-child(6) {
    top: 20%;
    right: 5%;
    animation-delay: 15s;
    animation-duration: 19s;
}

.floating-emoji:nth-child(7) {
    top: 40%;
    left: 15%;
    animation-delay: 2s;
    animation-duration: 17s;
    font-size: 3rem;
}

.floating-emoji:nth-child(8) {
    top: 70%;
    right: 20%;
    animation-delay: 5s;
    animation-duration: 21s;
}

.floating-emoji:nth-child(9) {
    top: 15%;
    left: 25%;
    animation-delay: 8s;
    animation-duration: 14s;
}

.floating-emoji:nth-child(10) {
    top: 85%;
    left: 20%;
    animation-delay: 11s;
    animation-duration: 23s;
}

.floating-emoji:nth-child(11) {
    top: 45%;
    right: 10%;
    animation-delay: 4s;
    animation-duration: 19s;
}

.floating-emoji:nth-child(12) {
    top: 25%;
    left: 8%;
    animation-delay: 7s;
    animation-duration: 15s;
    opacity: 0.18;
}

.floating-emoji:nth-child(13) {
    top: 65%;
    right: 12%;
    animation-delay: 10s;
    animation-duration: 18s;
}

.floating-emoji:nth-child(14) {
    top: 35%;
    left: 18%;
    animation-delay: 1s;
    animation-duration: 20s;
}

.floating-emoji:nth-child(15) {
    top: 55%;
    right: 25%;
    animation-delay: 13s;
    animation-duration: 16s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(5deg);
    }
    50% {
        transform: translateY(-60px) rotate(-5deg);
    }
    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* ============================================================================
   LEADERBOARD STYLES
   ============================================================================ */

/* Leaderboard Loading */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 255, 136, 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.leaderboard-loading p {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* Leaderboard Error */
.leaderboard-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.leaderboard-error span {
    font-size: 3rem;
    margin-bottom: 15px;
}

.leaderboard-error p {
    color: #ff4444;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Leaderboard Content */
.leaderboard-content {
    padding: 0;
}

/* User Stats Card */
.leaderboard-user-stats {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 255, 0.1) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.user-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-stats-title {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-nickname-btn {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--accent-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
}

.change-nickname-btn:hover {
    background: var(--accent-color);
    color: #000;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.user-stat-item {
    text-align: center;
}

.user-stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.user-stat-value {
    color: var(--accent-color);
    font-size: 1.4rem;
    font-weight: bold;
}

.user-stat-value.rank {
    color: #ffcc00;
}

/* Leaderboard List */
.leaderboard-list {
    max-height: 500px;
    overflow-y: auto;
}

.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: #00ccff;
}

/* Leaderboard Item */
.leaderboard-item {
    display: grid;
    grid-template-columns: 60px 1fr 120px 100px;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(0, 255, 136, 0.05);
    border-color: var(--accent-color);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, rgba(255, 153, 0, 0.15) 100%);
    border-color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 204, 255, 0.15) 100%);
    border-color: var(--accent-color);
}

/* Rank */
.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: var(--accent-color);
}

.leaderboard-item.top-3 .leaderboard-rank {
    font-size: 2rem;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #ffd700;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #c0c0c0;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #cd7f32;
}

.rank-medal {
    font-size: 2rem;
}

/* Player Info */
.leaderboard-player {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-nickname {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
}

.leaderboard-item.current-user .player-nickname {
    color: #ffcc00;
}

.player-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

/* Score */
.leaderboard-score {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: right;
}

.leaderboard-item.top-3 .leaderboard-score {
    font-size: 1.5rem;
}

.leaderboard-item.current-user .leaderboard-score {
    color: #ffcc00;
}

/* Level Badge */
.leaderboard-level {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    padding: 8px 12px;
    text-align: center;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: bold;
}

.leaderboard-item.current-user .leaderboard-level {
    background: rgba(255, 204, 0, 0.2);
    border-color: #ffcc00;
    color: #ffcc00;
}

/* Nickname Modal */
.nickname-modal {
    max-width: 450px;
}

.nickname-input-container {
    padding: 20px 0;
}

.nickname-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

.nickname-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.nickname-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.nickname-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.nickname-error {
    color: #ff4444;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
}

.nickname-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.nickname-buttons .btn-primary {
    flex: 1.2;
    max-width: 200px;
    font-size: 1.2rem;
    padding: 18px 45px;
    animation: pulse-glow 2s ease-in-out infinite;
    background: linear-gradient(135deg, #00ff88 0%, #00ffff 50%, #00ff88 100%);
    background-size: 200% 200%;
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.6),
                0 0 40px rgba(0, 255, 255, 0.3);
}

.nickname-buttons .btn-primary:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 15px 45px rgba(0, 255, 136, 0.8),
                0 0 60px rgba(0, 255, 255, 0.5);
    animation: pulse-glow 1s ease-in-out infinite;
}

.nickname-buttons .btn-secondary {
    flex: 0.8;
    max-width: 160px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0, 255, 136, 0.6),
                    0 0 40px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 8px 35px rgba(0, 255, 136, 0.8),
                    0 0 50px rgba(0, 255, 255, 0.5);
    }
}

/* Empty State */
.leaderboard-empty {
    text-align: center;
    padding: 60px 20px;
}

.leaderboard-empty span {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.leaderboard-empty p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}
