/* 
   =========================================
   Design System & Variable Declarations
   =========================================
*/
:root {
    /* Cream Theme (Default) */
    --bg-color: #f5efe6;
    --panel-bg: #ffffff;
    --panel-border: #e6dfd3;
    --text-primary: #1c1c1c;
    --text-secondary: #666159;
    --accent-orange: #e84e27;
    --accent-orange-hover: #cf3c18;
    --accent-gold: #c39b34;
    --pitch-green: #387c44;
    --pitch-line: rgba(255, 255, 255, 0.4);
    --slot-border: rgba(255, 255, 255, 0.6);
    --slot-bg: rgba(0, 0, 0, 0.15);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --header-bg: #ebdcb9;
    --ticker-bg: #1e1e1e;
    --ticker-text: #39ff14; /* Neon green */
}

.dark-theme {
    /* Glassmorphic Dark Theme */
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.85);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    --accent-gold: #fbbf24;
    --pitch-green: #14532d;
    --pitch-line: rgba(255, 255, 255, 0.25);
    --slot-border: rgba(255, 255, 255, 0.35);
    --slot-bg: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --header-bg: #1e293b;
    --ticker-bg: #020617;
    --ticker-text: #38bdf8; /* Cyan */
}

/* 
   =========================================
   Base resets and styling
   =========================================
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

ul {
    list-style: none;
}

.hidden {
    display: none !important;
}

/* 
   =========================================
   Layout Containers
   =========================================
*/
#app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 15px;
}

/* 
   =========================================
   Header Component
   =========================================
*/
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--panel-border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 15px;
    transition: background-color 0.4s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-large {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtext {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.logo-desc {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-middle {
    display: flex;
    gap: 8px;
}

.config-badge {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    gap: 10px;
}

.header-btn {
    padding: 6px 12px;
    font-size: 12px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
}

.header-btn:hover {
    background-color: var(--accent-orange);
    color: white;
    border-color: var(--accent-orange);
}

/* 
   =========================================
   Screen: Landing
   =========================================
*/
#screen-landing {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    padding: 40px 0;
}

.landing-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    margin-top: auto;
    margin-bottom: auto;
}

@media (max-width: 992px) {
    .landing-content {
        grid-template-columns: 1fr;
    }
    .landing-right {
        display: none;
    }
}

.hero-title {
    font-size: 96px;
    font-weight: 900;
    line-height: 0.85;
    color: var(--text-primary);
    letter-spacing: -2px;
}

.hero-title .dash {
    color: var(--accent-gold);
}

.hero-subtitle {
    font-size: 38px;
    margin-top: 15px;
    font-weight: 800;
    line-height: 1.1;
}

.hero-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 20px;
    max-width: 580px;
    line-height: 1.5;
}

/* Custom Uniform & Name Editor styles */
.text-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background-color: var(--panel-bg);
    color: var(--text-primary);
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    border-color: var(--accent-orange);
}

.jersey-selection-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 500px) {
    .jersey-selection-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.jersey-badge-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid transparent;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--panel-bg);
    box-shadow: var(--card-shadow);
    transition: all 0.15s ease-in-out;
}

.jersey-badge-btn:hover {
    transform: scale(1.15);
}

.jersey-badge-btn.active {
    border-color: var(--accent-gold);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-gold);
}

