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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background-color: #1a1a2e;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#welcomeScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.welcome-content {
    text-align: center;
    padding: 40px 30px;
    max-width: 450px;
    width: 90%;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 25px;
    border: 3px solid rgba(255, 107, 107, 0.6);
}

.game-title {
    font-size: clamp(28px, 8vw, 42px);
    color: #ff6b6b;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.game-subtitle {
    font-size: clamp(14px, 3vw, 18px);
    color: #ffadad;
    margin-bottom: 35px;
}

.btn-start {
    width: 100%;
    padding: 18px 30px;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border: none;
    border-radius: 35px;
    cursor: pointer;
    margin-bottom: 35px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-start:active {
    transform: translateY(-1px);
}

.game-rules {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 22px;
    text-align: left;
    border: 2px solid rgba(255, 107, 107, 0.4);
}

.game-rules h3 {
    color: #ff6b6b;
    margin-bottom: 18px;
    font-size: clamp(15px, 3vw, 18px);
    text-align: center;
}

.game-rules ul {
    list-style: none;
    color: #ffcccc;
    font-size: clamp(13px, 2.5vw, 15px);
    line-height: 2;
}

.game-rules li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.game-rules li::before {
    content: '🎯';
    position: absolute;
    left: 0;
}

#gameContainer {
    background: #1a1a2e;
    z-index: 2;
}

#game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.header-item .label {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.header-item .value {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.health-value {
    color: #4ade80 !important;
}

.health-bar-container {
    position: relative;
    width: 80px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.health-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#gameCanvas {
    display: block;
    cursor: crosshair;
}

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

.modal.hidden {
    display: none;
}

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

.question-card {
    text-align: center;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.question-num {
    font-size: 16px;
    color: #ff6b6b;
    font-weight: bold;
}

.points-hint {
    font-size: 14px;
    color: #ffd700;
}

.question-text {
    font-size: 18px;
    color: #fff;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    line-height: 1.6;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 15px 20px;
    font-size: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ff6b6b;
}

.option-btn.selected {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
}

.option-btn.correct {
    background: rgba(74, 222, 128, 0.3);
    border-color: #4ade80;
}

.option-btn.incorrect {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
}

.option-btn:disabled {
    cursor: default;
}

.feedback {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

.feedback.correct {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.feedback.incorrect {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.points-earned {
    font-size: 18px;
    color: #ffd700;
    margin-bottom: 15px;
    font-weight: bold;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:disabled {
    background: #555;
    cursor: not-allowed;
}

.btn-submit:not(:disabled):hover {
    transform: translateY(-2px);
}

.btn-continue {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: #555;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

.final-card {
    text-align: center;
}

.final-title {
    font-size: 28px;
    color: #ffd700;
    margin-bottom: 25px;
}

.final-score {
    margin-bottom: 25px;
}

.final-score .score-label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.final-score .score-value {
    font-size: 48px;
    font-weight: bold;
    color: #ff6b6b;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.performance-message {
    font-size: 16px;
    color: #ffadad;
    margin-bottom: 25px;
}

.btn-restart {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-restart:hover {
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    #game-header {
        gap: 10px;
        padding: 10px;
    }

    .header-item .value {
        font-size: 16px;
    }

    .header-item .label {
        font-size: 10px;
    }

    .modal-content {
        padding: 20px;
    }

    .question-text {
        font-size: 16px;
        padding: 15px;
    }

    .option-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}