* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'Righteous';
    src: url('font/Righteous.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    overflow: hidden;
    overflow-x: hidden;
    background: #1a0a2e;
    font-family: 'Righteous', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b6b 50%, #ee5a24 100%);
}

#gameCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    touch-action: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    pointer-events: none;
    z-index: 10;
    width: 100%;
    max-width: 400px;
}

#score-panel, #wave-panel {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 8px 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 100px;
}

#score-label, #wave-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#score-value, #wave-value {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 200, 50, 0.5);
}

#combo-display {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffd700;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

#combo-display.show {
    opacity: 1;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(26, 10, 46, 0.92);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.game-title {
    font-family: 'Righteous', sans-serif;
    font-size: clamp(28px, 7vw, 52px);
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
    text-shadow:
        0 0 20px rgba(255, 200, 50, 0.6),
        0 0 40px rgba(255, 150, 50, 0.4);
    line-height: 1.2;
}

.game-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(13px, 2.5vw, 17px);
    margin-bottom: 28px;
    text-align: center;
}

.game-btn {
    background: linear-gradient(135deg, #ff6b35, #ff4500);
    color: #fff;
    border: none;
    padding: 14px 44px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Righteous', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(255, 69, 0, 0.4),
        0 0 30px rgba(255, 69, 0, 0.2);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.game-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(255, 69, 0, 0.5),
        0 0 40px rgba(255, 69, 0, 0.3);
}

.game-btn:active {
    transform: scale(0.98);
}

.how-to-play {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 2;
}

.how-to-play h3 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-size: 15px;
}

#final-score-panel, #final-wave-panel {
    text-align: center;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

#final-score-panel #final-score {
    font-size: 44px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

#final-wave-panel #final-wave {
    font-size: 32px;
    font-weight: 700;
    color: #ff6b35;
    text-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

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