/* ============================================================
   WK Poule 2026 — CANAL+ premium dark theme
   ============================================================ */

/* === Tokens === */
:root {
    --red:        #e4001c;
    --red-dark:   #b30016;
    --bg:         #0d0d0d;
    --surface:    #181818;
    --surface-2:  #242424;
    --border:     #2e2e2e;
    --text:       #f0f0f0;
    --text-muted: #888;
    --green:      #22c55e;
    --amber:      #f59e0b;
    --radius:     8px;
    --radius-lg:  14px;
    --font:       'Inter', system-ui, -apple-system, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* === Layout === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 720px) {
    .two-col { grid-template-columns: 1fr; }
}

/* === Typography === */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 1.5rem;
}

/* === Header / Nav === */
.site-header {
    background: #111;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    display: flex;
    align-items: baseline;
    gap: .3rem;
    flex-shrink: 0;
}

.brand-wk {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--red);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.brand-poule {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.brand-year {
    font-size: .75rem;
    color: var(--text-muted);
}

.site-nav {
    display: flex;
    gap: .25rem;
    flex: 1;
    overflow-x: auto;
}

.nav-link {
    padding: .375rem .75rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color .15s, background .15s;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }

.nav-link--active { color: var(--text); background: var(--surface-2); }

.nav-link--admin { color: var(--red); }

.header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.user-name { font-size: .875rem; color: var(--text-muted); }

/* === Language toggle === */
.lang-toggle {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.lang-btn {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: .3rem .65rem;
    transition: color .15s, background .15s;
    line-height: 1;
}

.lang-btn:hover { color: var(--text); background: var(--border); }

.lang-btn--active {
    color: #fff;
    background: var(--red);
}

.lang-sep { display: none; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, background .15s;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { opacity: .88; }

.btn--primary  { background: var(--red); color: #fff; }
.btn--ghost    { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--full     { width: 100%; }
.btn--sm       { padding: .35rem .75rem; font-size: .8rem; }

/* === Cards === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .75rem;
}

/* === Stat row === */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 540px) {
    .stat-row { grid-template-columns: 1fr 1fr; }
    .stat-row .stat-card:last-child { grid-column: span 2; }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.stat-card--warn { border-color: var(--amber); }
.stat-card--ok   { border-color: var(--green); }

.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.stat-of { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

/* === Match preview (dashboard) === */
.match-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .5rem;
}

.match-team { font-size: 1.1rem; font-weight: 700; }
.match-vs   { color: var(--text-muted); font-size: .875rem; }
.match-kickoff { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }

/* === Points list === */
.points-list { display: flex; flex-direction: column; gap: .6rem; }

.points-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .875rem;
}

.points-match { flex: 1; }
.points-pred  { color: var(--text-muted); }

.points-badge {
    min-width: 2rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    text-align: center;
}

.points-badge--5 { background: #14532d; color: #86efac; }
.points-badge--3 { background: #1e3a5f; color: #93c5fd; }
.points-badge--2 { background: #2d2010; color: #fcd34d; }
.points-badge--0 { background: #2a0a0a; color: #fca5a5; }

/* === Leaderboard mini === */
.leaderboard-mini { display: flex; flex-direction: column; gap: .5rem; }

.lb-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-radius: var(--radius);
    font-size: .9rem;
    transition: background .15s;
}

.lb-row:hover    { background: var(--surface-2); }
.lb-row--me      { background: var(--surface-2); border: 1px solid var(--border); }

.lb-pos  { width: 1.5rem; color: var(--text-muted); font-size: .8rem; font-weight: 600; }
.lb-name { flex: 1; font-weight: 500; }
.lb-pts  { font-weight: 700; }

.link-more { display: block; margin-top: .75rem; font-size: .8rem; color: var(--red); }
.link-more:hover { text-decoration: underline; }

.empty-state { color: var(--text-muted); font-size: .875rem; }

/* === Alerts === */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert--error   { background: #2a0a0a; border-color: #7f1d1d; color: #fca5a5; }
.alert--success { background: #052e16; border-color: #14532d; color: #86efac; }
.alert--info    { background: #0c1a2e; border-color: #1e3a5f; color: #93c5fd; }

/* === Forms === */
.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1rem;
}

.field label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
    font-family: var(--font);
    padding: .6rem .875rem;
    transition: border-color .15s;
    outline: none;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--red); }

/* === Auth page === */
.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.auth-brand {
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

.auth-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.auth-card h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.auth-lang {
    display: flex;
    justify-content: flex-end;
    gap: 0;
    margin-bottom: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
    margin-left: auto;
}

.auth-tagline {
    font-size: .8rem;
    color: var(--text-muted);
    letter-spacing: .04em;
}

/* === Utility === */
.text-muted { color: var(--text-muted); }
.mb-1       { margin-bottom: 1.25rem; }

/* === Phase sections (matches.php) === */
.phase-section  { margin-bottom: 2rem; }

.phase-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
}

.match-list         { display: flex; flex-direction: column; gap: .5rem; }

.match-row {
    display: grid;
    grid-template-columns: 160px 1fr 5rem 1fr 160px;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

@media (max-width: 860px) {
    .match-row { grid-template-columns: 120px 1fr 4rem 1fr 120px; }
}

@media (max-width: 600px) {
    .match-row { grid-template-columns: 1fr; gap: .4rem; }
}

.match-row--finished { opacity: .75; }

.match-row__kickoff { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; }

.match-row__home {
    text-align: right;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-row__away {
    text-align: left;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-row__score {
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.score-placeholder { color: var(--text-muted); font-size: .85rem; font-weight: 400; }

.team--winner { color: var(--green); }

.match-row__prediction {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
}

.pred-score { font-weight: 700; }

/* === Badges === */
.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge--locked    { background: #2d2010; color: #fcd34d; }
.badge--scheduled { background: var(--surface-2); color: var(--text-muted); }
.badge--finished  { background: #052e16; color: #86efac; }
.badge--admin     { background: #2a0a0a; color: var(--red); }
.badge--user      { background: var(--surface-2); color: var(--text-muted); }

/* === Predictions page === */
.pred-list       { display: flex; flex-direction: column; gap: .75rem; }

.pred-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.pred-card--locked { opacity: .65; }

.pred-card__meta   { display: flex; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.pred-card__kickoff { font-size: .8rem; color: var(--text-muted); }

.pred-card__teams {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.vs { color: var(--text-muted); font-size: .875rem; font-weight: 400; }

.pred-form         { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.pred-inputs       { display: flex; align-items: center; gap: .4rem; }
.pred-inputs input { width: 3.5rem; text-align: center; padding: .5rem; font-size: 1.1rem; font-weight: 700; }
.pred-dash         { font-size: 1.2rem; color: var(--text-muted); }

.pred-card__locked-msg { font-size: .875rem; color: var(--text-muted); }

/* === Bonus page === */
.bonus-list        { display: flex; flex-direction: column; gap: .75rem; }

.bonus-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.bonus-card--closed { opacity: .7; }

.bonus-card__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.bonus-pts {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
}

.bonus-question    { font-weight: 600; flex: 1; }
.bonus-input-row   { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bonus-input-row input { flex: 1; min-width: 160px; max-width: 340px; }

.bonus-card__result { font-size: .875rem; color: var(--text-muted); }
.bonus-correct-label { font-weight: 600; color: var(--text); }

/* === Leaderboard table === */
.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-th {
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}

.lb-th--num   { text-align: right; }
.lb-th--total { text-align: right; font-weight: 800; color: var(--text); }
.lb-th--pos   { width: 2.5rem; }

.lb-tr { transition: background .1s; }
.lb-tr:hover { background: var(--surface-2); }
.lb-tr--me   { background: var(--surface-2); }

.lb-td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}

.lb-td--pos   { color: var(--text-muted); font-weight: 600; }
.lb-td--name  { font-weight: 600; }
.lb-td--num   { text-align: right; color: var(--text-muted); }
.lb-td--total { text-align: right; font-weight: 800; font-size: 1rem; }

.lb-you {
    display: inline-block;
    margin-left: .4rem;
    font-size: .7rem;
    background: var(--red);
    color: #fff;
    padding: .1rem .4rem;
    border-radius: 999px;
    font-weight: 700;
}

.medal {
    display: inline-flex;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
}

.medal--1 { background: #854d0e; color: #fef9c3; }
.medal--2 { background: #374151; color: #e5e7eb; }
.medal--3 { background: #7c2d12; color: #fed7aa; }

/* === Rules page === */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

@media (max-width: 720px) { .rules-grid { grid-template-columns: 1fr; } }

.rules-sub   { font-size: .875rem; color: var(--text-muted); margin-bottom: .75rem; }

.rules-table { width: 100%; border-collapse: collapse; }
.rules-table th,
.rules-table td {
    text-align: left;
    padding: .5rem .6rem;
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
}
.rules-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

.pts         { text-align: right; font-weight: 800; }
.pts--5      { color: #86efac; }
.pts--3      { color: #93c5fd; }
.pts--2      { color: #fcd34d; }
.pts--0      { color: #fca5a5; }
.pts--bonus  { color: var(--red); }

.rules-note {
    margin-top: .75rem;
    padding: .6rem .75rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    font-size: .8rem;
    color: var(--text-muted);
}

.rules-tiebreak { padding-left: 1.25rem; list-style: decimal; }
.rules-tiebreak li { padding: .3rem 0; font-size: .875rem; color: var(--text-muted); }

/* === Account page === */
.account-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.25rem; }

@media (max-width: 640px) { .account-grid { grid-template-columns: 1fr; } }

.profile-dl { display: grid; grid-template-columns: 1fr 2fr; gap: .5rem; font-size: .9rem; }
.profile-dl dt { color: var(--text-muted); }
.profile-dl dd { font-weight: 600; }

/* === Admin pages === */
.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (max-width: 640px) { .admin-nav-grid { grid-template-columns: 1fr 1fr; } }

.admin-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color .15s, background .15s;
    text-decoration: none;
}

.admin-nav-card:hover { border-color: var(--red); background: var(--surface-2); }
.admin-nav-icon  { font-size: 1.75rem; }
.admin-nav-label { font-size: .875rem; font-weight: 600; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th {
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}
.admin-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface-2); }
.row--inactive td { opacity: .45; }

.field-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.field-row .field { flex: 1; min-width: 140px; }

.inline-reset-form { display: flex; gap: .4rem; align-items: center; }
.inline-reset-form input { width: 140px; }

.admin-results-list { display: flex; flex-direction: column; gap: .5rem; }

.result-row {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.result-row--done { border-color: #14532d; }

@media (max-width: 720px) { .result-row { grid-template-columns: 1fr; } }

.result-row__meta { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.result-kickoff   { color: var(--text-muted); }
.result-row__teams { display: flex; align-items: center; gap: .5rem; font-weight: 600; }

.result-form { display: flex; align-items: center; gap: .4rem; }
.result-form input { width: 3.5rem; text-align: center; padding: .4rem; font-size: 1rem; font-weight: 700; }

.bonus-admin-list { display: flex; flex-direction: column; gap: .75rem; }
.bonus-admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.bonus-admin-card__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.bonus-answer-form { display: flex; flex-direction: column; gap: .4rem; }

/* === Scrollbar (webkit) === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
