/* Panels */
#bottom-panel {
    position: relative; 
    height: 35%;
    background: linear-gradient(to bottom, #1a0505, #000000);
    padding: 15px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 50;
    gap: 15px;
}

#control-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    background: rgba(20, 20, 20, 0.5);
    border-radius: 12px;
    border: 3px solid #222;
    padding: 15px;
    box-sizing: border-box;
}

#bottom-main-ui {
    display: flex;
    flex: 1;
    width: 100%;
    gap: 30px;
    overflow: hidden;
}

/* Gauges */
#gauges-container {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    margin-bottom: 12px;
    padding: 0 15px;
    box-sizing: border-box;
}

.gauge-half { flex: 1; display: flex; flex-direction: column; position: relative; }
.gauge-header { display: flex; justify-content: space-between; font-size: 24px; margin-bottom: 3px; font-weight: bold; text-transform: uppercase; }
.gauge-header span:first-child { color: #aaa; }
.gauge-half:first-child .gauge-header span:first-child { color: #00e5ff; text-shadow: 0 0 15px rgba(0, 229, 255, 0.5); }
.gauge-half:first-child .gauge-header span:last-child { color: #00e5ff; text-shadow: 0 0 24px rgba(0, 229, 255, 0.8); }

.gauge-icon { font-size: 36px; margin-right: 6px; vertical-align: middle; }
.gauge-bar-bg {
    width: 100%;
    height: 15px;
    background-color: #111;
    border: 3px solid #333;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 0 9px #000;
}

#se-gauge-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #008ba3, #00e5ff); box-shadow: 0 0 24px rgba(0, 229, 255, 0.6); transition: width 0.3s ease; }
#portal-gauge-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #4b0082, #9400d3); box-shadow: 0 0 24px rgba(148, 0, 211, 0.6); transition: width 0.3s ease; }

/* Status Labels */
#top-status-bar {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

#enemy-counter {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #4a0000;
    border-radius: 30px;
    padding: 10px 30px;
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 0, 0, 0.2);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
}

#enemies-left { color: #ff0000; font-size: 30px; text-shadow: 0 0 10px #ff0000; }
#stage-title-container { font-size: 11px; font-weight: bold; color: #ff4500; text-shadow: 0 0 10px rgba(255, 69, 0, 0.8), 0 0 2px #000; letter-spacing: 1px; animation: textBreathing 3s infinite alternate ease-in-out; }
#stage-debuff-header { font-size: 21px; color: #ff0000; text-align: center; font-weight: bold; text-transform: uppercase; margin-bottom: 15px; }

/* Difficulty Message */
#difficulty-msg-container { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); z-index: 200; pointer-events: none; text-align: center; width: 100%; }
#difficulty-msg { font-family: serif; font-size: 28px; font-weight: bold; color: #ff0000; text-shadow: 0 0 20px #ff0000, 0 0 5px #000; letter-spacing: 2px; opacity: 0; transform: scale(0.5); }
.difficulty-anim { animation: difficultyStrike 2s ease-out forwards; }

@keyframes difficultyStrike {
    0% { opacity: 0; transform: scale(3) rotate(-10deg); filter: blur(10px); }
    20% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0px); }
    80% { opacity: 1; transform: scale(1.1); filter: blur(0px); }
    100% { opacity: 0; transform: scale(1.5); filter: blur(5px); }
}

/* Buttons & Controls */
.job-btn {
    display: inline-block;
    padding: 6px 24px;
    font-size: 27px;
    border-radius: 36px;
    cursor: pointer;
    border: 3px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.job-btn.active { background: linear-gradient(to bottom, #4CAF50, #2E7D32); color: white; box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.job-btn.active:hover { transform: translateY(-3px); box-shadow: 0 9px 18px rgba(0,0,0,0.4); }

#info-sell-btn { background: linear-gradient(to bottom, #ef5350, #b71c1c) !important; }
#info-abyss-btn { padding: 12px 36px; border-radius: 45px; margin-top: 15px; }

.master-btn-container { margin-top: 18px; width: 100%; display: flex; justify-content: space-between; gap: 15px; }
.master-btn-container .job-btn { flex: 1; margin: 0 6px; padding: 9px 3px; font-size: 24px; line-height: 1.1; }

#tutorial-toggle-container { position: absolute; top: 15px; right: 15px; z-index: 1000; display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.6); padding: 5px 15px; border-radius: 30px; border: 2px solid #333; }
#tutorial-label { font-size: 18px; color: #ffd700; font-weight: bold; letter-spacing: 1px; }
#tutorial-status { font-size: 18px; color: #ffd700; font-weight: bold; min-width: 40px; text-align: center; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #ffd700; }
input:checked + .slider:before { transform: translateX(18px); }
.slider.round { border-radius: 36px; }
.slider.round:before { border-radius: 50%; }

#restart-btn-top { position: absolute; top: 15px; left: 15px; z-index: 1000; background: linear-gradient(135deg, #2a0505, #000000); color: #ff4500; border: 2px solid #8b0000; border-radius: 8px; font-size: 18px; padding: 8px 16px; cursor: pointer; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 10px rgba(139, 0, 0, 0.5); transform-origin: left top; }
#restart-btn-top:hover { background: linear-gradient(135deg, #4a0000, #1a0000); color: #fff; border-color: #ff0000; box-shadow: 0 0 45px rgba(255, 0, 0, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.1); text-shadow: 0 0 15px #fff; transform: scale(1.05); }
#restart-btn-top:active { transform: scale(0.95); box-shadow: 0 0 6px rgba(255, 0, 0, 0.8); }

/* Warnings */
.card-warning { position: absolute; top: -66px; left: 50%; transform: translateX(-50%); background: #ff0000; color: #fff; font-size: 21px; padding: 6px 15px; border-radius: 12px; white-space: nowrap; font-weight: bold; box-shadow: 0 0 30px #ff0000; z-index: 100; pointer-events: none; display: none; }
.card-warning::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -3px; border-width: 3px; border-style: solid; border-color: #ff0000 transparent transparent transparent; }
.tower-card.locked:hover .card-warning { display: block; }

#max-units-warning {
    position: fixed; top: 25%; left: 50%; transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(20, 0, 30, 0.9), rgba(0, 0, 0, 0.95));
    color: #9400d3; padding: 15px 30px; border: 1px solid #4b0082; border-radius: 4px;
    z-index: 1000; pointer-events: none;
    box-shadow: 0 0 30px rgba(148, 0, 211, 0.6), inset 0 0 15px #000;
    text-shadow: 2px 2px 4px #000, 0 0 10px #ff0000;
    animation: cursePulse 2s infinite ease-in-out; text-align: center;
}

@keyframes cursePulse {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); filter: hue-rotate(0deg) blur(0.5px); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); filter: hue-rotate(-20deg) blur(0px); box-shadow: 0 0 45px rgba(148, 0, 211, 0.8); }
    100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); filter: hue-rotate(0deg) blur(0.5px); }
}
