/* ==========================================================================
   1. DESIGN SYSTEM VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --bg-black: #050505;
    --panel-bg: rgba(20, 20, 20, 0.85);
    --accent-green: #42f485;
    --frame-grey: #666666;
    --text-dim: #888888;
}

body {
    background-color: var(--bg-black);
    color: #eee;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 20px;
}

/* ==========================================================================
   2. STRUCTURAL CONTAINERS & LAYOUT
   ========================================================================== */
.outer-frame {
    border: 1px solid var(--frame-grey);
    padding: 10px 15px;
    width: 98vw;
    max-width: 1600px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.duel-stage {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.player-box {
    flex: 1;
    background: var(--panel-bg);
    min-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.large-content-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    margin-top: 15px;
    margin-bottom: 25px;
    min-height: 200px;
    font-family: monospace;
}

/* ==========================================================================
   3. NAVIGATION & TABS SYSTEM
   ========================================================================== */
/* Ensure the ribbon fills the width and uses Flexbox */
.tab-ribbon {
    display: flex;
    align-items: center;
    width: 100%;
    /* Leaves gap between normal tabs while pushing 'margin-left: auto' items to the end */
    gap: 10px; 
    box-sizing: border-box;
}

/* Pushes this button (and anything after it) all the way to the right side */
.tab-button.exit-button {
    margin-left: auto;
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.4);
    background: rgba(255, 0, 0, 0.05);
}

/* Hover effect for the exit button */
.tab-button.exit-button:hover {
    color: #ff1a1a;
    border-color: #ff4d4d;
    background: rgba(255, 0, 0, 0.15);
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.3);
}

.tab-button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--frame-grey);
    padding: 8px 16px;
    font-family: monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #eee;
    border-color: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: rgba(66, 244, 133, 0.05);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ==========================================================================
   4. TYPOGRAPHY & TITLES
   ========================================================================== */
.pane-title {
    font-size: 0.9rem;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--accent-green);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.panel-title {
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-bottom: 15px;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.profile-label {
    font-family: 'Courier New', monospace;
    font-size: 0.5rem;
    color: var(--frame-grey);
    text-transform: uppercase;
    margin-top: 12px;
}

.stat-line {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   5. FORM INPUTS & TERMINALS
   ========================================================================== */
.filter-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Courier New', monospace;
}

.filter-stack label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: -5px;
}

.full-width-input {
    width: 100%;
    box-sizing: border-box;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-green);
    padding: 8px;
    font-family: 'Courier New', monospace;
}

.full-width-input:focus {
    border-color: var(--accent-green);
    outline: none;
}

.terminal-textarea {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--frame-grey);
    color: var(--accent-green);
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    padding: 8px;
    box-sizing: border-box;
    resize: none;
    margin-top: 5px;
}

.terminal-textarea:focus {
    border-color: var(--accent-green);
    outline: none;
}

/* ==========================================================================
   6. BUTTONS & ACTIONS
   ========================================================================== */
.action-button {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.action-button:hover {
    background: var(--accent-green);
    color: #000;
    box-shadow: 0 0 15px var(--accent-green);
}

.action-button:disabled {
    border-color: #555555;
    color: #555555;
    cursor: not-allowed;
}

.action-button:disabled:hover {
    background: transparent;
    color: #555555;
    box-shadow: none;
}

.load-btn {
    background: transparent;
    border: 1px solid var(--frame-grey);
    color: white;
    font-family: 'Courier New', monospace;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-btn:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(66, 244, 133, 0.05);
}

/* ==========================================================================
   7. ANIMATIONS & SCROLLBARS
   ========================================================================== */
.pulse-green {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(66, 244, 133, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(66, 244, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(66, 244, 133, 0); }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: #222;
    border: 1px solid rgba(66, 244, 133, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}