* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    overflow: hidden;
    touch-action: none;
    font-family: 'Courier New', monospace;
    user-select: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: block;
}

#ui {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    color: #00ff88;
    font-size: 22px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    pointer-events: none;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 136, 0.1);
}

#ui span {
    color: #fff;
    font-weight: bold;
}

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    flex-direction: column;
}

#game-over.show {
    display: flex;
}

#game-over h1 {
    color: #ff3366;
    font-size: 64px;
    text-shadow: 0 0 40px rgba(255, 51, 102, 0.5);
    margin-bottom: 20px;
}

#game-over .stats {
    color: #00ff88;
    font-size: 28px;
    margin-bottom: 30px;
}

#game-over .restart-btn {
    color: #fff;
    font-size: 20px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    padding: 15px 40px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#game-over .restart-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: scale(1.05);
}

/* === ДЕБАГ МЕНЮ === */
#debug-menu {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff88;
    border-radius: 12px;
    padding: 20px;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    z-index: 1000;
    min-width: 280px;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.debug-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.debug-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.debug-label {
    color: #888;
}

.debug-value {
    color: #fff;
    font-weight: bold;
}

.debug-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 255, 136, 0.3);
    font-size: 12px;
    color: #666;
}

.debug-controls div {
    margin-bottom: 5px;
}

.debug-controls kbd {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00ff88;
    border-radius: 4px;
    padding: 2px 6px;
    color: #00ff88;
    font-weight: bold;
    margin-right: 5px;
}

/* === МЕНЮ ВЫБОРА ШАРИКА === */
#ball-select-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu-title {
    color: #00ff88;
    font-size: 48px;
    margin-bottom: 60px;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    letter-spacing: 3px;
}

.ball-options {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.ball-option {
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-width: 250px;
}

.ball-option:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #00ff88;
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.3);
}

.ball-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px currentColor;
}

.light-ball {
    background: radial-gradient(circle at 30% 30%, #ffffff, #cccccc);
    color: #ffffff;
}

.medium-ball {
    background: radial-gradient(circle at 30% 30%, #66aaff, #3366cc);
    color: #66aaff;
}

.heavy-ball {
    background: radial-gradient(circle at 30% 30%, #888888, #444444);
    color: #888888;
}

.ball-option h3 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.ball-stats {
    color: #00ff88;
    font-size: 14px;
    margin: 5px 0;
}

.ball-desc {
    color: #888;
    font-size: 12px;
    margin-top: 10px;
    font-style: italic;
}

/* === КНОПКА НАЗАД === */
#back-button {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 51, 102, 0.1);
    border: 2px solid #ff3366;
    color: #ff3366;
    font-size: 18px;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

#back-button:hover {
    background: rgba(255, 51, 102, 0.2);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.3);
}