/* 俄罗斯方块 - 复古深色主题样式 */

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #eee;
}

.game-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.2),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.game-header h1 {
    font-size: 2.5em;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff;
    letter-spacing: 5px;
}

.audio-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.btn-icon {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-icon.muted {
    border-color: #ff6b6b;
    opacity: 0.6;
}

.game-main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 150px;
}

.info-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.info-box h3 {
    color: #00ffff;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-display,
.level-display,
.lines-display,
.time-display {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.time-display {
    color: #ffd93d;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.5);
}

/* 历史最高分样式 */
.highscore-box {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.5));
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.highscore-box h3 {
    color: #ffd700;
}

.highscore-display {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5);
}

/* 赛博朋克副标题 */
.cyber-subtitle {
    font-size: 0.4em;
    color: #ff00ff;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #ff00ff;
    vertical-align: super;
    margin-left: 10px;
    animation: cyber-pulse 2s ease-in-out infinite;
}

@keyframes cyber-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff; }
    50% { opacity: 0.7; text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff, 0 0 60px #ff00ff; }
}

.preview-box {
    padding: 10px;
}

.preview-box canvas {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.game-board {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canvas-wrapper {
    position: relative;
    width: 300px;
    height: 600px;
}

#gameCanvas {
    background: #000;
    border: 4px solid #00ffff;
    border-radius: 5px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.5),
        0 0 60px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    display: block;
    width: 100%;
    height: 100%;
}

#effectsCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    display: block;
}

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

.btn {
    padding: 12px 24px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #00ffff, #0080ff);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #80ffff, #40a0ff);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ff8e8e, #ff7b54);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
    transform: translateY(-2px);
}

.btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.instructions {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    font-size: 0.85em;
}

.instructions h4 {
    color: #00ffff;
    margin-bottom: 10px;
    text-align: center;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 5px 0;
    color: #ccc;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.instructions li:last-child {
    border-bottom: none;
}

.game-over,
.pause-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #ff6b6b;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 107, 107, 0.5);
    z-index: 10;
}

.pause-overlay {
    border-color: #ffd93d;
    box-shadow: 0 0 50px rgba(255, 217, 61, 0.5);
}

.game-over h2 {
    color: #ff6b6b;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.pause-overlay h2 {
    color: #ffd93d;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.8);
}

.game-over p {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #fff;
}

.hidden {
    display: none !important;
}

/* 手机触控区域 */
.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.mobile-hint {
    color: #00ffff;
    font-size: 0.9em;
    text-align: center;
    line-height: 1.6;
}

/* 游戏区域触控分区 */
.touch-zone {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 20;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.touch-zone-left {
    left: 0;
    width: 25%;
}

.touch-zone-right {
    right: 0;
    width: 25%;
}

.touch-zone:active {
    background: rgba(0, 255, 255, 0.1);
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 900px) {
    body {
        padding: 5px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .game-container {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        border-radius: 15px;
    }
    
    .game-header {
        margin-bottom: 10px;
    }
    
    .game-header h1 {
        font-size: 1.5em;
        letter-spacing: 2px;
    }
    
    .game-main {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .game-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .left-panel,
    .right-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .info-box {
        padding: 8px 12px;
        min-width: 70px;
        flex: 1;
        max-width: 100px;
    }
    
    .info-box h3 {
        font-size: 0.7em;
        margin-bottom: 5px;
    }
    
    .score-display,
    .level-display,
    .lines-display,
    .time-display {
        font-size: 1em;
    }
    
    .preview-box {
        display: none;
    }
    
    .controls {
        flex-direction: row;
        gap: 10px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .game-board {
        width: 100%;
    }
    
    .canvas-wrapper {
        width: min(95vw, 350px);
        height: min(70vh, 700px);
        max-width: 350px;
        max-height: 700px;
    }
    
    .touch-zone-left,
    .touch-zone-right {
        width: 25%;
    }
    
    .audio-controls {
        position: static;
        transform: none;
        margin-top: 5px;
    }
    
    .btn-icon {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
    
    .instructions {
        display: none;
    }
    
    .mobile-controls {
        display: flex;
        margin-top: 10px;
        padding: 10px;
    }
    
    .mobile-hint {
        font-size: 0.8em;
    }
    
    .game-over,
    .pause-overlay {
        padding: 20px;
        width: 80%;
    }
    
    .game-over h2,
    .pause-overlay h2 {
        font-size: 1.5em;
    }
}
