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

body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-wrapper {
    position: relative;
}

.title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 16px;
    color: #f1c40f;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.game-container {
    display: flex;
    gap: 16px;
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

#gameCanvas {
    border: 3px solid #2c3e50;
    border-radius: 8px;
    background: #4a7c3a;
    cursor: crosshair;
    display: block;
}

.side-panel {
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats {
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.stat-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.stat-label {
    color: #bdc3c7;
    flex: 1;
}

.stat-value {
    font-weight: bold;
    color: #f1c40f;
    font-size: 17px;
}

.section-title {
    font-size: 14px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
}

.tower-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tower-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #ecf0f1;
}

.tower-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(3px);
}

.tower-btn.selected {
    border-color: #f1c40f;
    background: rgba(241,196,15,0.15);
}

.tower-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tower-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.tower-btn-info {
    flex: 1;
    text-align: left;
}

.tower-btn-name {
    font-size: 15px;
    font-weight: bold;
}

.tower-btn-cost {
    font-size: 13px;
    color: #f1c40f;
}

.tower-info {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    min-height: 90px;
    line-height: 1.6;
}

.info-line {
    color: #bdc3c7;
}

.info-line strong {
    color: #f1c40f;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctrl-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.ctrl-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ctrl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.start-btn { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.pause-btn { background: linear-gradient(135deg, #e67e22, #f39c12); }
.reset-btn { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.hint {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
    padding: 6px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    line-height: 1.5;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: linear-gradient(135deg, #2c3e50, #1a1a2e);
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    border: 2px solid #f1c40f;
    box-shadow: 0 0 40px rgba(241,196,15,0.3);
    max-width: 400px;
}

.overlay-content h2 {
    font-size: 32px;
    color: #f1c40f;
    margin-bottom: 16px;
}

.overlay-content p {
    font-size: 16px;
    color: #bdc3c7;
    margin-bottom: 24px;
    line-height: 1.6;
}

.overlay-btn {
    padding: 14px 40px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.overlay-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(46,204,113,0.4);
}
