:root {
    --primary-bg: #0f1215;
    --secondary-bg: #1e2329;
    --accent-color: #00ff88;
    --text-color: #ffffff;
    --highlight: #ffcc00;
    --font-heading: 'Russo One', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow: hidden;
}

header {
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    border-bottom: 2px solid var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-title {
    font-family: var(--font-heading);
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* --- Main Game Area --- */

#main-game-area {
    background: linear-gradient(
        rgba(15, 18, 21, 0.9), rgba(15, 18, 21, 0.9)), 
        url('/stadium-bg.jpg'
    );
    background-size: cover;
    background-position: center;
}

#visual-display {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px #000;
    margin-bottom: 2rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 900px;
}

.game-btn {
    background-color: var(--secondary-bg);
    border: 1px solid #3a4149;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 20px 30px;
    min-width: 200px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.game-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background-color: #3a4149;
    transition: background-color 0.2s;
}

.game-btn:hover {
    transform: translateY(-2px);
    background-color: #2a3038;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}

.game-btn:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    background-color: #1a1a1a;
}

.game-btn:focus::before {
    background-color: var(--accent-color);
}

footer {
    background-color: #000;
    border-top: 4px solid var(--highlight);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 15px 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
}

#score-display, #down-display, #time-display {
    color: var(--highlight);
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

body.high-contrast {
    --primary-bg: #000000;
    --secondary-bg: #000000;
    --accent-color: #FFFF00;
    --text-color: #FFFF00;
}

body.high-contrast .game-btn {
    border: 4px solid #FFFF00 !important;
    background-color: #000 !important;
    color: #FFFF00 !important;
    box-shadow: none !important;
}

body.high-contrast #visual-display {
    color: #FFFF00;
    text-shadow: none;
}

#visual-display-container {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.log-line.current-line {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s ease;
}

.log-line.old-line {
    font-family: var(--font-body);
    font-size: 1.4rem;
    color: #ccc;
    opacity: 0.5;
    font-weight: normal;
}

.log-line.very-old-line {
    font-size: 1.1rem;
    opacity: 0.2;
}

.slider-box {
    background-color: var(--secondary-bg); 
    border: 1px solid #3a4149;
    color: #fff;
    border-radius: 8px;
}

body.high-contrast .slider-box {
    background-color: #000 !important;      
    border: 4px solid #FFFF00 !important;   
    color: #FFFF00 !important;              
}

body.high-contrast input[type="range"] {
    accent-color: #FFFF00;
    border: 1px solid #FFFF00;
}

/* --- Name Entry Modal --- */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Very dark background */
    z-index: 2000; /* Sit on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#modal-content {
    background-color: #1e2329;
    padding: 40px;
    border: 2px solid #00ff88;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.modal-input {
    font-size: 1.5rem;
    padding: 10px;
    text-align: center;
    margin: 20px 0;
    width: 100%;
    background: #0f1215;
    border: 1px solid #444;
    color: #fff;
    border-radius: 5px;
}

.modal-input:focus {
    outline: none;
    border-color: #00ff88;
}

/* --- TOURNAMENT BRACKET VISUALS --- */
/* --- COMPACT TOURNAMENT BRACKET --- */
.tournament-header {
    font-family: 'Russo One', sans-serif;
    color: #ffcc00;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-size: 1.5rem;
}

.bracket-wrapper {
    display: flex;
    justify-content: center; /* Center everything */
    align-items: center;
    width: 100%;
    /* Remove overflow/scrolling constraints */
    padding: 10px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.6); 
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* Conference Sides */
.conference-side {
    display: flex;
    gap: 5px; /* Tight gap */
    flex: 1; /* Allow these to shrink/grow */
    justify-content: space-around;
}

.conference-side.right {
    flex-direction: row-reverse;
}

.round-column {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically */
    gap: 10px; /* Vertical gap between cards */
    flex: 1;
    align-items: center;
}

.round-title {
    text-align: center;
    font-size: 0.7rem; /* Smaller title */
    color: #00ff88; 
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap; /* Prevent wrapping */
}

/* --- COMPACT CARD STYLES --- */
.match-card {
    background: #2b303b; 
    border: 1px solid #555;
    border-radius: 4px;
    
    /* Responsive Width: Fits 7 columns */
    width: 120px; 
    min-width: 100px;
    
    padding: 4px 6px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.match-card:hover {
    transform: scale(1.05); /* Zoom slightly on hover */
    border-color: #888;
    z-index: 10;
}

.match-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 0.75rem; /* Small, readable text */
    color: #ccc;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden; /* Cut off long names if needed */
}

.team-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* "Rebels" -> "Reb..." if too small */
    max-width: 80px;
}

.match-team.active-user {
    color: #00ff88; 
    font-weight: bold;
}

.seed-num {
    background-color: #444;
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    min-width: 14px;
    text-align: center;
}

.score-box {
    background: #1a1d24;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #fff;
    border: 1px solid #444;
}

/* Connectors (Small Lines) */
.round-column.divisional .match-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px; /* Short lines */
    width: 8px;
    height: 1px;
    background: #666;
}

/* Super Bowl Center */
.super-bowl-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
}

.super-bowl-logo {
    font-family: 'Russo One', sans-serif;
    font-size: 1.2rem; /* Reduced size */
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
    margin-bottom: 10px;
    text-align: center;
    line-height: 1;
}

/* Force Super Bowl card to be slightly wider than regular cards */
.super-bowl-card {
    width: 140px !important;
    text-align: center;
    border-color: #ffcc00;
}

/* --- RESPONSIVE SCALING --- */
/* If the screen is smaller than 1200px, shrink the whole bracket slightly */
@media (max-width: 1200px) {
    .bracket-wrapper {
        zoom: 0.85; /* Easy CSS zoom to fit everything */
    }
}

/* --- FULL SCREEN WELCOME PAGE --- */
#welcome-screen-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f1215 url('/stadium-bg.jpg') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    text-align: center;
    padding: 20px;
}

.welcome-content-box {
    background: rgba(0, 0, 0, 0.85);
    padding: 40px 60px;
    border: 2px solid #00ff88;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.welcome-warning {
    color: #ffcc00; 
    font-weight: bold; 
    font-size: 1.2rem; 
    margin-bottom: 30px; 
    line-height: 1.5;
    border-bottom: 1px solid #444;
    padding-bottom: 20px;
}

.welcome-input {
    font-size: 1.8rem;
    padding: 15px;
    text-align: center;
    margin: 20px 0;
    width: 100%;
    background: #1e2329;
    border: 2px solid #555;
    color: #fff;
    border-radius: 8px;
}

.welcome-input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}