/* Google 字體 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap');

/* 基本樣式 */
body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

/* 遊戲主容器 */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 1200px;
}

/* 遊戲畫布 */
#game-canvas {
    background-color: #2c2c2c;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    cursor: default;
}

/* 遊戲主控制面板 */
#main-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 800px;
}

/* 頂部面板 (狀態 + 操作) */
#top-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background-color: #2c2c2c;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    gap: 16px;
    width: 100%;
}

#status-group { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}
#action-group { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    justify-content: center; 
}

.status-display {
    font-size: 1em; 
    font-weight: 700; 
    background: #3d3d3d;
    padding: 8px 12px; 
    border-radius: 8px; 
    min-width: 100px; 
    text-align: center;
}

button {
    font-family: 'Noto Sans TC', sans-serif; 
    border: none;
    padding: 10px 14px; 
    border-radius: 8px; 
    cursor: pointer;
    font-size: 0.9em; 
    font-weight: 700; 
    transition: all 0.3s ease;
}

#action-group button {
    background: linear-gradient(145deg, #007bff, #0056b3); 
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

#action-group button.tier2 {
     background: linear-gradient(145deg, #9400D3, #4B0082); /* 紫色代表二級塔 */
     box-shadow: 0 4px 8px rgba(148, 0, 211, 0.3);
}

#action-group button:hover:not(:disabled) {
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
}
 #action-group button.tier2:hover:not(:disabled) {
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(148, 0, 211, 0.5);
}

button:disabled {
    background: #555 !important; 
    color: #aaa !important; 
    cursor: not-allowed;
    box-shadow: none !important; 
    transform: none !important;
}

#action-group button.active {
    background: linear-gradient(145deg, #28a745, #218838);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.5);
}

#action-group button.sell-active {
     background: linear-gradient(145deg, #dc3545, #c82333);
     box-shadow: 0 4px 10px rgba(220, 53, 69, 0.5);
}

#start-wave-btn {
    width: 100%; 
    background-color: #ffffff; 
    color: #28a745;
    font-size: 1.2em; 
    padding: 14px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}
#start-wave-btn:hover:not(:disabled) {
    background-color: #f0f0f0; 
    transform: translateY(-2px);
}

#game-over-modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center; 
    align-items: center;
}
#game-over-modal-content {
    background: #2c2c2c; 
    padding: 40px; 
    border-radius: 16px; 
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
    animation: fadeIn 0.5s ease;
}
#game-over-message { 
    font-size: 2.5em; 
    font-weight: 700; 
    margin-bottom: 20px; 
}
@keyframes fadeIn { 
    from { opacity: 0; transform: scale(0.9); } 
    to { opacity: 1; transform: scale(1); } 
}
