:root {
    --bg: #120d2b;
    --panel: #1e1745;
    --panel-2: #2a2160;
    --text: #f6f4ff;
    --muted: #a59fc9;
    --a: #3987e5;
    --b: #d95926;
    --c: #199e70;
    --d: #d55181;
    --good: #3ccf8e;
    --bad: #ff6b6b;
    --gold: #ffd166;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at 80% 0%, #3a2378 0, var(--bg) 55%) fixed;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
    max-width: 520px;
    margin: 0 auto;
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand span {
    color: var(--gold);
}

.me-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: var(--panel);
    font-size: 14px;
    font-weight: 600;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #120d2b;
    font-weight: 800;
    font-size: 14px;
}

.card {
    padding: 18px;
    border-radius: 20px;
    background: var(--panel);
    margin-bottom: 14px;
}

h1 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.2;
}

h2 {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
}

p {
    margin: 0 0 12px;
    line-height: 1.45;
    color: var(--muted);
}

label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
    color: var(--muted);
}

input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid var(--panel-2);
    border-radius: 14px;
    background: #150f33;
    color: var(--text);
    font: inherit;
    font-size: 18px;
}

input:focus {
    outline: none;
    border-color: var(--gold);
}

button {
    width: 100%;
    min-height: 54px;
    margin-top: 12px;
    border: 0;
    border-radius: 16px;
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.08s;
}

button:active {
    transform: scale(0.96);
}

button.primary {
    background: var(--gold);
    color: #241a00;
}

button.ghost {
    background: transparent;
    color: var(--muted);
    font-weight: 500;
}

button:disabled {
    opacity: 0.5;
}

.segmented {
    display: flex;
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
    background: #150f33;
}

.segmented button {
    margin: 0;
    min-height: 44px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
}

.segmented button.on {
    background: var(--panel-2);
    color: var(--text);
}

.players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 999px;
    background: #150f33;
    font-size: 14px;
}

.chip small {
    color: var(--muted);
}

.team-pick button {
    border: 2px solid transparent;
}

.team-pick button.on {
    border-color: var(--gold);
}

.question-text {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 4px;
}

.meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
}

.timer {
    height: 8px;
    margin: 0 0 14px;
    border-radius: 4px;
    background: #150f33;
    overflow: hidden;
}

.timer div {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
}

.choices {
    display: grid;
    gap: 10px;
}

.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    min-height: 64px;
    padding: 10px 14px;
    text-align: left;
    color: #fff;
    font-size: 17px;
}

.choice .letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    font-weight: 800;
}

.choice.c0 { background: var(--a); }
.choice.c1 { background: var(--b); }
.choice.c2 { background: var(--c); }
.choice.c3 { background: var(--d); }
.choice.vrai { background: var(--c); justify-content: center; font-size: 22px; }
.choice.faux { background: var(--bad); justify-content: center; font-size: 22px; }

.big-status {
    padding: 30px 18px;
    text-align: center;
}

.big-status .emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 10px;
}

.big-status h1 {
    margin-bottom: 6px;
}

.result-good h1 { color: var(--good); }
.result-bad h1 { color: var(--bad); }

.points {
    font-size: 40px;
    font-weight: 800;
    color: var(--gold);
}

.ranking {
    display: grid;
    gap: 8px;
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #150f33;
}

.rank-row.me {
    outline: 2px solid var(--gold);
}

.rank-row .pos {
    width: 26px;
    font-weight: 800;
    color: var(--muted);
}

.rank-row .name {
    flex: 1;
    font-weight: 600;
}

.rank-row .score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.host-bar {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    border: 2px dashed var(--panel-2);
}

.host-bar h2 {
    color: var(--gold);
}

.toast {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    max-width: 488px;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 14px;
    background: #3a1530;
    color: #ffd6e0;
    text-align: center;
    font-size: 15px;
}

.anecdote p {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.anecdote h2 {
    color: var(--gold);
}

.small {
    margin: 10px 0 0;
    font-size: 13px;
}

.muted {
    color: var(--muted);
    font-weight: 400;
}

.champion {
    color: var(--gold);
    font-size: 18px;
    font-weight: 700;
}

.theme {
    color: var(--gold);
}

.bets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.bets button {
    min-height: 64px;
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    background: var(--panel-2);
}

.bets button:nth-child(5) {
    background: var(--gold);
    color: #241a00;
}

.bet-line {
    margin: 8px 0 12px;
    color: var(--gold);
}

.points.lost {
    color: var(--bad);
}

/* --- Jumelage d'une télé --- */
.pair-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pair-row input {
    flex: 1;
    min-width: 0;
    text-align: center;
    letter-spacing: 6px;
    font-size: 22px;
}

.pair-row button {
    flex: 1.3;
    margin: 0;
}
