/* ==========================================================================
   1. VARIABLES & THEME SETUP
   ========================================================================== */
:root {
    --bg-color: #0b0f17;
    --panel-bg: #131a26;
    --panel-hover: #17202f;
    --border-color: #222d3d;
    --border-active: #33435b;
    
    /* Typography colors */
    --text-main: #cbd5e1;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    /* Brand Accents */
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-orange: #f97316;
    
    /* Semantics & Alpha States */
    --box-score-bg: #090d14;
    --winner-bg-glow: rgba(34, 197, 94, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.5);
    
    /* Timing */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. SYSTEM RESETS & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    /* FIXED: Corrected missing semicolon and changed layout behavior */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns content to the left to prevent clipping on smaller viewports */
    align-items: center;       /* Centers content vertically along the main column cross-axis */
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: auto;          /* Enables horizontal scroll if the viewport is smaller than the canvas */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   3. HEADER ARCHITECTURE
   ========================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2.5rem;
    width: 100%;               /* Spans full fluid width */
    max-width: 1600px;         
    margin-left: 0;            /* FIXED: Forces the header to align to the left instead of centering */
}

.title-area h1 {
    color: var(--text-white);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(to right, var(--text-white), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-area p {
    margin: 0.35rem 0 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.subtitle {
    color: var(--accent-orange);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(249, 115, 22, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

/* ==========================================================================
/* ==========================================================================
   4. BRACKET CANVAS ENGINE (Flex Alignment Grid)
   ========================================================================== */
.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;               /* FIXED: Forces the container to adapt to the screen width */
    min-width: 0;              /* FIXED: Removed the 1450px restriction that caused the scrollbar */
    margin: 0 auto;            /* Centers the bracket nicely on the 24-inch screen */
    gap: 1rem;                 /* FIXED: Slightly reduced gap to prevent overflowing */
}

.column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 700px;
    width: 24%;                /* FIXED: Changed from fixed 240px to percentage so columns shrink dynamically */
    min-width: 180px;          /* Prevents rows from breaking or getting too squished */
}

.center-stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30%;                /* FIXED: Changed from fixed 300px to percentage for proper scaling */
    min-width: 220px;          
    height: 700px;
}

/* ==========================================================================
   5. MATCH CARDS & SLOTS
   ========================================================================== */
.match-container {
    margin: 0.5rem 0;
    position: relative;
}

.match-id {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    padding-left: 0.25rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.match-box {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.match-box:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-md);
    background-color: var(--panel-hover);
}

/* Team row controls */
.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(34, 44, 60, 0.4);
    transition: background-color var(--transition-fast);
}

.team-row:last-child {
    border-bottom: none;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;               /* FIXED: Changed from 160px to 100% to fill the dynamic column space */
}

/* Metadata badges (Group Tags) */
.group-tag {
    font-family: monospace;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    background: #192231;
    min-width: 28px;
    text-align: center;
}

.tag-3rd { color: var(--accent-green); border: 1px solid rgba(34, 197, 150, 0.15); }
.tag-4th { color: var(--accent-yellow); border: 1px solid rgba(234, 179, 8, 0.15); }
.tag-tbd { color: var(--text-muted); background: #0f141d; }

/* ==========================================================================
   6. METRIC DISPLAY COMPONENT (Scores)
   ========================================================================== */
.scores-wrapper {
    display: flex;
    gap: 3px;
}

.score-box {
    width: 26px;
    height: 24px;
    background-color: var(--box-score-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

/* Active states when values fill in */
.score-box:not(:empty), 
.score-box:has(text) {
    color: var(--text-white);
}

.score-box.extra { color: var(--accent-yellow); opacity: 0.85; }
.score-box.penalty { color: var(--accent-orange); opacity: 0.85; }

/* ==========================================================================
   7. STATE MUTATIONS (Engine driven classes)
   ========================================================================== */
/* The Winning Side */
.winner {
    background-color: var(--winner-bg-glow);
}

.winner .team-info {
    color: var(--text-white);
}

.winner .score-box {
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--accent-green);
    background-color: rgba(34, 197, 94, 0.08);
}

/* The Eliminated Side */
.loser {
    opacity: 0.75;
    filter: grayscale(40%);
}

.loser:hover {
    opacity: 0.50; /* Light tracking on hover for lookbacks */
}

/* ==========================================================================
   8. TROPHY PLATFORM
   ========================================================================== */
.trophy-box {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: radial-gradient(circle at top, #162235 0%, var(--panel-bg) 100%);
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-md);
    border-top: 2px solid rgba(234, 179, 8, 0.3);
}

.trophy-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    animation: float 4s ease-in-out infinite;
}

.champion-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 700;
}

.champion-name {
    font-size: 1.2rem;
    color: var(--accent-yellow);
    font-weight: 800;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
}

/* Subtle motion dynamic for the Champion Container */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}


/* jim trapi 20/07/2026 */
/* Navigation container inside the header */
.hdr-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

/* Base style for each navigation link */
.hdr-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e0e0;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05); /* Semi-transparent background */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.25s ease-in-out;
}

/* Hover effects */
.hdr-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px); /* Subtle lift effect */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Active link style for current page indicator */
.hdr-link.active {
    color: #111111;
    background: #00d2ff; /* Customize to match your theme's primary color */
    border-color: #00d2ff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* Make the div look identical to a standard h1 */
.h1-style {
    display: block;
    font-size: 2rem;           /* Adjust size as needed (e.g., 2rem, 2.5rem, 32px) */
    font-weight: 700;          /* Bold */
    margin-top: 0.67em;
    margin-bottom: 0.67em;
    line-height: 1.2;
    text-transform: uppercase; /* Optional: if you want all caps back */
}
