body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #222, #444);
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.menu {
    text-align: center;
    color: #fff;
    z-index: 10;
}

.menu h1 {
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 0 0 20px #fff;
    animation: glow 2s ease-in-out infinite alternate;
}

.menu button {
    display: block;
    margin: 20px auto;
    padding: 15px 30px;
    font-size: 24px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.menu button:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

@keyframes glow {
    from { text-shadow: 0 0 20px #fff; }
    to { text-shadow: 0 0 30px #fff, 0 0 40px #0ff; }
}

.high-score-display {
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #FFD700;
    text-align: center;
}

.high-score-display div {
    margin: 5px 0;
}

.settings-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    color: #fff;
}

.settings-panel h3 {
    margin: 0 0 15px 0;
    color: #4CAF50;
    text-shadow: 0 0 10px #4CAF50;
}

.setting-row {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.setting-row label {
    min-width: 140px;
    font-size: 16px;
}

.setting-row input[type="number"] {
    width: 80px;
    padding: 5px;
    border: 1px solid #4CAF50;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    font-size: 14px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    gap: 10px;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    position: relative;
    background: transparent;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background: #4CAF50;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-radius: 3px;
    position: relative;
    background: transparent;
}

.radio-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #4CAF50;
}

.radio-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hell-mode {
    color: #FF6B35;
    font-weight: bold;
}

.hell-mode .radio-custom {
    border-color: #FF6B35;
}

.hell-mode input[type="radio"]:checked + .radio-custom {
    background: linear-gradient(45deg, #FF6B35, #F7931E);
    border-color: #FF6B35;
}

.mode-description {
    margin: 15px 0;
    min-height: 60px;
}

.mode-desc {
    display: none;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    border-radius: 5px;
    color: #fff;
}

.mode-desc.active {
    display: block;
}

.save-info {
    background: rgba(76, 175, 80, 0.05);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 5px;
    padding: 10px;
    margin: 15px 0;
    font-size: 14px;
    color: #ccc;
}

.save-info p {
    margin: 5px 0;
}

.save-info strong {
    color: #4CAF50;
}

.setting-hint {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

.settings-btn {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
}

.settings-btn:hover {
    background: linear-gradient(135deg, #F7931E, #FF6B35);
    transform: translateY(-1px);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    gap: 20px;
}

.game-header {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px;
    position: relative;
}

.back-btn {
    background: linear-gradient(135deg, #666, #444);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: absolute;
    left: 0;
}

.back-btn:hover {
    background: linear-gradient(135deg, #777, #555);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.game-title {
    font-size: 32px;
    color: #fff;
    text-shadow: 0 0 20px #fff;
    margin: 0 auto;
    font-weight: bold;
}

.game-boards {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.player-container {
    text-align: center;
    position: relative;
}

canvas {
    border: 2px solid #fff;
    background: rgba(17, 17, 17, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.score {
    color: #fff;
    font-size: 24px;
    margin-top: 20px;
    text-shadow: 0 0 10px #fff;
}

.next-piece-container {
    margin-top: 15px;
    text-align: center;
}

.next-piece-label {
    color: #fff;
    font-size: 16px;
    margin-bottom: 5px;
    text-shadow: 0 0 5px #fff;
}

#nextPiece1, #nextPiece2 {
    border: 1px solid #fff;
    background: rgba(17, 17, 17, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

@keyframes lineClear {
    0% { background: #fff; }
    50% { background: #f00; }
    100% { background: #111; }
}

@keyframes levelUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    animation: firework 1s ease-out;
}

@keyframes firework {
    0% { 
        transform: translate(0, 0) scale(1); 
        opacity: 1; 
        box-shadow: 0 0 10px currentColor;
    }
    100% { 
        transform: translate(var(--tx), var(--ty)) scale(0.2); 
        opacity: 0;
        box-shadow: 0 0 20px currentColor;
    }
}

.impact-effect {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    animation: impact 0.3s ease-out;
}

@keyframes impact {
    0% { 
        transform: translate(0, 0) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translate(var(--tx), var(--ty)) scale(0.3); 
        opacity: 0; 
    }
}

@keyframes aurora {
    0% { 
        opacity: 0;
        transform: rotate(0deg) scale(1);
    }
    25% { 
        opacity: 0.8;
        transform: rotate(5deg) scale(1.1);
    }
    50% { 
        opacity: 1;
        transform: rotate(-3deg) scale(1.05);
    }
    75% { 
        opacity: 0.9;
        transform: rotate(2deg) scale(1.08);
    }
    100% { 
        opacity: 0;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes hellAurora {
    0% { 
        opacity: 0.3;
        transform: rotate(0deg) scale(1);
    }
    25% { 
        opacity: 0.5;
        transform: rotate(3deg) scale(1.05);
    }
    50% { 
        opacity: 0.4;
        transform: rotate(-2deg) scale(1.02);
    }
    75% { 
        opacity: 0.6;
        transform: rotate(1deg) scale(1.03);
    }
    100% { 
        opacity: 0.3;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes highScoreGlow {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
        text-shadow: 0 0 20px #FFD700;
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        text-shadow: 0 0 40px #FFD700, 0 0 60px #FFD700, 0 0 80px #FF6B35;
    }
    100% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 20px #FFD700;
    }
}

.block-3d {
    position: relative;
    transform-style: preserve-3d;
}

.block-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateZ(-5px);
}