/* Dynamic CSS Jersey Patterns */
.jersey-element-custom {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.jersey-element-custom.solid {
    background-color: var(--primary);
}

.jersey-element-custom.striped-vertical {
    background: linear-gradient(90deg, 
        var(--primary) 0%, var(--primary) 20%, 
        var(--secondary) 20%, var(--secondary) 40%, 
        var(--primary) 40%, var(--primary) 60%, 
        var(--secondary) 60%, var(--secondary) 80%,
        var(--primary) 80%, var(--primary) 100%);
}

.jersey-element-custom.striped-horizontal {
    background: linear-gradient(180deg, 
        var(--primary) 0%, var(--primary) 20%, 
        var(--secondary) 20%, var(--secondary) 40%, 
        var(--primary) 40%, var(--primary) 60%, 
        var(--secondary) 60%, var(--secondary) 80%,
        var(--primary) 80%, var(--primary) 100%);
}

.jersey-element-custom.sash {
    background: linear-gradient(135deg, 
        var(--primary) 0%, var(--primary) 35%, 
        var(--secondary) 35%, var(--secondary) 55%, 
        var(--primary) 55%, var(--primary) 100%);
}

.jersey-element-custom.striped-diagonal {
    background: linear-gradient(135deg, 
        var(--primary) 0%, var(--primary) 20%, 
        var(--secondary) 20%, var(--secondary) 40%, 
        var(--primary) 40%, var(--primary) 60%, 
        var(--secondary) 60%, var(--secondary) 80%,
        var(--primary) 80%, var(--primary) 100%);
}

/* Matchcenter jersey sizes */
.jersey-element-custom.user-jersey-preview,
.jersey-element-custom.cpu-jersey-preview {
    width: 64px;
    height: 64px;
    border-width: 3px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Configs */
.config-panel {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-group h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.tactic-grid, .style-grid, .mode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-select {
    padding: 6px 12px;
    font-size: 12px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
}

.btn-select:hover {
    border-color: var(--text-primary);
}

.btn-select.active {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

.btn-primary {
    background-color: var(--accent-orange);
    color: white;
    padding: 12px 24px;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(232, 78, 39, 0.2);
}

.btn-primary:hover {
    background-color: var(--accent-orange-hover);
    transform: translateY(-2px);
}

.btn-primary.disabled, .btn-primary:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 12px;
}

.btn-secondary:hover {
    background-color: var(--panel-border);
}

/* Pitch Mockup on Landing */
.pitch-mockup {
    width: 100%;
    aspect-ratio: 4/5;
    background-color: var(--pitch-green);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.mini-pitch {
    position: relative;
    width: 100%;
    height: 100%;
    border: 2px solid var(--pitch-line);
    border-radius: 6px;
}

.pitch-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pitch-lines::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--pitch-line);
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    aspect-ratio: 1;
    border: 2px solid var(--pitch-line);
    border-radius: 50%;
}

.penalty-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 18%;
    border: 2px solid var(--pitch-line);
}

.penalty-area.top {
    top: 0;
    border-top: none;
}

.penalty-area.bottom {
    bottom: 0;
    border-bottom: none;
}

/* Mockup squad badges */
.mockup-squad {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.shirt-badge {
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: #ebdcb9;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: black;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translate(-50%, -50%);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.shirt-badge .shirt-num {
    font-size: 8px;
    font-weight: 700;
}

.shirt-badge .shirt-name {
    position: absolute;
    bottom: -11px;
    font-size: 7px;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px black;
    white-space: nowrap;
}

/* Landing footer */
.landing-footer {
    border-top: 1px solid var(--panel-border);
    padding-top: 20px;
    text-align: center;
}

.footer-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-item {
    font-weight: 500;
}

.stat-item strong {
    color: var(--text-primary);
}

.stat-delimiter {
    margin: 0 12px;
    color: var(--panel-border);
}

/* 
   =========================================
   Screen: Draft Screen (Main Game Loop)
   =========================================
*/
.draft-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 15px;
    flex-grow: 1;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .draft-layout {
        grid-template-columns: 280px 1fr;
    }
    .draft-panel-right {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .draft-layout {
        grid-template-columns: 1fr;
    }
    .draft-panel-right, .draft-panel-left {
        grid-column: span 1;
    }
}

.card-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease;
}

/* Left Panel: Roll team */
.roll-state {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.roll-instruction {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-roll {
    width: 100%;
    margin-top: auto;
    margin-bottom: 40px;
    font-size: 18px;
    padding: 16px;
    background-color: var(--accent-orange);
}

.rolled-team-card {
    background: linear-gradient(135deg, var(--text-primary), #2c2c2c);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.rolled-team-card::after {
    content: '⚽';
    position: absolute;
    font-size: 80px;
    opacity: 0.05;
    right: -20px;
    bottom: -20px;
}

.team-meta {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 4px;
}

#rolled-team-name {
    font-size: 24px;
    font-weight: 800;
}

#rolled-team-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
}

.rerolls-container {
    background-color: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}

.rerolls-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

#btn-reroll-team {
    width: 100%;
    font-size: 12px;
    padding: 8px;
}

.player-select-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.player-list-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 2px;
    max-height: 380px;
}

