/* --- CORE STYLES SEEDED FROM STYLES.CSS --- */
:root {
    --bg-color: #203030;
    --panel-bg: rgba(48, 64, 64, 0.8);
    --accent-green: #42f485;
    --frame-grey: #d1d1d1;
    --text-main: #f0f0f0;
    --dark-base: #111a1a;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Calibri', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

/* --- THE CORE COMPREHENSIVE WINDOW FRAME --- */
.outer-frame {
    border: 1px solid var(--frame-grey);
    padding: 20px;
    width: 95vw;
    max-width: 1600px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.5);
}

header {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(209, 209, 209, 0.3);
    padding-bottom: 5px;
}

.title {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
}

.subtitle {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: var(--accent-green);
    margin-top: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- CONSOLE CONTAINER SYSTEM --- */
.console-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Radio State Tokens */
.tab-state {
    display: none;
}

/* --- STYLED ADVANCED LABELS --- */
.tab-headers {
    display: flex;
    gap: 10px;
    list-style: none;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-card {
    flex: 1;
    min-width: 180px;
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.2s ease-in-out;
    border-top: 3px solid rgba(255, 255, 255, 0.2);
}

.tab-card:hover {
    background: rgba(66, 244, 133, 0.08);
    border-color: rgba(66, 244, 133, 0.4);
}

/* Card Text Top-Row Styling */
.tab-card-title {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.85rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card Secondary Meta Subtitle */
.tab-card-meta {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: var(--frame-grey);
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

/* Custom Graphic Enclosure Inside the Tab Label */
.tab-card-graphic {
    width: 100%;
    height: 120px;
    background: var(--dark-base);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

/* --- MAIN CENTRAL WORKSPACE --- */
.content-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--frame-grey);
    flex-grow: 1;
    padding: 15px;
    position: relative;
    margin-top: -1px; /* Ties directly flush against the cards */
    min-height: 400px;
}

.tab-content {
    display: none;
    animation: terminalFade 0.25s ease-out forwards;
}

.tab-content h2 {
    font-family: 'Courier New', monospace;
    color: var(--accent-green);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

/* Compact card layout */
.glyph-matrix-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.glyph-matrix-card.offline {
    opacity: 0.15;
    filter: grayscale(1);
    pointer-events: none; /* Prevents interaction if needed */
}

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

.glyph-identity h3 {
    margin: 0;
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.glyph-info-compact {
    font-size: 0.65rem;
    color: #888;
    font-family: 'Courier New', monospace;
    margin-top: 4px;
}

.glyph-preview {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bracket-draw-view .glyph-matrix-card:nth-of-type(even) {
    margin-bottom: 24px;
}

.bracket-draw-view .glyph-matrix-card:last-of-type {
    margin-bottom: 0;
}

.bracket-draw-view .glyph-matrix-card{
    background-color:#111a1a;
}

/* --- SWITCHING CONTROL SYSTEM ARCHITECTURE --- */
#tab-1:checked ~ .tab-headers label[for="tab-1"],
#tab-2:checked ~ .tab-headers label[for="tab-2"],
#tab-3:checked ~ .tab-headers label[for="tab-3"],
#tab-4:checked ~ .tab-headers label[for="tab-4"],
#tab-5:checked ~ .tab-headers label[for="tab-5"],
#tab-6:checked ~ .tab-headers label[for="tab-6"],
#tab-7:checked ~ .tab-headers label[for="tab-7"] {
    border-color: var(--accent-green);
    border-top: 3px solid var(--accent-green);
    background: rgba(48, 64, 64, 1);
    box-shadow: 0 -4px 15px rgba(66, 244, 133, 0.15);
}

#tab-1:checked ~ .tab-headers label[for="tab-1"] .tab-card-title,
#tab-2:checked ~ .tab-headers label[for="tab-2"] .tab-card-title,
#tab-3:checked ~ .tab-headers label[for="tab-3"] .tab-card-title,
#tab-4:checked ~ .tab-headers label[for="tab-4"] .tab-card-title,
#tab-5:checked ~ .tab-headers label[for="tab-5"] .tab-card-title,
#tab-6:checked ~ .tab-headers label[for="tab-6"] .tab-card-title,
#tab-7:checked ~ .tab-headers label[for="tab-7"] .tab-card-title {
    color: var(--accent-green);
}

#tab-1:checked ~ .content-panel #content-1,
#tab-2:checked ~ .content-panel #content-2,
#tab-3:checked ~ .content-panel #content-3,
#tab-4:checked ~ .content-panel #content-4,
#tab-5:checked ~ .content-panel #content-5,
#tab-6:checked ~ .content-panel #content-6,
#tab-7:checked ~ .content-panel #content-7 {
    display: block;
}

/* --- PLACEHOLDER WIREFRAMES --- */
.scaffolding-blueprint {
    border: 1px dashed rgba(66, 244, 133, 0.2);
    padding: 20px;
    margin-bottom:10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    color: var(--frame-grey);
    font-size: 0.85rem;
    background: rgba(0,0,0,0.15);
}

/* --- SYSTEM FOOTER --- */
footer {
    margin-top: 15px;
    border-top: 1px dashed rgba(209, 209, 209, 0.2);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-size: 0.45rem;
    color: var(--frame-grey);
    letter-spacing: 1px;
}

@keyframes terminalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Group Phase Layout (7 columns) */
.groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.group-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
}

.group-header {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent-green);
    border-bottom: 1px solid rgba(66, 244, 133, 0.3);
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

/* Leaderboard table simulation */
.group-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.group-table th {
    text-align: left;
    color: #888;
    padding: 4px;
    font-weight: normal;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.group-table td {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Row threshold colors mapping your rules */
.row-advance { border-left: 2px solid var(--accent-green); background: rgba(66, 244, 133, 0.02); }
.row-redemption { border-left: 2px solid #f4d042; background: rgba(244, 208, 66, 0.01); }
.row-pruned { border-left: 2px solid #f44242; color: #666; }

/* Bracket Systems (Friday & Saturday) */
.brackets-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.bracket-column {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bracket-round-header {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--frame-grey);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.matchup-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.matchup-slot {
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 4px 6px;
    background: rgba(0,0,0,0.2);
}

.matchup-slot.winner {
    color: var(--accent-green);
    font-weight: bold;
    background: rgba(66, 244, 133, 0.05);
}

.matchup-slot span.score {
    font-weight: bold;
    color: var(--frame-grey);
}

.matchup-slot.winner span.score {
    color: var(--accent-green);
}

.match-meta {
    font-size: 0.6rem;
    color: #666;
    text-align: right;
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}