@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;700&display=swap');

:root {
    --pitch-green: #2d8a3e;
    --pitch-green-dark: #1f6b2e;
    --turf-stripe-a: #2d8a3e;
    --turf-stripe-b: #287a37;
    --scoreboard: #0e1726;
    --scoreboard-text: #f8fafc;
    --accent: #ffcc00;
    --accent-red: #e63946;
    --card-border: rgba(0, 0, 0, 0.08);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    background: repeating-linear-gradient(90deg, var(--turf-stripe-a) 0 80px, var(--turf-stripe-b) 80px 160px);
    min-height: 100vh;
}
h1, h2, h3, h4, .brand-title {
    font-family: 'Bebas Neue', 'Inter', sans-serif;
    letter-spacing: 0.04em;
}

.page { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0e1726 0%, #142037 100%);
    color: #fff;
    box-shadow: var(--shadow);
}
.sidebar .top-row { background: rgba(0,0,0,0.3); height: 84px; display: flex; align-items: center; }
.sidebar .navbar-brand { color: #fff !important; font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; }
.sidebar .brand-ball { font-size: 1.7rem; margin-right: .35rem; }
.sidebar .nav-link {
    color: #cfd8e3 !important;
    padding: .65rem 1rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.05); border-left-color: var(--accent); }