/* Custom Scrollbar */
.player-list-scroll::-webkit-scrollbar,
.box-score-list-container::-webkit-scrollbar,
.end-squad-scroll::-webkit-scrollbar {
    width: 6px;
}

.player-list-scroll::-webkit-scrollbar-track,
.box-score-list-container::-webkit-scrollbar-track,
.end-squad-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.player-list-scroll::-webkit-scrollbar-thumb,
.box-score-list-container::-webkit-scrollbar-thumb,
.end-squad-scroll::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

/* Player Cards in List */
.player-row {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.player-row:hover:not(.disabled) {
    background-color: var(--bg-color);
    transform: translateX(4px);
    border-color: var(--text-primary);
}

.player-row.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: rgba(0, 0, 0, 0.02);
}

.player-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 20px;
}

.player-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-left: 5px;
}

.player-name {
    font-size: 13px;
    font-weight: 700;
}

.player-pos-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
}

.chem-bonus {
    color: var(--accent-orange);
    font-weight: 800;
    margin-left: 4px;
}

.player-ovr {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    width: 25px;
    text-align: right;
}

.player-row.selected-player {
    border-color: var(--accent-orange);
    background-color: rgba(232, 78, 39, 0.05);
}

/* 
   =========================================
   Center Panel: Football Pitch
   =========================================
*/
.draft-panel-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pitch-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.soccer-pitch {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background-color: var(--pitch-green);
    border: 3px solid var(--pitch-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#pitch-slots-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.pitch-footer-msg {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 500;
}

/* Slots pontilhados */
.pitch-slot {
    position: absolute;
    width: 62px;
    height: 62px;
    border: 2px dashed var(--slot-border);
    border-radius: 50%;
    background-color: var(--slot-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 900;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.pitch-slot:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translate(-50%, -50%) scale(1.1);
}

.pitch-slot.highlighted {
    border-color: var(--accent-orange);
    background-color: rgba(232, 78, 39, 0.25);
    box-shadow: 0 0 12px var(--accent-orange);
    animation: pulsate 1.5s infinite alternate;
}

@keyframes pulsate {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.08); }
}

/* Badges / Camisas dos Jogadores Escalados */
.assigned-player-badge {
    position: absolute;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25), 0 0 0 2px rgba(255,255,255,0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s ease;
    /* Styles are updated dynamically via JS with theme classes */
}

.assigned-player-badge:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35), 0 0 0 3px rgba(255,255,255,0.5);
}

.assigned-player-badge.moving-source {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 12px var(--accent-orange), 0 0 0 2px var(--accent-orange);
    animation: pulsate 1.2s infinite alternate;
}

