﻿@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --primary-blue: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent-gold: #fbbf24;
    --danger-red: #ef4444;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(59, 130, 246, 0.3);
    --neon-glow: 0 0 10px rgba(59, 130, 246, 0.5);
}

body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', 'Noto Sans KR', sans-serif;
    overflow: hidden;
    /* ?ㅽ겕濡ㅻ컮 ?앹꽦 諛⑹? */
    background-color: #000;
    user-select: none;
    touch-action: none;
    color: #e2e8f0;

    /* Center Content */
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-wrapper {
    position: relative;
    /* Default full screen, mode switching will override */
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    background-color: #020617;
    /* Game BG */

    transform-origin: center center;
}

h1,
h2,
h3,
.font-tech {
    font-family: 'Orbitron', sans-serif;
}

/* ?좊땲硫붿씠??*/
@keyframes hologram-flicker {
    0% {
        opacity: 0.95;
    }

    5% {
        opacity: 0.8;
    }

    10% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.95;
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes pulse-border {
    0% {
        border-color: rgba(59, 130, 246, 0.3);
    }

    50% {
        border-color: rgba(59, 130, 246, 0.8);
    }

    100% {
        border-color: rgba(59, 130, 246, 0.3);
    }
}

.title-shadow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.map-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #334155;
    overflow: hidden;
    position: relative;
    border-radius: 0.75rem;
    background: #0f172a;
}

.map-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    border-color: var(--primary-blue);
}

.warning-active {
    animation: pulse-red 1.5s infinite;
}

.emp-effect {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    background: white;
    opacity: 0;
    transition: opacity 0.5s;
}

.emp-effect.active {
    opacity: 0.8;
}

/* UI Buttons */
.btn-category {
    background: rgba(30, 41, 59, 0.5);
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.btn-category.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.btn-unit {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.btn-unit:active {
    transform: scale(0.96);
    background: #1e293b;
}

.btn-unit:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-disabled {
    opacity: 0.3;
    filter: grayscale(100%);
    pointer-events: none;
}

.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20;
    transition: height 0.1s linear;
}

.count-text {
    font-family: 'Orbitron';
    font-weight: 700;
    color: #e2e8f0;
    z-index: 30;
    text-shadow: 2px 2px 0 #000;
    font-size: 0.8rem;
}

.queue-badge {
    font-family: 'Rajdhani';
    font-weight: bold;
    background: var(--danger-red);
}

/* HUD Minimap */
#hud-minimap-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 240px;
    height: 140px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--primary-blue);
    border-radius: 0.5rem;
    overflow: hidden;
    z-index: 40;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    cursor: crosshair;
}

#hud-minimap-container:hover {
    border-color: var(--accent-gold);
}

/* Minimap toggle + speed controls (separate from minimap, so they won't be covered) */
#hud-minimap-toggle {
    position: absolute;
    top: 0.75rem;
    right: calc(1rem + 240px + 0.75rem);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
}

/* Keep options button reachable (not under minimap) */
#hud-option-btn {
    right: 1rem;
}

#hud-minimap-toggle:hover {
    border-color: var(--primary-blue);
}

#hud-ctrl-wrapper {
    position: fixed;
    top: calc(1rem + 140px + 0.5rem);
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    z-index: 50;
}

#hud-ctrl-body.hidden {
    display: none;
}

#hud-speed-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

#hud-speed-controls .btn-speed,
#hud-ctrl-toggle {
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid #475569;
    color: #cbd5e1;
    cursor: pointer;
}

#hud-speed-controls .btn-speed:hover,
#hud-ctrl-toggle:hover {
    border-color: var(--primary-blue);
    color: #fff;
}

#hud-speed-controls .btn-speed.active {
    background: rgba(37, 99, 235, 0.95);
    border-color: #60a5fa;
    color: #fff;
}

#hud-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
    border-left: 1px solid rgba(71, 85, 105, 0.8);
}

#hud-zoom-text {
    min-width: 48px;
    text-align: center;
    font-weight: 800;
    color: #e2e8f0;
    font-size: 12px;
    letter-spacing: 0.5px;
}

