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

body {
    font-family: 'Arial', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#game-container {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    border-radius: 32px;
    padding: 18px 8px 12px 8px;
    box-shadow: 0 12px 40px rgba(67, 206, 162, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    max-width: 420px;
    width: 100%;
    margin: 8px;
    animation: fadeIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}

#game-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
    background: #d2eafd !important;
    border: 1.5px solid #b3d8f6;
    padding: 12px 8px 6px 8px;
    border-radius: 20px;
    box-shadow: 0 12px 40px 12px #d1c4e9, 0 4px 18px rgba(67, 206, 162, 0.10);
    position: relative;
    top: -10px;
}

.header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}
.header-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin-bottom: 2px;
    letter-spacing: 1px;
}
.header-value {
    font-size: 24px;
    font-weight: 900;
    color: #43cea2;
    letter-spacing: 1px;
    line-height: 1.1;
}
#score.header-value {
    color: #1976d2;
}
#level.header-value { color: #ff9800; }
#target.header-value { color: #185a9d; }
#time.header-value { color: #e57373; }

#game-board {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#game-canvas {
    border: 4px solid #43cea2;
    border-radius: 18px;
    background: #f8f9fa;
    box-shadow: 0 8px 32px rgba(67, 206, 162, 0.13), 0 2px 8px rgba(0,0,0,0.06);
    max-width: 100%;
    height: auto;
    transition: box-shadow 0.2s;
}
#game-canvas:active {
    box-shadow: 0 12px 40px rgba(67, 206, 162, 0.18);
}

#game-controls {
    display: flex;
    justify-content: space-between;
    gap: 0;
    padding: 0;
}
#game-controls .game-btn {
    flex: 1 1 0;
    margin: 0 8px;
    max-width: 64px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#game-controls .game-btn:first-child {
    margin-left: 0;
}
#game-controls .game-btn:last-child {
    margin-right: 0;
}

#game-controls-card {
    background: #d2eafd !important;
    border: 1.5px solid #b3d8f6;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(67, 206, 162, 0.10);
    margin-bottom: 10px;
    padding: 8px 0 2px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 主按钮美化 */
#start-btn.game-btn,
#start-btn.game-btn:disabled {
    color: #43cea2 !important;
    background: transparent !important;
}
#start-btn.game-btn:hover:not(:disabled) {
    color: #185a9d !important;
    background: rgba(67,206,162,0.13) !important;
}

#pause-btn.game-btn,
#pause-btn.game-btn:disabled {
    color: #f7971e !important;
    background: transparent !important;
}
#pause-btn.game-btn:hover:not(:disabled) {
    color: #ffd200 !important;
    background: rgba(255,210,0,0.13) !important;
}

#restart-btn.game-btn,
#restart-btn.game-btn:disabled {
    color: #185a9d !important;
    background: transparent !important;
}
#restart-btn.game-btn:hover:not(:disabled) {
    color: #43cea2 !important;
    background: rgba(24,90,157,0.13) !important;
}

.game-btn {
    background: transparent !important;
    box-shadow: none !important;
    border: none;
    padding: 0;
    border-radius: 50%;
    min-width: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #43cea2;
    transition: background 0.18s, transform 0.18s;
    margin: 0 12px;
}
.game-btn .material-icons {
    font-size: 48px;
    line-height: 1;
    display: block;
}
.game-btn:hover:not(:disabled) {
    background: rgba(67,206,162,0.10) !important;
    transform: scale(1.13);
    color: #185a9d;
}
.game-btn:active {
    filter: brightness(0.85);
}
.game-btn:disabled {
    color: #ccc !important;
    background: transparent !important;
    cursor: not-allowed;
    transform: none;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: #eaf6fd !important;
    padding: 40px 30px 30px 30px;
    border-radius: 32px;
    text-align: center;
    max-width: 340px;
    width: 92%;
    box-shadow: 0 12px 40px rgba(67, 206, 162, 0.25), 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    animation: popIn 0.5s cubic-bezier(.68,-0.55,.27,1.55);
}

@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    80% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.modal-content .celebrate-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.modal-content h2 {
    color: #43cea2;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #43cea2, #185a9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    margin: 12px 0;
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

.modal-content .score-label {
    color: #ff9800;
    font-size: 18px;
    font-weight: bold;
}

.modal-content .points-label {
    color: #4caf50;
    font-size: 18px;
    font-weight: bold;
}

.modal-content .game-btn {
    margin: 18px 8px 0 8px;
    min-width: 120px;
    font-size: 16px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(67, 206, 162, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-content .game-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(67, 206, 162, 0.25);
}

#game-instructions {
    background: #eaf6fd !important;
    padding: 10px 10px 6px 10px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(67, 206, 162, 0.10);
    margin-top: 6px;
}

#game-instructions h3 {
    color: #43cea2;
    margin-bottom: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #43cea2, #185a9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#game-instructions p, #game-instructions li {
    margin: 6px 0;
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    font-weight: 500;
}

#game-instructions ul {
    padding-left: 18px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    #game-container {
        margin: 5px;
        padding: 10px;
    }
    #game-header {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
    }
    .header-item {
        font-size: 13px;
    }
    .game-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
    }
    #game-instructions p {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    #game-header {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .game-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 60px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 消除动画 */
@keyframes eliminate {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(0); opacity: 0; }
}

.eliminating {
    animation: eliminate 0.3s ease-out;
}

/* 分数增加动画 */
@keyframes scoreIncrease {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #4CAF50; }
    100% { transform: scale(1); }
}

.score-increase {
    animation: scoreIncrease 0.5s ease-out;
}

/* 游戏说明弹窗 */
#help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

#help-modal .modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 0;
    max-width: 90%;
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#help-modal .modal-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 24px 16px;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#help-modal .modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

#help-modal .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#help-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#help-modal .modal-body {
    padding: 24px;
    color: #333;
}

#help-modal .help-section {
    margin-bottom: 24px;
}

#help-modal .help-section:last-child {
    margin-bottom: 0;
}

#help-modal .help-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#help-modal .help-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    margin-bottom: 8px;
    padding-left: 8px;
}

#help-modal .help-section p:last-child {
    margin-bottom: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#help-modal.hidden {
    display: none;
}

.card, #game-controls-card.card {
    background: #eaf6fd !important;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(67, 206, 162, 0.10);
}

/* 覆盖弹窗等卡片的渐变背景 */
.modal-content {
    background: #eaf6fd !important;
}

#game-instructions {
    background: #eaf6fd !important;
} 