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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    overflow: hidden;
}

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

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #2c1810 0%, #4a2c17 50%, #1a0f0a 100%);
    position: relative;
    overflow: hidden;
}

#start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle fill="%23ffd700" cx="20" cy="30" r="3"/><circle fill="%23cd7f32" cx="70" cy="60" r="4"/><circle fill="%23b9f2ff" cx="45" cy="80" r="2"/></svg>');
    background-size: 100px 100px;
    opacity: 0.1;
    animation: float 20s linear infinite;
}

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

.start-content {
    text-align: center;
    z-index: 10;
    padding: 40px;
    max-width: 500px;
}

.game-title {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.5); }
    to { text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 4px 8px rgba(0, 0, 0, 0.5); }
}

.game-subtitle {
    font-size: 20px;
    color: #d4a574;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
    }
    
    .game-subtitle {
        font-size: 18px;
    }
    
    .time-info {
        font-size: 16px;
    }
    
    .time-info strong {
        font-size: 20px;
    }
    
    .btn-start {
        font-size: 22px;
        padding: 18px 30px;
    }
    
    .game-rules h3 {
        font-size: 20px;
    }
    
    .game-rules li {
        font-size: 16px;
    }
    
    .header-item .label {
        font-size: 14px;
    }
    
    .header-item .value {
        font-size: 32px;
    }
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .ore-type {
        font-size: 28px;
    }
    
    .points {
        font-size: 24px;
    }
    
    .question-text {
        font-size: 26px;
    }
    
    .option-btn {
        font-size: 20px;
        padding: 18px 25px;
    }
    
    .result-text {
        font-size: 28px;
    }
    
    .result-btn {
        font-size: 20px;
        padding: 15px 35px;
    }
}

.game-info {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.time-info {
    font-size: 18px;
    color: #d4a574;
    text-align: center;
}

.time-info strong {
    color: #ffd700;
    font-size: 22px;
}

.btn-start {
    width: 100%;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    color: #2c1810;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    margin-bottom: 25px;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

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

.game-rules {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 20px;
    text-align: left;
    border: 1px solid #8b4513;
}

.game-rules h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 18px;
}

.game-rules ul {
    list-style: none;
    color: #d4a574;
}

.game-rules li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 69, 19, 0.3);
}

.game-rules li:last-child {
    border-bottom: none;
}

#game-screen {
    background: url('../images/background.png') center/cover no-repeat;
    background-color: #1a0f0a;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

#game-header {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    border: none;
}

.header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 25px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    min-width: 120px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.header-item .label {
    font-size: 12px;
    color: #d4a574;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-item .value {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#game-canvas {
    display: block;
    margin: 0 auto;
    background: transparent;
    flex: 1;
    max-width: 100%;
}

.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: 100;
}

.modal-content {
    background: linear-gradient(135deg, #2c1810 0%, #4a2c17 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border: 3px solid #8b4513;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease-out;
}

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

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #8b4513;
}