.assigned-player-badge .badge-num {
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.assigned-player-badge .badge-ovr {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.assigned-player-badge .badge-name {
    position: absolute;
    bottom: -18px;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 
   =========================================
   Right Panel: Box Score
   =========================================
*/
.box-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--panel-border);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.box-score-title h3 {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#draft-progress {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-orange);
}

.box-score-overall {
    background-color: var(--text-primary);
    color: var(--bg-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 900;
    border: 3px solid var(--accent-gold);
}

/* Ratings bars */
.ratings-bar-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-label {
    font-size: 10px;
    font-weight: 700;
    width: 52px;
    color: var(--text-secondary);
}

.progress-bar {
    flex-grow: 1;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease-out;
}

.progress-fill.attack {
    background-color: var(--accent-orange);
}

.progress-fill.defense {
    background-color: var(--text-primary);
}

.progress-fill.chemistry {
    background-color: var(--accent-gold);
}

.rating-value {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 800;
    width: 32px;
    text-align: right;
}

.box-score-list-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 290px;
}

.box-position-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
}

.box-position-label {
    font-weight: 700;
    color: var(--text-secondary);
    width: 35px;
}

.box-player-name {
    flex-grow: 1;
    margin-left: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.box-player-name.filled {
    font-weight: 700;
    color: var(--text-primary);
}

.box-player-ovr {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-secondary);
}

.box-player-ovr.filled {
    color: var(--accent-orange);
}

.box-score-actions {
    margin-top: 15px;
}

#btn-start-simulation {
    width: 100%;
    padding: 12px;
}

/* 
   =========================================
   Screen: Simulation
   =========================================
*/
.simulation-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    flex-grow: 1;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }
}

.simulation-tabs {
    display: flex;
    border-bottom: 2px solid var(--panel-border);
    margin-bottom: 15px;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: 14px;
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-orange);
}

.tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.tournament-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.tournament-table th, .tournament-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--panel-border);
}

.tournament-table th {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
}

.tournament-table tbody tr.user-row {
    background-color: rgba(232, 78, 39, 0.05);
    font-weight: 700;
}

.tournament-table tbody tr.qualify-row td {
    border-left: 3px solid var(--pitch-green);
}

/* Fixtures list */
.group-fixtures h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.fixture-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    box-shadow: var(--card-shadow);
}

.fixture-teams {
    font-weight: 700;
}

.fixture-score {
    font-weight: 900;
    color: var(--accent-orange);
    background-color: var(--panel-bg);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

/* Bracket tree */
.bracket-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .bracket-container {
        grid-template-columns: 1fr;
    }
}

.bracket-stage h4 {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 4px;
}

.matchups-list {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    min-height: 320px;
    gap: 10px;
}

.bracket-match {
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 6px;
    font-size: 10px;
}

.bracket-match.active-match {
    border-color: var(--accent-orange);
    box-shadow: 0 0 8px rgba(232, 78, 39, 0.15);
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    padding: 4px;
    border-radius: 4px;
}

.bracket-team.winner {
    font-weight: 700;
    color: var(--text-primary);
}

.bracket-team.loser {
    opacity: 0.5;
}

.bracket-team.user-team {
    color: var(--accent-orange);
}

/* 
   =========================================
   Match Center / Live Ticker (Right area)
   =========================================
*/
.match-center-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-center-panel {
    text-align: center;
    padding: 10px 0;
}

.stage-title-heading {
    font-size: 24px;
    margin-bottom: 25px;
}

.vs-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.vs-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
}

.vs-jersey {
    font-size: 48px;
    margin-bottom: 8px;
}

.vs-team-name {
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    margin-top: 8px;
}

.vs-team-ovr {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.vs-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-orange);
    color: white;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(232, 78, 39, 0.25);
}

/* Live Simulation */
.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.live-stage {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.live-timer-badge {
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 900;
}

.live-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.score-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-team-name {
    font-size: 13px;
    font-weight: 800;
}

.score-val {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: var(--accent-orange);
}

.score-divider {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-secondary);
    padding: 0 10px;
}

.live-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    font-size: 12px;
}

.control-label {
    color: var(--text-secondary);
    font-weight: 700;
}

.speed-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 4px 10px;
    font-size: 11px;
}

.speed-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

.speed-btn.skip {
    background-color: var(--accent-gold);
    color: black;
    font-weight: 700;
}

