/* ============================================================
   style.css — Flappy Bird 样式
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    user-select: none;
}

.game-wrapper {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----- 顶部信息栏 ----- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px 16px 8px;
    color: #ecf0f1;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.game-header .score-label {
    opacity: 0.7;
    font-size: 14px;
    font-weight: normal;
}

.game-header .score-value {
    color: #f1c40f;
    font-size: 28px;
    margin-left: 6px;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
}

.game-header .best-score {
    color: #2ecc71;
    font-size: 20px;
}

.game-header .best-score span {
    font-size: 24px;
    margin-left: 4px;
}

/* ----- 画布 ----- */
canvas {
    display: block;
    border-radius: 16px;
    background: #4ec0ca;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 400 / 600;
    cursor: pointer;
    touch-action: none;
}

/* ----- 底部控制区 ----- */
.game-footer {
    width: 100%;
    padding-top: 16px;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.6);
}

.btn:active {
    transform: scale(0.95);
}

.btn-restart {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.btn-restart:hover {
    box-shadow: 0 8px 30px rgba(230, 126, 34, 0.6);
}

.btn-primary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.6);
}

.control-hint {
    color: #95a5a6;
    font-size: 13px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.control-hint kbd {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: #ecf0f1;
}

/* ----- 响应式 ----- */
@media (max-width: 500px) {
    .game-wrapper {
        padding: 12px;
        border-radius: 16px;
    }
    .game-header {
        font-size: 14px;
        padding-bottom: 10px;
    }
    .game-header .score-value {
        font-size: 22px;
    }
    .game-header .best-score {
        font-size: 16px;
    }
    .btn {
        padding: 8px 20px;
        font-size: 14px;
    }
    .control-hint {
        font-size: 11px;
        padding: 4px 12px;
    }
}

@media (max-width: 400px) {
    .game-wrapper {
        padding: 8px;
        border-radius: 12px;
    }
    .game-header .score-value {
        font-size: 18px;
    }
    .btn {
        padding: 6px 16px;
        font-size: 12px;
    }
}