#hud-overlay {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* Mobile: keep UI compact so it doesn't block the screen */
@media (max-width: 768px) {
    #hud-minimap-container {
        width: 210px;
        height: 135px;
        top: 10px;
        right: 10px;
    }

    #hud-minimap-toggle {
        top: 6px;
        right: calc(10px + 210px + 0.5rem);
        width: 38px;
        height: 38px;
    }

    #hud-ctrl-wrapper {
        top: calc(10px + 135px + 0.5rem);
        right: 10px;
        gap: 4px;
        padding: 5px;
    }

    .option-panel {
        width: 92vw;
        max-width: 92vw;
        max-height: 88vh;
        overflow-y: auto;
        padding: 1rem;
    }

    #hud-option-btn {
        top: 10px;
        right: calc(10px + 210px + 0.5rem + 38px + 0.5rem);
        left: auto;
    }

    #unit-cmd-wrapper {
        top: 3.25rem;
        right: calc(10px + 210px + 0.5rem);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.option-panel {
    width: 90%;
    max-width: 500px;
    background: #0f172a;
    border: 1px solid #334155;
    border-top: 4px solid var(--primary-blue);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 1rem;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .option-panel {
    transform: translateY(0);
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent-gold);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #334155;
    border-radius: 2px;
}

/* Safe Zone for Toast */
#toast-msg {
    top: 15%;
    font-family: 'Rajdhani';
    letter-spacing: 1px;
    border-left: 4px solid var(--accent-gold);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.8) 100%);
}

/* [NEW] Queue Badge */
.queue-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0 4px;
    border-radius: 4px;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading Bar Glow */
#loading-bar {
    box-shadow: 0 0 15px #3b82f6;
}

/* Used Skill Button */
.btn-unit.used {
    filter: grayscale(100%) brightness(0.5);
    pointer-events: none;
}

/* RECLAIM/style.css 留??꾨옒 異붽? */

/* style.css 留??꾨옒 異붽? */

/* 紐⑤컮??媛濡?紐⑤뱶 ?꾩슜 ?ㅽ???(?믪씠媛 500px ?댄븯???? */


/* ============================================
   [R 2.4] Unit Command Panel Styles
   ============================================ */
#unit-cmd-wrapper {
    position: absolute;
    top: 3.25rem;
    right: calc(1rem + 240px + 12px);
    z-index: 41;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cmd-toggle-btn {
    padding: 0.4rem 0.6rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #3b82f6;
    border-radius: 0.25rem;
    color: #60a5fa;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
}

.cmd-toggle-btn:hover {
    background: #3b82f6;
    color: white;
}

#unit-cmd-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

#cmd-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#cmd-panel-toggle {
    font-family: system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

#cmd-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

#cmd-actions.is-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

#unit-cmd-panel.is-horizontal {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#unit-cmd-panel.is-horizontal #cmd-header {
    flex: 0 0 auto;
}

#unit-cmd-panel.is-horizontal #cmd-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.cmd-layout-toggle {
    padding: 0.25rem 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
    border-radius: 0.25rem;
    color: #e2e8f0;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
}

.cmd-layout-toggle:hover {
    border-color: var(--primary-blue);
    color: #fff;
}

/* hidden ?좉???id(display:flex)蹂대떎 ?곗꽑?섎룄濡?*/
#cmd-actions.hidden { display: none; }
#unit-cmd-wrapper.hidden { display: none; }

#unit-cmd-panel .cmd-btn-action {
    padding: 0.5rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 0.25rem;
    background: #1e293b;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    min-width: 84px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

#unit-cmd-panel .cmd-btn-action:hover {
    background: #334155;
    border-color: #3b82f6;
}

#unit-cmd-panel .cmd-btn-action.active {
    background: #3b82f6;
    color: white;
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* 紐⑤컮??媛濡?紐⑤뱶 ???*/
@media screen and (max-height: 500px) and (orientation: landscape) {
    #unit-cmd-panel {
        top: auto !important;
        bottom: 10px !important;
        right: 10px !important;
        transform: scale(0.85);
        transform-origin: bottom right;
    }
}

/* Clear selection button */
#unit-cmd-panel .cmd-btn-clear {
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

#unit-cmd-panel .cmd-btn-clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}



@media (orientation: landscape) and (max-height: 520px) {
    #hud-minimap-container { width: 210px; height: 135px; }
    #unit-list-container { height: 64px; }
}

@media (max-width: 768px) and (orientation: portrait) {
    #hud-overlay {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px) + 18px);
    }

    #lobby-screen {
        justify-content: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-top: max(12px, env(safe-area-inset-top)) !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #hud-overlay {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px) + 44px);
    }
}
#unit-cmd-panel .cmd-ico {
    width: 18px;
    text-align: center;
    flex: 0 0 18px;
}