.ore-type {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.points {
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.question-text {
    font-size: 22px;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 18px 20px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #4a2c17 0%, #6b3e26 100%);
    border: 2px solid #8b4513;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.option-btn:hover {
    background: linear-gradient(135deg, #6b3e26 0%, #8b4513 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.5);
}

.option-btn.correct {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
}

.option-btn.wrong {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    border-color: #dc3545;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s;
}

.feedback.show {
    opacity: 1;
}

.feedback.correct {
    background: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.feedback.wrong {
    background: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

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

.game-over-content {
    text-align: center;
    padding: 50px;
    max-width: 450px;
}

.end-title {
    font-size: 42px;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.final-score {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 3px solid #ffd700;
}

.score-label {
    display: block;
    font-size: 16px;
    color: #d4a574;
    margin-bottom: 10px;
}

.score-value {
    display: block;
    font-size: 64px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px 10px;
    border: 1px solid #8b4513;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #d4a574;
    margin-bottom: 8px;
}

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

.result-message {
    font-size: 20px;
    color: #d4a574;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.btn-restart {
    padding: 18px 50px;
    font-size: 20px;
    font-weight: bold;
    color: #2c1810;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.btn-restart:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

@media (max-width: 768px) {
    .game-title {
        font-size: 28px;
    }
    
    .game-subtitle {
        font-size: 16px;
    }
    
    .start-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .config-panel {
        padding: 20px;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .option-btn {
        padding: 15px;
        font-size: 14px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px 10px;
    }
    
    #game-header {
        gap: 10px;
        padding: 10px;
    }
    
    .header-item {
        min-width: 70px;
        padding: 8px 12px;
    }
    
    .header-item .label {
        font-size: 10px;
    }
    
    .header-item .value {
        font-size: 18px;
    }
    
    .score-value {
        font-size: 48px;
    }
    
    .end-title {
        font-size: 32px;
    }
    
    .final-score {
        padding: 20px;
    }
    
    .game-over-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 24px;
    }
    
    .game-subtitle {
        font-size: 14px;
    }
    
    .game-rules {
        padding: 15px;
    }
    
    .game-rules li {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .config-item label {
        font-size: 13px;
    }
    
    .btn-start {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .header-item {
        min-width: 60px;
        padding: 6px 10px;
    }
    
    .header-item .value {
        font-size: 16px;
    }
    
    .question-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 13px;
    }
    
    .ore-type {
        font-size: 18px;
    }
    
    .points {
        font-size: 16px;
    }
}

@media (orientation: portrait) {
    #game-screen {
        background-position: center center;
    }
}

@media (orientation: landscape) {
    #game-screen {
        background-position: center center;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .game-title {
        font-size: 42px;
    }
    
    .game-subtitle {
        font-size: 22px;
    }
    
    .start-content {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .game-info {
        padding: 20px;
    }
    
    .time-info {
        font-size: 20px;
    }
    
    .time-info strong {
        font-size: 26px;
    }
    
    .btn-start {
        font-size: 24px;
        padding: 20px 40px;
    }
    
    .game-rules {
        padding: 20px;
    }
    
    .game-rules h3 {
        font-size: 22px;
    }
    
    .game-rules li {
        font-size: 18px;
        padding: 10px 0;
    }
    
    #game-header {
        gap: 20px;
        padding: 15px 10px;
    }
    
    .header-item {
        min-width: 90px;
        padding: 12px 18px;
    }
    
    .header-item .label {
        font-size: 14px;
    }
    
    .header-item .value {
        font-size: 36px;
    }
    
    .modal-content {
        padding: 30px 25px;
        width: 95%;
        max-width: 95%;
    }
    
    .ore-type {
        font-size: 32px;
    }
    
    .points {
        font-size: 26px;
    }
    
    .question-text {
        font-size: 28px;
        line-height: 1.6;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .option-btn {
        font-size: 22px;
        padding: 20px 25px;
    }
    
    .end-title {
        font-size: 42px;
    }
    
    .score-value {
        font-size: 72px;
    }
    
    .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .stat-item {
        padding: 20px 15px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .result-message {
        font-size: 22px;
    }
    
    .btn-restart {
        font-size: 24px;
        padding: 20px 50px;
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    .game-title {
        font-size: 36px;
    }
    
    .game-subtitle {
        font-size: 18px;
    }
    
    .time-info {
        font-size: 18px;
    }
    
    .time-info strong {
        font-size: 24px;
    }
    
    .btn-start {
        font-size: 22px;
        padding: 18px 35px;
    }
    
    .game-rules h3 {
        font-size: 20px;
    }
    
    .game-rules li {
        font-size: 16px;
    }
    
    .header-item {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .header-item .label {
        font-size: 12px;
    }
    
    .header-item .value {
        font-size: 32px;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .ore-type {
        font-size: 28px;
    }
    
    .points {
        font-size: 22px;
    }
    
    .question-text {
        font-size: 24px;
    }
    
    .option-btn {
        font-size: 20px;
        padding: 18px 22px;
    }
    
    .end-title {
        font-size: 36px;
    }
    
    .score-value {
        font-size: 64px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}
