* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #121212, #303030);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: backgroundGradient 20s ease infinite alternate;
}

@keyframes backgroundGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-container {
    display: flex;
    width: 100%;
    max-width: 800px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.game-container {
    position: relative;
    width: min(800px, 95vw);
    height: min(600px, calc(95vw * 0.75), calc(100vh - 40px));
    background-color: #000000;
    box-shadow: 0 15px 35px rgba(0, 255, 0, 0.5);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.game-container:hover {
    transform: translateY(-5px);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10;
    border-radius: 15px;
}

.screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.screen p {
    font-size: 20px;
    margin: 10px 0;
    color: #ffffff;
}

/* 大魏老師資訊課程按鈕樣式 */
.course-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background-color: #2c5f2f;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.course-btn:hover {
    background-color: #39753d;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.course-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#hudOverlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    font-size: 22px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 1px 1px 2px #000000;
}

#hudOverlay div {
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

#hudOverlay div:hover {
    transform: scale(1.05);
}

/* 右下角遊戲說明 */
.game-info-corner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #00ff00;
    max-width: 250px;
    text-align: left;
    z-index: 100;
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-info-corner:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 255, 0, 0.4);
}

.game-info-content {
    display: flex;
    flex-direction: column;
}

.game-info-content h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 22px;
    text-align: center;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.game-info-content p {
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.5;
}

.game-info-content .course-btn {
    margin-top: 25px;
    display: block;
    text-align: center;
}

/* 媒體查詢 - 平板 */
@media (max-width: 1100px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info-corner {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: auto;
        max-width: 250px;
    }
}

/* 媒體查詢 - 手機 */
@media (max-width: 850px) {
    .game-container {
        width: 100%;
        max-width: 800px;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    .game-info-corner {
        padding: 15px;
        max-width: 200px;
    }
    
    .game-info-content h3 {
        font-size: 18px;
    }
    
    .game-info-content p {
        font-size: 14px;
    }
    
    #hudOverlay {
        font-size: 18px;
        top: 15px;
        left: 15px;
    }
    
    .audio-control {
        top: 15px;
        right: 15px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 觸控控制按鈕樣式 (用於手機) */
.touch-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 5;
}

.touch-btn {
    width: 70px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 255, 0, 0.7);
    color: #00ff00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.touch-btn:active {
    background-color: rgba(0, 255, 0, 0.3);
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 特殊效果動畫 */
@keyframes pulseEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 在移動設備上顯示觸控控制 */
@media (max-width: 600px), (pointer: coarse) {
    .touch-controls {
        display: flex;
    }
    
    .course-btn {
        font-size: 14px;
        padding: 8px 15px;
    }
    
    .game-info-corner {
        bottom: 80px; /* 避開觸控控制 */
        right: 10px;
        max-width: 180px;
        padding: 10px;
    }
    
    .game-info-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .game-info-content p {
        font-size: 12px;
        margin: 5px 0;
    }
    
    .game-info-content .course-btn {
        margin-top: 15px;
        font-size: 12px;
        padding: 5px 10px;
    }
}

.teacher-icon {
    font-size: 110%;
    margin-right: 3px;
    vertical-align: middle;
}

.teacher-text {
    vertical-align: middle;
    font-size: 14px;
    white-space: nowrap;
    display: inline-block;
}

.game-info h3 {
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: 18px;
    text-align: right;
}

/* 音效控制按鈕樣式 */
.audio-control {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.control-btn {
    background-color: rgba(0, 0, 0, 0.7);
    color: #00ff00;
    border: 2px solid #00ff00;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.control-btn:hover {
    background-color: rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 255, 0, 0.6);
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 255, 0, 0.4);
} 