/* Match Narration Ticker Box */
.ticker-box {
    background-color: var(--ticker-bg);
    border-radius: 8px;
    padding: 15px;
    height: 220px;
    overflow-y: auto;
    text-align: left;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column-reverse; /* Scroll updates from bottom */
}

.ticker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-msg {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12.5px;
    color: #e2e8f0;
    line-height: 1.4;
    animation: fadeInTicker 0.25s ease-out;
}

@keyframes fadeInTicker {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ticker-msg .time {
    color: var(--ticker-text);
    font-weight: 700;
    margin-right: 6px;
}

.ticker-msg.goal {
    color: #facc15; /* Gold/Yellow for goals */
    font-weight: 700;
}

.ticker-msg.card {
    color: #ef4444; /* Red for warnings/cards */
}

.post-match-actions {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 8px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#match-result-status {
    font-size: 16px;
    margin-bottom: 12px;
}

/* 
   =========================================
   Screen: End Game / Victory / Loss
   =========================================
*/
.end-card {
    max-width: 650px;
    margin: 40px auto;
    text-align: center;
    align-items: center;
    animation: slideUp 0.5s ease;
}

.end-icon {
    font-size: 72px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

#end-title {
    font-size: 32px;
    margin-bottom: 8px;
}

.end-desc {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.seven-zero-container {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: black;
    border-radius: 8px;
    padding: 15px 30px;
    font-weight: 800;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.seven-zero-title {
    font-size: 16px;
    letter-spacing: 1.5px;
}

.seven-zero-msg {
    font-size: 13px;
    margin-top: 4px;
}

.campaign-summary-box {
    width: 100%;
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.campaign-summary-box h3, .end-squad-box h3 {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.stats-row-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stats-row-grid:last-child {
    margin-bottom: 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-box .val {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-orange);
}

.stat-box .lbl {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Squad summary in end screen */
.end-squad-box {
    width: 100%;
    margin-bottom: 25px;
}

.end-squad-scroll {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.end-squad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 550px) {
    .end-squad-grid {
        grid-template-columns: 1fr;
    }
}

.end-player-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
    font-size: 11px;
    align-items: center;
}

.end-player-item .name {
    font-weight: 700;
}

.end-player-item .club {
    font-size: 9px;
    color: var(--text-secondary);
    margin-left: 5px;
}

.end-player-item .ovr {
    font-weight: 800;
    color: var(--accent-orange);
}

.end-actions {
    width: 100%;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

/* 
   =========================================
   Chemistry Info Button & Modal CSS
   =========================================
 */
.chem-info-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    margin-left: 4px;
    vertical-align: middle;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
}

.chem-info-btn:hover {
    opacity: 0.8;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    animation: slideUp 0.3s ease;
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 12px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    font-size: 14px;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 16px;
}

.chem-rule-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.chem-rule-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--accent-orange);
}

.chem-rule-card p {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.chem-rule-card.impact {
    border-left: 4px solid var(--accent-gold);
}

.chem-rule-card.impact h4 {
    color: var(--accent-gold);
}

.chem-rule-card .highlight {
    margin-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.shootout-score {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: normal;
}
/* Live Scorers Panel styling */
.live-scorers-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    min-height: 40px;
}

.scorers-column {
    display: flex;
    flex-direction: column;
}

.scorers-column.home {
    text-align: left;
    align-items: flex-start;
}

.scorers-column.away {
    text-align: right;
    align-items: flex-end;
}

.scorers-column ul {
    width: 100%;
}

.scorers-column li {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

/* Modal and celebrate updates */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.champion-victory-celebration {
    animation: celebrateSpin 1s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite alternate;
}

@keyframes celebrateSpin {
    from { transform: scale(1); }
    to { transform: scale(1.15) rotate(5deg); }
}

.champ-badge-anim {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: black;
    border-radius: 12px;
    font-weight: 900;
    font-size: 24px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
    animation: pulse 1.5s infinite;
}

.vs-team-badge {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.shirt-badge-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}
