/* ==========================================================================
   STYLE RULES - BORDER RANK WARS TACTICAL SIMULATOR
   ========================================================================== */

/* Color & Variable System */
:root {
    --bg-dark: #070b0e;
    --bg-panel: rgba(14, 22, 29, 0.7);
    --bg-active: rgba(0, 240, 255, 0.15);

    --border-cyan: #00f0ff;
    --border-green: #39ff14;
    /* Trion Green */
    --border-yellow: #ffdf00;
    /* Shooter Yellow */
    --border-purple: #bd00ff;
    /* Spider Purple */
    --border-blue: #0084ff;
    /* Teleport Blue */
    --border-gray: rgba(255, 255, 255, 0.15);

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-accent: #00f0ff;
    --text-trion: #39ff14;

    --font-cyber: 'Orbitron', sans-serif;
    --font-main: 'Inter', sans-serif;

    --shadow-glow: 0 0 15px rgba(0, 240, 255, 0.3);
    --shadow-trion: 0 0 15px rgba(57, 255, 20, 0.4);
}

/* Reset & Base Rules */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Cyber Grid Overlay Background */
.cyber-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: gridPulse 8s ease-in-out infinite alternate;
}

@keyframes gridPulse {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes scanline {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Typography Extensions */
h1,
h2,
h3,
.hud-numeric,
.key-badge,
.combo-key,
.stat-value,
.label,
.btn {
    font-family: var(--font-cyber);
    letter-spacing: 1px;
}

/* Glassmorphism utility card */
.card-blur {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-gray);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Buttons */
.btn {
    background: transparent;
    border: 1px solid var(--text-accent);
    color: var(--text-primary);
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn:hover {
    background: var(--bg-active);
    box-shadow: var(--shadow-glow);
    text-shadow: 0 0 5px var(--text-accent);
    border-color: var(--border-cyan);
}

.btn-primary {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--border-green);
    color: var(--border-green);
}

.btn-primary:hover {
    background: rgba(57, 255, 20, 0.25);
    box-shadow: var(--shadow-trion);
    border-color: var(--border-green);
    text-shadow: 0 0 5px var(--border-green);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-gray);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* Screens toggles */
.screen {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    z-index: 10;
    /* padding: 20px; */
}

.screen.active {
    display: flex;
}

/* ==========================================================================
   LOBBY SCREEN
   ========================================================================== */

.lobby-header {
    text-align: center;
    margin-bottom: 15px;
    z-index: 1;
}

.logo-area {
    display: inline-block;
    padding: 10px 40px;
    border-bottom: 2px solid var(--border-cyan);
    position: relative;
}

.logo-area::before,
.logo-area::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 10px;
    height: 8px;
    background: var(--border-cyan);
}

.logo-area::before {
    left: 0;
}

.logo-area::after {
    right: 0;
}

.logo-area h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.logo-area .subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.lobby-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 25px;
    /* flex: 1; */
    overflow: hidden;
    z-index: 1;
    max-width: 90vw;
    margin: 0 auto;
    width: 100%;
}

.panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-gray);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.panel:hover {
    border-color: rgba(0, 240, 255, 0.3);
}

.panel-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: var(--text-accent);
}

.panel-header h2 .icon {
    margin-right: 8px;
}

/* Agent Selection List */
/* .agent-panel, */
.agent-grid

/* .briefcase-panel  */
    {
    /* max-height: calc(100vh - 150px); */
    max-height: 500px;
    overflow-y: auto;
}

.briefcase-panel {
    max-height: 100vh;
    overflow-y: auto;
}

/* Custom Scrollbars for Panels */
.agent-panel::-webkit-scrollbar,
.agent-grid::-webkit-scrollbar,
.briefcase-panel::-webkit-scrollbar,
.scrollable::-webkit-scrollbar,
.squads-config-grid::-webkit-scrollbar,
.bailout-details::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.agent-panel::-webkit-scrollbar-track,
.agent-grid::-webkit-scrollbar-track,
.briefcase-panel::-webkit-scrollbar-track,
.scrollable::-webkit-scrollbar-track,
.squads-config-grid::-webkit-scrollbar-track,
.bailout-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.agent-panel::-webkit-scrollbar-thumb,
.agent-grid::-webkit-scrollbar-thumb,
.briefcase-panel::-webkit-scrollbar-thumb,
.scrollable::-webkit-scrollbar-thumb,
.squads-config-grid::-webkit-scrollbar-thumb,
.bailout-details::-webkit-scrollbar-thumb {
    background: var(--border-cyan);
    border-radius: 3px;
    box-shadow: 0 0 5px var(--border-cyan);
}

.agent-panel::-webkit-scrollbar-thumb:hover,
.agent-grid::-webkit-scrollbar-thumb:hover,
.briefcase-panel::-webkit-scrollbar-thumb:hover,
.scrollable::-webkit-scrollbar-thumb:hover,
.squads-config-grid::-webkit-scrollbar-thumb:hover,
.bailout-details::-webkit-scrollbar-thumb:hover {
    background: var(--border-green);
    box-shadow: 0 0 5px var(--border-green);
}

.agent-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    /* overflow-y: auto; */
    flex: 1;
}

.agent-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-gray);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 48.5%;
}

.agent-card:hover {
    border-color: var(--border-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.agent-card.active {
    border-color: var(--border-green);
    background: rgba(57, 255, 20, 0.05);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
}

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--border-gray);
}

.agent-card.active .agent-avatar {
    border-color: var(--border-green);
    box-shadow: 0 0 8px var(--border-green);
}

