/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* 游戏容器 */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题 */
.game-title {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

.subtitle {
    text-align: center;
    color: #a0a0a0;
    margin-top: 5px;
    font-size: 1rem;
}

/* 主游戏区域 */
.main-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

/* 侧边面板 */
.side-panel {
    width: 150px;
}

.info-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-box h3 {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #48dbfb;
}

.level-suffix {
    font-size: 1rem;
    color: #666;
}

.goal-display, .lines-display, .score-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #feca57;
}

/* 游戏画布容器 */
.game-board-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(72, 219, 251, 0.3);
}

#game-board {
    display: block;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #48dbfb;
    border-radius: 10px;
}

#next-piece {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

/* 游戏遮罩层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.game-overlay.hidden {
    display: none;
}

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

.overlay-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #48dbfb;
}

.overlay-content p {
    color: #aaa;
    margin-bottom: 20px;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(90deg, #48dbfb, #0abde3);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(72, 219, 251, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 难度和操作说明 */
.difficulty-box p {
    font-size: 0.85rem;
    color: #feca57;
}

.controls-box ul {
    list-style: none;
    font-size: 0.8rem;
}

.controls-box li {
    margin-bottom: 5px;
    color: #ccc;
}

kbd {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
}

/* 关卡进度 */
.level-progress {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.progress-label {
    text-align: center;
    color: #888;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48dbfb, #ff6b6b);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.level-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.marker.passed {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: #1a1a2e;
    font-weight: bold;
}

.marker.current {
    background: #feca57;
    color: #1a1a2e;
    animation: pulse 1s ease-in-out infinite;
}

.marker.final {
    font-size: 1.2rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ff6b6b;
}

/* 排行榜 */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: linear-gradient(90deg, #48dbfb, #0abde3);
    color: #1a1a2e;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
    color: #888;
    font-size: 0.85rem;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rank-1 { color: #feca57; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* 奖励模态框 */
.prize-modal {
    text-align: center;
}

.prize-modal h2 {
    font-size: 2rem;
    color: #feca57;
    margin-bottom: 15px;
}

.prize-form {
    margin: 20px 0;
}

.prize-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
}

.prize-form input::placeholder {
    color: #666;
}

.prize-code {
    font-size: 1.8rem;
    font-family: monospace;
    letter-spacing: 3px;
    background: rgba(72, 219, 251, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    color: #48dbfb;
    border: 2px dashed #48dbfb;
}

#prize-result.hidden {
    display: none;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.nav-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-area {
        flex-direction: column;
        align-items: center;
    }
    
    .side-panel {
        width: 100%;
        max-width: 300px;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .info-box {
        flex: 1;
        min-width: 70px;
        margin-bottom: 0;
    }
    
    .game-title {
        font-size: 1.8rem;
    }
    
    .level-display {
        font-size: 1.8rem;
    }
    
    .marker {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
}

/* 游戏结束动画 */
.game-over {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 通关特效 */
.victory {
    animation: victoryPulse 0.5s ease;
}

@keyframes victoryPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