.sidebar .nav-link.active { color: #fff !important; background: rgba(255,204,0,.12); border-left-color: var(--accent); }

main { flex: 1; display: flex; flex-direction: column; }
.top-row {
    height: 84px;
    background: linear-gradient(90deg, var(--scoreboard) 0%, #1a2540 100%);
    color: var(--scoreboard-text);
    display: flex; align-items: center;
    box-shadow: var(--shadow);
}
.brand-bar { display: flex; flex-direction: column; }
.brand-title { font-size: 2rem; color: #fff; margin: 0; }
.brand-title::before { content: '⚽ '; }
.brand-sub { font-size: .75rem; color: var(--accent); letter-spacing: .25em; text-transform: uppercase; }

.content {
    padding: 1.5rem;
    background: rgba(255,255,255,0.96);
    margin: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex: 1;
}

.match-card {
    background: var(--scoreboard);
    color: var(--scoreboard-text);
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: .65rem;
    display: grid;
    grid-template-columns: 2.2rem 1fr auto 1fr 5rem;
    gap: .5rem;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.match-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    min-width: 5rem;
    width: 5rem;
}
.match-action .badge-saved {
    background: rgba(255,204,0,.15);
    color: var(--accent);
    text-align: center;
    font-size: .7rem;
    padding: .2rem 0;
    border-radius: 4px;
    letter-spacing: .05em;
}
.match-action button {
    width: 100%;
    padding: .25rem .4rem !important;
    font-size: .75rem !important;
}
.match-card.played { border-left: 4px solid var(--accent); }
.match-card.unplayed { border-left: 4px solid var(--accent-red); }
.match-order {
    color: var(--accent); font-weight: 700;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem; text-align: center;
}
.team-name { font-weight: 600; }
.team-name.home { text-align: right; }
.team-name.away { text-align: left; }
.score-box {
    display: flex; align-items: center; gap: .25rem;
    background: #000;
    padding: .25rem .55rem;
    border-radius: 6px;
    font-family: 'Bebas Neue', monospace;
    font-size: 1.4rem;
    min-width: 5.5rem;
    justify-content: center;
    color: var(--accent);
}
.score-box input {
    width: 2.2rem; text-align: center;
    background: transparent; border: none;
    color: var(--accent); font-family: inherit; font-size: 1.4rem;
}
.score-box input:focus { outline: 1px solid var(--accent); }
.score-box .sep { opacity: .5; }
.match-action button { font-size: .75rem; padding: .25rem .55rem; }

.league-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
}
.league-table th {
    background: var(--scoreboard); color: var(--accent);
    font-family: 'Bebas Neue', sans-serif;
    padding: .65rem .5rem; text-align: center;
    font-weight: normal; letter-spacing: .05em;
}
.league-table td { padding: .55rem .5rem; text-align: center; border-bottom: 1px solid var(--card-border); }
.league-table td.team-cell { text-align: left; font-weight: 600; }
.league-table tr.qual-top { background: rgba(255,204,0,0.1); }
.league-table tr:hover { background: rgba(45,138,62,0.06); }
.rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; min-width: 2rem;
    border-radius: 50%; background: var(--scoreboard); color: #fff;
    font-family: 'Inter', system-ui, sans-serif; font-weight: 700;
    font-size: .85rem; margin-right: .5rem; line-height: 1;
    box-sizing: border-box;
}

.club-crest {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    color: #fff; font-size: .6rem; font-weight: 700;
    margin-right: .4rem; border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-fifa {
    background: var(--accent); color: #000;
    font-family: 'Bebas Neue', sans-serif; letter-spacing: .08em;
    border: none; padding: .6rem 1.4rem; border-radius: 8px;
    font-size: 1.05rem; box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: transform .1s; cursor: pointer;
}
.btn-fifa:hover { transform: translateY(-1px); background: #ffd633; }
.btn-fifa:disabled { opacity: .5; cursor: not-allowed; }
.btn-fifa-secondary { background: #fff; color: var(--scoreboard); border: 2px solid var(--scoreboard); }
.btn-fifa-danger { background: var(--accent-red); color: #fff; }

.player-slot {
    display: flex; align-items: center; gap: .5rem;
    background: #fff; border: 2px solid var(--card-border);
    border-radius: 8px; padding: .5rem .75rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.player-slot .slot-num {
    background: var(--scoreboard); color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    width: 2.4rem; height: 2.4rem; min-width: 2.4rem;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
}
.player-slot input { border: none; outline: none; flex: 1; font-size: 1rem; background: transparent; }

.team-card {
    background: #fff; border-radius: 10px;
    padding: .9rem 1rem; box-shadow: var(--shadow);
    border-top: 6px solid var(--accent); margin-bottom: .75rem;
}
.team-card h4 { font-family: 'Bebas Neue', sans-serif; margin: 0 0 .25rem 0; display: flex; align-items: center; }
.team-players { color: #475569; }

.stage-pill {
    display: inline-block; background: var(--accent); color: #000;
    font-family: 'Bebas Neue', sans-serif;
    padding: .2rem .7rem; border-radius: 20px;
    letter-spacing: .08em; font-size: .9rem;
}

.hero {
    background:
        linear-gradient(135deg, rgba(14,23,38,0.88), rgba(14,23,38,0.65)),
        repeating-linear-gradient(90deg, var(--turf-stripe-a) 0 60px, var(--turf-stripe-b) 60px 120px);
    color: #fff; border-radius: 12px;
    padding: 2.5rem 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; margin: 0; }
.hero p { color: #cfd8e3; max-width: 60ch; }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.25rem; align-items: start; }
.grid-2 > .league-right {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
@media (max-width: 1000px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-2 > .league-right { position: static; max-height: none; }
}

/* Fullscreen mode - hide nav + topbar, only show content */
body.fullscreen-mode .sidebar,
body.fullscreen-mode main > .top-row { display: none; }
body.fullscreen-mode .content { margin: 0; border-radius: 0; min-height: 100vh; }
body.fullscreen-mode .grid-2 > .league-right { max-height: calc(100vh - 2rem); }
.fullscreen-toggle {
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 100;
}
body:not(.fullscreen-mode) .fullscreen-toggle { position: static; }

.grid-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .65rem; }
.grid-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

.flash { padding: .6rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: #d1fae5; color: #065f46; }
.flash.warn { background: #fef3c7; color: #78350f; }
.flash.err { background: #fee2e2; color: #991b1b; }

.champion-card {
    background:
        linear-gradient(135deg, rgba(14,23,38,0.92), rgba(14,23,38,0.78)),
        repeating-linear-gradient(90deg, var(--turf-stripe-a) 0 60px, var(--turf-stripe-b) 60px 120px);
    color: #fff;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .25rem;
}
.champion-card .trophy { font-size: 3rem; line-height: 1; }
.champion-card .champion-label {
    font-family: 'Bebas Neue', sans-serif;
    color: var(--accent);
    letter-spacing: .35em;
    font-size: 1.1rem;
    margin-top: .25rem;
}
.champion-card .champion-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.6rem;
    line-height: 1.1;
    margin-top: .25rem;
}
.champion-card .champion-players {
    color: #cfd8e3;
    font-size: 1rem;
    margin-top: .25rem;
}

.bracket-label {
    font-family: 'Bebas Neue', sans-serif; color: var(--accent);
    letter-spacing: .15em; font-size: .85rem;
    text-transform: uppercase; margin: .5rem 0 .25rem;
}

#blazor-error-ui {
    background: var(--accent-red); color: #fff;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
#blazor-error-ui a { color: var(--accent); }

@media (max-width: 640px) {
    .page { flex-direction: column; }
    .sidebar { width: 100%; }
}
