* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.game-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 2px solid #6c5ce7;
    max-width: 100%;
    width: 100%;
    max-width: 900px;
}

.game-header {
    text-align: center;
    margin-bottom: 12px;
}

.game-header h1 {
    font-size: clamp(20px, 5vw, 28px);
    color: #6c5ce7;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(108, 92, 231, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #6c5ce7;
}

.stat-label {
    font-size: 11px;
    color: #b8c0ff;
}

.stat-value {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: bold;
    color: #6c5ce7;
}

.game-area {
    border: 3px solid #6c5ce7;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    line-height: 0;
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #1a1a2e 0%, #0f0f1a 100%);
    touch-action: none;
}

.game-footer {
    text-align: center;
    color: #b8c0ff;
    font-size: clamp(11px, 3vw, 13px);
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-box {
    background: linear-gradient(160deg, #1e1e3f 0%, #2a1040 100%);
    border: 2px solid #6c5ce7;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: clamp(22px, 6vw, 28px);
    color: #6c5ce7;
    margin-bottom: 12px;
}

.modal-subtitle {
    color: #b8c0ff;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-tips {
    background: rgba(108, 92, 231, 0.15);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 8px;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-key {
    background: #6c5ce7;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    min-width: 50px;
    text-align: center;
}

.modal-stats {
    background: rgba(108, 92, 231, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
}

/* 移动端适配 */
@media (max-width: 600px) {
    body {
        padding: 0;
    }
    
    .game-container {
        border-radius: 0;
        border: none;
        padding: 10px;
    }
    
    .game-area {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}