/* Avatar Colors (Applying uploaded chibi character photos over signature glowing gradients) */
.agent-avatar.yuma {
    background-image: url('chibi/Yuma.png'), radial-gradient(circle, rgba(255, 255, 255, 0.25) 30%, rgba(58, 58, 58, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.osamu {
    background-image: url('chibi/Osamu.png'), radial-gradient(circle, rgba(68, 138, 255, 0.25) 30%, rgba(26, 35, 126, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.chika {
    background-image: url('chibi/Chika.png'), radial-gradient(circle, rgba(255, 235, 59, 0.25) 30%, rgba(245, 127, 23, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.hyuse {
    background-image: url('chibi/Hyuse.png'), radial-gradient(circle, rgba(0, 230, 118, 0.25) 30%, rgba(0, 96, 100, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.arafune {
    background-image: url('chibi/Arafune.jpg'), radial-gradient(circle, rgba(68, 138, 255, 0.25) 30%, rgba(26, 35, 126, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.kakizaki {
    background-image: url('chibi/Kakizaki.jpg'), radial-gradient(circle, rgba(0, 150, 136, 0.25) 30%, rgba(0, 77, 64, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.murakami {
    background-image: url('chibi/Murakami.jpg'), radial-gradient(circle, rgba(0, 229, 255, 0.25) 30%, rgba(0, 96, 100, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.azuma {
    background-image: url('chibi/Azuma.jpg'), radial-gradient(circle, rgba(76, 175, 80, 0.25) 30%, rgba(27, 94, 32, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.ikoma {
    background-image: url('chibi/Ikoma.jpg'), radial-gradient(circle, rgba(244, 67, 54, 0.25) 30%, rgba(183, 28, 28, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.katori {
    background-image: url('chibi/Katori.jpg'), radial-gradient(circle, rgba(233, 30, 99, 0.25) 30%, rgba(136, 14, 79, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.nasu {
    background-image: url('chibi/Nasu.jpg'), radial-gradient(circle, rgba(156, 39, 176, 0.25) 30%, rgba(74, 20, 140, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.suwa {
    background-image: url('chibi/Suwa.jpg'), radial-gradient(circle, rgba(255, 152, 0, 0.25) 30%, rgba(230, 81, 0, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.kageura {
    background-image: url('chibi/Kageura.jpg'), radial-gradient(circle, rgba(183, 28, 28, 0.25) 30%, rgba(33, 33, 33, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.ninomiya {
    background-image: url('chibi/Ninomiya.jpg'), radial-gradient(circle, rgba(255, 215, 0, 0.25) 30%, rgba(245, 127, 23, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.yuba {
    background-image: url('chibi/Yuba.jpg'), radial-gradient(circle, rgba(255, 193, 7, 0.25) 30%, rgba(255, 111, 0, 0.6) 90%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-avatar.custom {
    background-image: url('chibi/Kyosuke.png'), radial-gradient(circle, rgba(224, 224, 224, 0.25) 20%, rgba(66, 66, 66, 0.6) 80%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.agent-info {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.agent-class {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Stat coefficient bar */
.stats-container {
    padding: 20px;
    border-top: 1px solid var(--border-gray);
    background: rgba(0, 0, 0, 0.2);
}

.stats-container h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.agent-stats-main {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
}

.agent-portrait-wrapper {
    flex-shrink: 0;
    position: relative;
}

.agent-portrait {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid var(--border-gray);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
    transition: all 0.3s ease;
}

.agent-portrait.yuma {
    background-image: url('chibi/Yuma.png'), radial-gradient(circle, rgba(255, 255, 255, 0.25) 30%, rgba(58, 58, 58, 0.5) 90%);
    border-color: var(--border-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
}

.agent-portrait.osamu {
    background-image: url('chibi/Osamu.png'), radial-gradient(circle, rgba(68, 138, 255, 0.25) 30%, rgba(26, 35, 126, 0.5) 90%);
    border-color: #448aff;
    box-shadow: 0 0 15px rgba(68, 138, 255, 0.35);
}

.agent-portrait.chika {
    background-image: url('chibi/Chika.png'), radial-gradient(circle, rgba(255, 235, 59, 0.25) 30%, rgba(245, 127, 23, 0.5) 90%);
    border-color: var(--border-yellow);
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.35);
}

.agent-portrait.hyuse {
    background-image: url('chibi/Hyuse.png'), radial-gradient(circle, rgba(0, 230, 118, 0.25) 30%, rgba(0, 96, 100, 0.5) 90%);
    border-color: var(--border-green);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.35);
}

.agent-portrait.arafune {
    background-image: url('chibi/Arafune.jpg'), radial-gradient(circle, rgba(68, 138, 255, 0.25) 30%, rgba(26, 35, 126, 0.5) 90%);
    border-color: #448aff;
    box-shadow: 0 0 15px rgba(68, 138, 255, 0.35);
}

.agent-portrait.kakizaki {
    background-image: url('chibi/Kakizaki.jpg'), radial-gradient(circle, rgba(0, 150, 136, 0.25) 30%, rgba(0, 77, 64, 0.5) 90%);
    border-color: #009688;
    box-shadow: 0 0 15px rgba(0, 150, 136, 0.35);
}

.agent-portrait.murakami {
    background-image: url('chibi/Murakami.jpg'), radial-gradient(circle, rgba(0, 229, 255, 0.25) 30%, rgba(0, 96, 100, 0.5) 90%);
    border-color: #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
}

.agent-portrait.azuma {
    background-image: url('chibi/Azuma.jpg'), radial-gradient(circle, rgba(76, 175, 80, 0.25) 30%, rgba(27, 94, 32, 0.5) 90%);
    border-color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.35);
}

.agent-portrait.ikoma {
    background-image: url('chibi/Ikoma.jpg'), radial-gradient(circle, rgba(244, 67, 54, 0.25) 30%, rgba(183, 28, 28, 0.5) 90%);
    border-color: #f44336;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.35);
}

.agent-portrait.katori {
    background-image: url('chibi/Katori.jpg'), radial-gradient(circle, rgba(233, 30, 99, 0.25) 30%, rgba(136, 14, 79, 0.5) 90%);
    border-color: #e91e63;
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.35);
}

.agent-portrait.nasu {
    background-image: url('chibi/Nasu.jpg'), radial-gradient(circle, rgba(156, 39, 176, 0.25) 30%, rgba(74, 20, 140, 0.5) 90%);
    border-color: #9c27b0;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.35);
}

.agent-portrait.suwa {
    background-image: url('chibi/Suwa.jpg'), radial-gradient(circle, rgba(255, 152, 0, 0.25) 30%, rgba(230, 81, 0, 0.5) 90%);
    border-color: #ff9800;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.35);
}

.agent-portrait.kageura {
    background-image: url('chibi/Kageura.jpg'), radial-gradient(circle, rgba(183, 28, 28, 0.25) 30%, rgba(33, 33, 33, 0.5) 90%);
    border-color: #b71c1c;
    box-shadow: 0 0 15px rgba(183, 28, 28, 0.35);
}

.agent-portrait.ninomiya {
    background-image: url('chibi/Ninomiya.jpg'), radial-gradient(circle, rgba(255, 215, 0, 0.25) 30%, rgba(245, 127, 23, 0.5) 90%);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.35);
}

.agent-portrait.yuba {
    background-image: url('chibi/Yuba.jpg'), radial-gradient(circle, rgba(255, 193, 7, 0.25) 30%, rgba(255, 111, 0, 0.5) 90%);
    border-color: #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.35);
}

.agent-portrait.custom {
    background-image: url('chibi/Kyosuke.png'), radial-gradient(circle, rgba(224, 224, 224, 0.2) 20%, rgba(66, 66, 66, 0.5) 80%);
    border-color: var(--border-gray);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.agent-stats-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    width: 120px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 15px;
}

.stat-bar-fill {
    height: 100%;
    background: var(--border-cyan);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    transition: width 0.5s ease-in-out;
}

#stat-trion {
    background: var(--border-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

.stat-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 65px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-btn {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--border-cyan);
    color: var(--text-accent);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 900;
    transition: all 0.2s ease;
    user-select: none;
    padding: 0;
    line-height: 1;
}

.stat-btn:hover {
    background: var(--border-cyan);
    color: #000;
    box-shadow: 0 0 8px var(--border-cyan);
}

.stat-num {
    display: inline-block;
    min-width: 15px;
    text-align: center;
}

.agent-bio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 15px;
    font-style: italic;
    border-left: 2px solid var(--border-cyan);
    padding-left: 10px;
}

/* Briefcase builder setup */
.briefcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    flex: 1;
}

.briefcase-column h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border-left: 3px solid var(--border-cyan);
    padding-left: 8px;
    text-transform: uppercase;
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.slot-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-gray);
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.slot-item:hover {
    border-style: solid;
    border-color: var(--border-cyan);
    background: rgba(0, 240, 255, 0.04);
}

.slot-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: transparent;
}

.slot-item:hover::before {
    background: var(--border-cyan);
}

.key-badge {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-gray);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-accent);
    margin-right: 15px;
}

.slot-content {
    display: flex;
    flex-direction: column;
}

.trigger-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.trigger-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 1px;
}

/* Custom categories color highlights */
.slot-item[data-type="attacker"] .key-badge {
    border-color: #ff3b30;
    color: #ff3b30;
}

.slot-item[data-type="shooter"] .key-badge {
    border-color: var(--border-yellow);
    color: var(--border-yellow);
}

.slot-item[data-type="sniper"] .key-badge {
    border-color: var(--border-blue);
    color: var(--border-blue);
}

.slot-item[data-type="support"] .key-badge {
    border-color: var(--border-green);
    color: var(--border-green);
}

.battle-parameters {
    margin: 0 20px 20px 20px;
    /* padding: 15px 20px; */
    /* border-radius: 6px; */
    /* border: 1px solid var(--border-gray); */
    border: unset;
}

.battle-parameters h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border-left: 3px solid var(--border-cyan);
    padding-left: 8px;
    text-transform: uppercase;
}

.params-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px 20px;
}

.squad-settings-header {
    /* grid-template-columns: repeat(5, 1fr); */
}


.select-rivals-group {
    grid-column: 1 / -1;
    /* Spans all available columns dynamically */
}

.rival-checkboxes-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    margin-bottom: 10px;
}

.rival-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-gray);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    user-select: none;
}

.rival-checkbox:hover {
    border-color: var(--border-cyan);
    background: rgba(0, 240, 255, 0.05);
    color: var(--text-primary);
}

.rival-checkbox.active {
    border-color: var(--border-green);
    background: rgba(57, 255, 20, 0.05);
    color: var(--text-primary);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.15);
}

.rival-checkbox input {
    margin: 0;
    cursor: pointer;
    accent-color: var(--border-green);
    width: 15px;
    height: 15px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    /* Prevents cell from expanding beyond grid bounds */
}

.param-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    /* display: block; */
    line-height: 1.2;
}

.cyber-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    /* Force full width in container */
    max-width: 100%;
    box-sizing: border-box;
}

.cyber-input:focus {
    border-color: var(--border-cyan);
    box-shadow: var(--shadow-glow);
}

.action-bar {
    padding: 10px 20px 0 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ==========================================================================
   TRIGGER SELECTOR MODAL (Briefcase editing dialog)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 580px;
    border-radius: 8px;
    border: 1px solid var(--border-cyan);
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 240, 255, 0.05);
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ff3b30;
}

.trigger-selector-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-gray);
    overflow: auto;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px;
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-accent);
    border-bottom-color: var(--border-cyan);
    background: rgba(0, 240, 255, 0.03);
}

.trigger-list-container {
    padding: 20px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.trigger-choice-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-gray);
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.trigger-choice-card:hover {
    border-color: var(--border-cyan);
    background: rgba(0, 240, 255, 0.04);
}

.trigger-choice-info h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.trigger-choice-info p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 4px;
    line-height: 1.3;
}

.trion-badge {
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    color: var(--border-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
    background: rgba(57, 255, 20, 0.05);
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* ==========================================================================
   GAMEPLAY SCREEN LAYOUT
   ========================================================================== */

#game-screen {
    background: #040608;
    height: 100vh;
    padding: 10px;
    flex-direction: column;
    overflow-y: auto;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
    padding: 0 20px;
    margin-bottom: 10px;
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 350px;
}

.hud-right {
    justify-content: flex-end;
}

.hud-stat-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    padding: 6px 12px;
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    align-items: center;
}

.hud-stat-box .label {
    color: var(--text-secondary);
}

.hud-stat-box .val {
    color: var(--text-primary);
    font-weight: 700;
}

.hud-stat-box.highlight {
    border-color: var(--border-cyan);
    box-shadow: var(--shadow-glow);
}

.hud-stat-box.highlight .val {
    color: var(--border-cyan);
}

.hud-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.trion-meter {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.trion-label {
    font-size: 0.65rem;
    color: var(--border-green);
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.trion-bar-container {
    height: 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-green);
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.2);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.trion-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1c7e0c, #39ff14);
    box-shadow: 0 0 10px var(--border-green);
    width: 100%;
    transition: width 0.15s ease-out;
}

.trion-numeric {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Arena Grid & Panels Layout */
.arena-container {
    display: flex;
    flex: 1;
    gap: 10px;
    overflow: hidden;
    height: calc(100vh - 165px);
}

#game-canvas {
    flex: 1;
    background: #020304;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    display: block;
    aspect-ratio: 3 / 2;
    max-width: 100%;
    height: auto !important;
    min-height: 400px;
}

.sidebar-panels {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sidebar-panels::-webkit-scrollbar {
    width: 6px;
}

.sidebar-panels::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-panels::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-panels::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-panels .panel {
    border-radius: 6px;
}

.panel-header-compact {
    font-family: var(--font-cyber);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-gray);
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-accent);
    text-transform: uppercase;
}

/* Radar */
.radar-panel {
    height: 245px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.radar-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: auto;
    border-radius: 50%;
    overflow: hidden;
}

#radar-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg at 50% 50%, rgba(57, 255, 20, 0.15) 0deg, transparent 90deg, transparent 360deg);
    border-radius: 50%;
    animation: sweep 4s linear infinite;
    pointer-events: none;
}

@keyframes sweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Score List */
.score-panel {
    height: 280px;
}

.score-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
    flex: 1;
    gap: 5px;
}

.score-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.score-row.active {
    border-color: var(--border-green);
    background: rgba(57, 255, 20, 0.03);
}

.score-row .rank {
    width: 18px;
    font-family: var(--font-cyber);
    color: var(--text-accent);
}

.score-row .name {
    flex: 1;
    font-weight: 600;
}

.score-row .score {
    font-family: var(--font-cyber);
    font-weight: 700;
    color: var(--border-yellow);
}

/* Status Log Feed */
.logs-panel {
    flex: 1;
}

.logs-container {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    font-family: monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.log-message {
    border-left: 2px solid var(--border-gray);
    padding-left: 6px;
    color: var(--text-secondary);
}

.log-message.system {
    color: var(--border-cyan);
    border-color: var(--border-cyan);
}

.log-message.kill {
    color: #ff3b30;
    border-color: #ff3b30;
}

.log-message.bailout {
    color: var(--border-green);
    border-color: var(--border-green);
}

/* FOOTER HUD: ACTIVE BRIEFCASE CARDROW */
.game-footer-hud {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    height: 75px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
    padding: 8px 15px;
    margin-top: 10px;
}

.game-footer-hud .hud-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-footer-hud .section-title {
    font-size: 0.6rem;
    font-family: var(--font-cyber);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-slots-row {
    display: flex;
    gap: 8px;
    flex: 1;
    margin-top: 4px;
}

.hud-slot-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.hud-slot-card.active {
    border-color: var(--border-cyan);
    background: var(--bg-active);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.hud-slot-card .key {
    font-family: var(--font-cyber);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-accent);
    margin-right: 8px;
    border-right: 1px solid var(--border-gray);
    padding-right: 6px;
}

.hud-slot-card .name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Center Hybrid Info Panel */
.center-hybrid {
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.composite-bullet-indicator,
.lead-bullet-indicator {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    width: 100%;
    padding: 4px 10px;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.combo-key {
    color: var(--text-accent);
    font-weight: 700;
    border: 1px solid rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.05);
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.55rem;
    margin-right: 8px;
}

.combo-label {
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
    white-space: nowrap;
}

.combo-desc {
    color: var(--text-secondary);
    font-size: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: right;
}

.composite-bullet-indicator.active {
    border-color: var(--border-yellow);
    box-shadow: 0 0 8px rgba(255, 223, 0, 0.2);
}

.composite-bullet-indicator.active .combo-key {
    color: var(--border-yellow);
    border-color: var(--border-yellow);
}

.lead-bullet-indicator.active {
    border-color: #000;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.lead-bullet-indicator.active .combo-key {
    color: #fff;
    border-color: #fff;
}

/* ==========================================================================
   OVERLAY SCREENS (Bailout / GameOver, Pause)
   ========================================================================== */

.overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 3, 5, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.overlay-screen.active {
    display: flex;
}

/* Bail Out Emergency Display */
.bailout-box {
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    border: 2px solid #ff3b30;
    box-shadow: 0 0 25px rgba(255, 59, 48, 0.4);
    border-radius: 8px;
    padding: 25px 25px 20px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.alert-title {
    font-size: 2.2rem;
    color: #ff3b30;
    font-weight: 900;
    margin-bottom: 5px;
    text-shadow: 0 0 15px rgba(255, 59, 48, 0.6);
}

.warning-flasher {
    background: rgba(255, 59, 48, 0.1);
    color: #ff9500;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 25px;
    letter-spacing: 2px;
    animation: flash 1s ease infinite alternate;
}

@keyframes flash {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.bailout-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.detail-row {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 0.8fr;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-row>span:nth-child(1) {
    text-align: left;
}

.detail-row>span:nth-child(2) {
    text-align: center;
}

.detail-row>span:nth-child(3) {
    text-align: right;
}

.detail-row .highlight-val {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Pause Box */
.pause-box {
    width: 90%;
    max-width: 800px;
    border: 1px solid var(--border-cyan);
    box-shadow: var(--shadow-glow);
    border-radius: 8px;
    padding: 30px;
}

.pause-box h2 {
    font-size: 1.8rem;
    color: var(--text-accent);
    text-align: center;
    margin-bottom: 25px;
}

.instruction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.instr-col {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    padding: 15px;
}

.instr-col h3 {
    font-size: 0.85rem;
    color: var(--text-accent);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 6px;
}

.instr-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.instr-col li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 1px #fff;
    color: #fff;
    display: inline-block;
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 1px 5px;
    white-space: nowrap;
}

/* Animations */
.animate-glow {
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.animate-pulse {
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
        opacity: 0.9;
    }

    50% {
        box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
        opacity: 1;
    }
}

.animate-popup {
    animation: popup 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popup {
    from {
        transform: scale(0.9) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* HP/Trion Status Badges in Sidebar Leaderboard */
.hp-badge {
    font-size: 0.65rem;
    font-family: var(--font-cyber);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    text-transform: uppercase;
    font-weight: 700;
}

.hp-badge.alive {
    background: rgba(57, 255, 20, 0.15);
    color: var(--border-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.1);
}

.hp-badge.bailed-out {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    box-shadow: 0 0 5px rgba(255, 59, 48, 0.1);
    text-shadow: 0 0 2px rgba(255, 59, 48, 0.3);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MEDIA QUERIES
   ========================================================================== */

#lobby-screen {
    overflow-y: auto;
}

@media (max-height: 850px) {
    .lobby-layout {
        flex: 1 0 auto;
        overflow: visible;
    }

    .agent-panel {
        /* max-height: none;
        height: auto; */
    }
}

@media (max-width: 1024px) {
    .lobby-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        overflow-y: visible;
        max-height: none;
    }

    .agent-panel,
    .briefcase-panel {
        max-height: none;
        height: auto;
    }

    .panel {
        overflow: unset;
    }

    .agent-grid {
        max-height: 350px;
        /* Keep list scrollable but visible in stack */
    }
}

@media (max-width: 768px) {
    .logo-area h1 {
        font-size: 2rem;
    }

    .battle-parameters {
        margin: 0 10px 15px 10px;
        padding: 15px;
    }

    .action-bar {
        padding: 0 10px 15px 10px;
    }

    .briefcase-grid {
        padding: 15px;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .briefcase-grid {
        /* grid-template-columns: 1fr; */
    }

    .params-row {
        grid-template-columns: 1fr 1fr;
    }

    .rival-checkboxes-container {
        margin-bottom: 30px;
    }

    .logo-area {
        padding: 10px 20px;
    }

    .logo-area h1 {
        font-size: 1.6rem;
    }

    .btn-lg {
        padding: 12px 25px;
        font-size: 0.95rem;
        width: 100%;
    }

    .action-bar {
        justify-content: center;
    }

    .agent-stats-main {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .agent-portrait {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 900px) {
    #game-screen {
        height: auto !important;
        min-height: 100vh;
    }

    .arena-container {
        flex-direction: column;
        height: auto !important;
        min-height: auto;
        overflow: visible;
    }

    .instruction-grid {
        /* grid-template-columns: 1fr; */
    }

    .sidebar-panels {
        width: 100%;
        height: auto !important;
        overflow: visible;
        padding-right: 0;
    }

    .logs-panel {
        height: 200px;
    }

    .game-footer-hud {
        grid-template-columns: 1fr;
        height: auto !important;
        gap: 15px;
        padding: 15px;
    }

    .game-footer-hud .hud-column {
        gap: 8px;
    }

    .hud-slots-row {
        flex-wrap: wrap;
    }

    .hud-slot-card {
        flex: 1 1 120px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #game-screen {
        /* Keep game-screen fixed */
        flex-direction: column;
        overflow: hidden;
    }

    .game-hud {
        order: 1;
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        padding: 10px;
        flex-shrink: 0;
    }

    .game-footer-hud {
        order: 2;
        grid-template-columns: 1fr;
        height: auto;
        padding: 10px;
        flex-shrink: 0;
        margin-top: 5px;
    }

    .center-hybrid {
        margin: 5px 0;
    }

    .arena-container {
        order: 3;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding-bottom: 20px;
    }

    .sidebar-panels {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0 10px;
        flex-shrink: 0;
    }

    .hud-left,
    .hud-center,
    .hud-right {
        width: 100%;
        justify-content: center;
        max-width: 100%;
        flex-shrink: 0;
    }

    #game-canvas {
        width: 100%;
        height: 45vh !important;
        min-height: 250px;
        flex-shrink: 0;
    }

    .radar-panel,
    .score-panel,
    .logs-panel {
        width: 100%;
        flex-shrink: 0;
    }

    .score-panel {
        min-height: 150px;
    }

    .logs-panel {
        min-height: 200px;
    }

    .hud-slot-card,
    .composite-bullet-indicator,
    .lead-bullet-indicator {
        cursor: pointer;
    }
}

/* ==========================================================================
   MULTIPLAYER LAN / SSE RULES
   ========================================================================== */

.lobby-modes-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0px auto 15px auto;
    padding: 10px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    background: rgba(10, 20, 30, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 10;
    position: relative;
    flex-wrap: wrap;
}

.mode-tab-btn {
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(240, 246, 252, 0.55);
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 2px;
}

.mode-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(0, 240, 255, 0.25);
}

.mode-tab-btn.active {
    color: var(--border-cyan);
    border: 1px solid var(--border-cyan);
    background: rgba(0, 240, 255, 0.07);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25), inset 0 1px 0 rgba(0, 240, 255, 0.1);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.lan-parameters {
    /* margin-top: 20px; */
    /* border: 1px solid rgba(189, 0, 255, 0.25) !important; */
    border: unset;
    /* Spider Purple border for LAN setup */
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.05) !important;
    transition: all 0.3s ease;
}

.lan-parameters h3 {
    color: #bd00ff;
    /* text-shadow: 0 0 10px rgba(189, 0, 255, 0.4);
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(189, 0, 255, 0.15);
    padding-bottom: 8px; */
}

.lan-setup-modes {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 25px;
    margin-top: 15px;
}

.lan-card {
    flex: 1;
    background: rgba(14, 22, 29, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lan-card h4 {
    font-family: var(--font-cyber);
    font-size: 0.95rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.host-card h4 {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.join-card h4 {
    color: #bd00ff;
    text-shadow: 0 0 8px rgba(189, 0, 255, 0.3);
}

.lan-card:hover {
    background: rgba(14, 22, 29, 0.6);
}

.host-card:hover {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
}

.join-card:hover {
    border-color: rgba(189, 0, 255, 0.35);
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.08);
}

.lan-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.lan-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-direction: column;
}

.lan-input-group input {
    flex: 1;
    font-size: 0.85rem;
}

.lan-divider {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    font-weight: 900;
    position: relative;
}

.lan-divider::before,
.lan-divider::after {
    content: '';
    width: 1px;
    height: 45px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.lan-divider span {
    margin: 12px 0;
    color: rgba(255, 255, 255, 0.25);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
}

/* LOBBY ROOM PRE-MATCH LAYOUT */
.lan-lobby-room {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: fadeIn 0.4s ease;
}

.lan-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.neon-purple-text {
    color: #bd00ff;
    text-shadow: 0 0 10px rgba(189, 0, 255, 0.6);
    font-weight: 700;
}

.neon-cyan-text {
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    font-weight: 700;
}

.lan-players-section h5 {
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.lan-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 20px;
}

.lan-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 22, 29, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lan-player-row.ready {
    border-color: rgba(57, 255, 20, 0.3);
    background: rgba(57, 255, 20, 0.03);
}

.lan-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lan-avatar-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1.5px solid var(--border-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.lan-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lan-status-badge {
    font-family: var(--font-cyber);
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1px;
}

.lan-status-badge.ready {
    color: var(--border-green);
    border: 1px solid var(--border-green);
    background: rgba(57, 255, 20, 0.08);
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.3);
}

.lan-status-badge.waiting {
    color: #ff9500;
    border: 1px solid #ff9500;
    background: rgba(255, 149, 0, 0.08);
    text-shadow: 0 0 5px rgba(255, 149, 0, 0.3);
}

.lan-room-settings {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lan-room-settings .param-group {
    flex: 1;
    margin-bottom: 0;
}

.lan-room-actions {
    display: flex;
    gap: 12px;
}

.lan-status-log {
    margin-top: 15px;
    padding: 10px 15px;
    font-size: 0.72rem;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.lan-status-log .prefix {
    color: #00f0ff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   BORDER SQUAD RANK WARS (3-TEAM MATCH) CUSTOM STYLES
   ========================================================================== */

.squad-parameters {
    border: 1px solid rgba(0, 240, 255, 0.15) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.05) !important;
    margin-top: 15px;
    padding: 20px;
}

.squads-config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    padding-bottom: 10px;
    overflow: auto;
}

.squad-config-card {
    background: rgba(14, 22, 29, 0.4);
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.squad-config-card.team-cyan {
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.02);
}

.squad-config-card.team-cyan:hover {
    border-color: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.03);
}

.squad-config-card.team-orange {
    border: 1px solid rgba(255, 87, 34, 0.2);
    box-shadow: inset 0 0 15px rgba(255, 87, 34, 0.02);
}

.squad-config-card.team-orange:hover {
    border-color: rgba(255, 87, 34, 0.45);
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.08), inset 0 0 15px rgba(255, 87, 34, 0.03);
}

.squad-config-card.team-purple {
    border: 1px solid rgba(189, 0, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(189, 0, 255, 0.02);
}

.squad-config-card.team-purple:hover {
    border-color: rgba(189, 0, 255, 0.45);
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.08), inset 0 0 15px rgba(189, 0, 255, 0.03);
}

.squad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.squad-card-header h4 {
    font-family: var(--font-cyber);
    font-size: 0.82rem;
    letter-spacing: 1px;
    margin: 0;
}

.preset-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.72rem;
    font-family: var(--font-cyber);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.preset-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.squad-members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.squad-member-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.squad-member-row .role-label {
    font-family: var(--font-cyber);
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.player-agent-label {
    background: rgba(0, 240, 255, 0.08);
    border: 1px dashed rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-cyber);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

.agent-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: var(--font-cyber);
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.agent-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.agent-select:focus {
    border-color: var(--border-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.team-orange .agent-select:focus {
    border-color: #ff5722;
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.15);
}

.team-purple .agent-select:focus {
    border-color: #bd00ff;
    box-shadow: 0 0 8px rgba(189, 0, 255, 0.15);
}

.neon-orange-text {
    color: #ff5722;
    text-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
    font-weight: 700;
}

/* Squad tag indicators during gameplay on canvas */
.squad-indicator-tag {
    font-family: var(--font-cyber);
    font-size: 10px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 3px;
}

@media (max-width: 1024px) {
    .squads-config-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ==========================================================================
   HOW TO PLAY BUTTON (LOBBY TAB)
   ========================================================================== */

.how-to-play-tab {
    /* margin-left: auto !important; */
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(120, 80, 255, 0.15)) !important;
    border: 1px solid rgba(0, 240, 255, 0.4) !important;
    color: #00f0ff !important;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    transition: all 0.3s ease;
}

.how-to-play-tab:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(120, 80, 255, 0.3)) !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   HOW TO PLAY MODAL
   ========================================================================== */

.htp-modal {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.htp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px 12px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.08), transparent);
}

.htp-header h2 {
    font-family: var(--font-cyber);
    font-size: 1.3rem;
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    margin: 0;
    letter-spacing: 2px;
}

.htp-close-btn {
    background: rgba(255, 60, 60, 0.15);
    border: 1px solid rgba(255, 60, 60, 0.4);
    color: #ff5555;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.htp-close-btn:hover {
    background: rgba(255, 60, 60, 0.35);
    box-shadow: 0 0 15px rgba(255, 60, 60, 0.4);
    transform: rotate(90deg);
}

/* HTP TABS */
.htp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
}

.htp-tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.htp-tab-btn:hover {
    color: #fff;
    background: rgba(0, 240, 255, 0.05);
}

.htp-tab-btn.active {
    color: #00f0ff;
    border-bottom-color: #00f0ff;
    background: rgba(0, 240, 255, 0.08);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* HTP TAB CONTENT */
.htp-tab-content {
    display: none;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
}

.htp-tab-content.active {
    display: block;
}

/* CONTROLS TAB */
.htp-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.htp-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.htp-section:hover {
    border-color: rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.03);
}

.htp-section h3 {
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    color: #00f0ff;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.htp-key-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.htp-key-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.htp-key-row kbd {
    background: linear-gradient(180deg, rgba(60, 65, 80, 0.8), rgba(35, 38, 48, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    padding: 3px 8px;
    font-family: var(--font-cyber);
    font-size: 0.68rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 28px;
    text-align: center;
    white-space: nowrap;
}

.htp-key-row span {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-left: 4px;
    flex: 1;
}

/* RULES TAB */
.htp-rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.htp-rule-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 6px 0;
}

.htp-rule-card p strong {
    color: #fff;
}

.htp-rule-card kbd {
    background: rgba(60, 65, 80, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.72rem;
    color: #ddd;
    font-family: var(--font-cyber);
}

.htp-note {
    background: rgba(0, 240, 255, 0.06) !important;
    border-left: 3px solid rgba(0, 240, 255, 0.4);
    padding: 8px 12px !important;
    border-radius: 0 6px 6px 0;
    margin-top: 10px !important;
    font-size: 0.8rem !important;
    color: rgba(0, 240, 255, 0.85) !important;
}

/* TRIGGERS TAB */
.htp-triggers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.htp-trigger-card {
    position: relative;
    overflow: hidden;
}

.htp-trigger-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.cat-attacker::before {
    background: linear-gradient(180deg, #ff6b35, #ff3b30);
}

.cat-shooter::before {
    background: linear-gradient(180deg, #00c6ff, #0072ff);
}

.cat-gunner::before {
    background: linear-gradient(180deg, #ffc107, #ff9800);
}

.cat-sniper::before {
    background: linear-gradient(180deg, #8e44ad, #6c3483);
}

.cat-defense::before {
    background: linear-gradient(180deg, #2ecc71, #27ae60);
}

.cat-composite::before {
    background: linear-gradient(180deg, #f39c12, #e74c3c);
}

.htp-trigger-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.htp-trigger-item {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 5px 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.htp-trigger-item:hover {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.15);
}

.htp-trigger-item strong {
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   PRE-MATCH COUNTDOWN OVERLAY
   ========================================================================== */

.countdown-overlay {
    background: rgb(21 21 21 / 0%) !important;
    backdrop-filter: blur(0px);
    z-index: 1001 !important;
}

.countdown-overlay.active {
    display: flex;
    flex-direction: column;
}

.countdown-content {
    text-align: center;
    animation: countdownFadeIn 0.5s ease-out;
}

@keyframes countdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.countdown-title {
    font-family: var(--font-cyber);
    font-size: 1.8rem;
    color: #00f0ff;
    letter-spacing: 6px;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 0 60px rgba(0, 240, 255, 0.3);
    margin-bottom: 8px;
}

.countdown-subtitle {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.countdown-number {
    font-family: var(--font-cyber);
    font-size: 8rem;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 40px rgba(0, 240, 255, 0.8),
        0 0 80px rgba(0, 240, 255, 0.4),
        0 0 120px rgba(0, 240, 255, 0.2);
    line-height: 1;
    margin: 20px 0;
    animation: countdownPulse 1s ease-in-out infinite;
    position: relative;
}

@keyframes countdownPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

.countdown-label {
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 4px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.countdown-bar-track {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.countdown-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00f0ff, #7850ff, #00f0ff);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 1s linear;
    animation: countdownBarShimmer 2s linear infinite;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

@keyframes countdownBarShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Countdown number transition effect */
.countdown-number.pop {
    animation: countdownPop 0.4s ease-out;
}

@keyframes countdownPop {
    0% {
        transform: scale(1.6);
        opacity: 0.3;
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* GO text style override */
.countdown-number.go-text {
    color: #00ff88;
    text-shadow:
        0 0 40px rgba(0, 255, 136, 0.8),
        0 0 80px rgba(0, 255, 136, 0.4),
        0 0 120px rgba(0, 255, 136, 0.2);
    animation: goFlash 0.5s ease-out;
}

@keyframes goFlash {
    0% {
        transform: scale(2);
        opacity: 0;
    }

    50% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments for HTP modal */
@media (max-width: 768px) {
    .htp-modal {
        width: 95%;
        max-height: 90vh;
    }

    .htp-controls-grid,
    .htp-rules-grid,
    .htp-triggers-grid {
        grid-template-columns: 1fr;
    }

    .htp-header h2 {
        font-size: 1rem;
    }

    .htp-tab-btn {
        font-size: 0.65rem;
        padding: 10px 8px;
    }

    .countdown-number {
        font-size: 5rem;
    }

    .countdown-title {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }
}

/* ==========================================================================
   VIRTUAL TRAINING MODE OVERLAY STYLES
   ========================================================================== */

.training-slot-btn {
    background: rgba(0, 240, 255, 0.06) !important;
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    font-family: var(--font-main);
    /* font-size: 0.65rem; */
    padding: 8px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* text-shadow: 0 0 4px rgba(0, 240, 255, 0.3); */
}

.training-slot-btn:hover {
    background: rgba(0, 240, 255, 0.25) !important;
    border-color: #00f0ff !important;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.training-slot-btn.active {
    background: rgba(0, 240, 255, 0.25) !important;
    border-color: #00f0ff !important;
    /* color: #ffffff !important; */
    /* font-weight: 700; */
    /* box-shadow: 0 0 10px rgba(0, 240, 255, 0.5); */
    /* text-shadow: 0 0 6px #fff; */
}

.training-bot-btn {
    background: rgba(57, 255, 20, 0.06) !important;
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    font-family: 'Inter';
    /* font-size: 0.65rem; */
    padding: 8px 6px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.3);
}

.training-bot-btn:hover {
    background: rgba(57, 255, 20, 0.18) !important;
    border-color: #39ff14 !important;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.training-clear-btn {
    background: rgba(255, 59, 48, 0.08) !important;
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    font-family: var(--font-main);
    /* font-size: 0.65rem; */
    padding: 8px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* text-shadow: 0 0 4px rgba(255, 59, 48, 0.3); */
}

.training-clear-btn:hover {
    background: rgba(255, 59, 48, 0.22) !important;
    border-color: #ff3b30 !important;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.35);
}

/* TRAINING MODE HUD BUTTON */
#training-hud-btn {
    background: rgba(14, 22, 29, 0.92) !important;
    border: 2px solid var(--border-cyan) !important;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--border-cyan) !important;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    transition: all 0.25s ease;
    margin-left: 10px;
}

#training-hud-btn:hover {
    background: rgba(0, 240, 255, 0.15) !important;
    border-color: var(--border-cyan) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

/* TRAINING MODE MODAL OVERLAY & CONTENT */
.training-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(0px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.training-modal-overlay.active {
    display: flex;
}

.training-modal-content {
    background: rgba(10, 17, 24, 0.58);
    border: 1px solid var(--border-cyan);
    border-radius: 8px;
    width: 95%;
    max-width: 980px;
    /* Expanded for two-column grid */
    max-height: 90vh;
    /* box-shadow: var(--shadow-glow); */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-cyber);
    color: var(--text-primary);
}

.training-modal-header {
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--border-cyan);
    font-size: 1rem;
    letter-spacing: 1px;
}

.training-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.training-modal-close:hover {
    color: var(--border-cyan);
}

.training-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Restyled Split columns grid inside the body */
.training-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

.training-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.training-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.training-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-transform: uppercase;
    color: var(--text-accent);
    font-family: var(--font-cyber);
    border-left: 3px solid var(--border-cyan);
    padding-left: 8px;
}

.training-trigger-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.training-action-btn.refill-btn {
    flex: 1;
    background: rgba(255, 215, 0, 0.08) !important;
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-main);
    /* font-size: 0.7rem; */
    /* font-weight: 700; */
    cursor: pointer;
    transition: all 0.2s ease;
    /* text-shadow: 0 0 4px rgba(255, 215, 0, 0.3); */
}

.training-action-btn.refill-btn:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}