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

:root {
    --ink: #12140f;
    --tatami: #1c2118;
    --tatami-line: #2a3122;
    --gi: #f2ede1;
    --gi-dim: #b9b3a4;
    --belt-red: #c8323a;
    --corner-blue: #1e3f7a;
    --point-orange: #e07b1f;
    --point-vert: #3d8f5b;
    --focus: #f2ede1;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ink);
    color: var(--gi);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
}

body {
    background-image:
        repeating-linear-gradient(0deg, transparent 0 62px, var(--tatami-line) 62px 64px),
        repeating-linear-gradient(90deg, transparent 0 62px, var(--tatami-line) 62px 64px);
    background-color: var(--tatami);
}

.scoreboard-font {
    font-family: 'Bebas Neue', 'Inter', sans-serif;
    letter-spacing: 0.03em;
}

a { color: inherit; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
}

button:focus-visible, input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--gi-dim);
}

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: rgba(18, 20, 15, 0.88);
    border: 1px solid var(--tatami-line);
    border-top: 4px solid var(--belt-red);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-card h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.4rem;
    margin: 6px 0 26px;
    letter-spacing: 0.04em;
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.4rem;
    text-align: center;
    letter-spacing: 0.3em;
    background: var(--ink);
    color: var(--gi);
    border: 1px solid var(--tatami-line);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.login-card button {
    width: 100%;
    padding: 14px;
    background: var(--belt-red);
    color: var(--gi);
    font-weight: 800;
    border-radius: var(--radius);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.error-msg {
    color: var(--belt-red);
    font-weight: 600;
    min-height: 1.2em;
    margin-bottom: 8px;
}

/* ---------- Layout général écrans combat ---------- */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid var(--tatami-line);
}

.match-header .eyebrow { margin-bottom: 4px; }

.timer {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    text-align: center;
    line-height: 1;
}
.timer.warning { color: var(--belt-red); }

.fighters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 24px;
}

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

.fighter-panel {
    background: rgba(19, 38, 125, 0.75);
    border: 1px solid var(--tatami-line);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
}
.fighter-panel2 {
    background: rgba(159, 0, 0, 0.75);
    border: 1px solid var(--tatami-line);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
}

.fighter-panel h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    margin: 0 0 6px;
}

.fighter-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4.5rem;
    line-height: 1;
    margin: 6px 0 18px;
}

.score-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-point {
    flex: 1;
    padding: 26px 8px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1.1rem;
    color: #14120f;
    transition: transform 0.08s ease;
}
.btn-point:active { transform: scale(0.96); }
.btn-point.orange { background: var(--point-orange); }
.btn-point.vert { background: var(--point-vert); color: #0e1a12; }
.btn-point:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-point .pt-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ---------- Jury ---------- */
.jury-panel {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.btn {
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--tatami-line);
    color: var(--gi);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
}
.btn.primary { background: var(--belt-red); }
.btn.penalty-orange { background: var(--point-orange); color: #14120f; }
.btn.penalty-vert { background: var(--point-vert); color: #0e1a12; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.setup-form {
    display: grid;
    gap: 12px;
    max-width: 420px;
}
.setup-form input {
    padding: 10px 12px;
    background: var(--ink);
    color: var(--gi);
    border: 1px solid var(--tatami-line);
    border-radius: var(--radius);
}
.setup-form label { font-size: 0.85rem; color: var(--gi-dim); }

.live-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
}
.vote-chip {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.vote-chip.orange { background: var(--point-orange); color: #14120f; }
.vote-chip.vert { background: var(--point-vert); color: #0e1a12; }

.rounds-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.rounds-table th, .rounds-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--tatami-line);
    text-align: center;
    font-size: 0.9rem;
}

.winner-banner {
    margin-top: 20px;
    padding: 24px;
    text-align: center;
    background: rgba(50, 200, 58, 0.15);
    border: 1px solid #1bc81a;
    border-radius: var(--radius);
}
.winner-banner .name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.6rem;
}

.texte-centre { text-align: center; }

.entete-jury {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

/* Boutons d'ajout de points (jury) */
.btn.add-orange { background: var(--point-orange); color: #14120f; }
.btn.add-vert { background: var(--point-vert); color: #0e1a12; }

/* Boutons de décision (K.O., malaise, victoire attribuée) */
.btn.decision {
    background: transparent;
    border: 1px solid var(--belt-red);
    color: var(--gi);
    font-size: 0.75rem;
}
.btn.decision:hover { background: rgba(200, 50, 58, 0.18); }

/* File d'attente des combats programmés */
.queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(18, 20, 15, 0.6);
    border: 1px solid var(--tatami-line);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

/* Badges de statut (historique) */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border: 1px solid var(--tatami-line);
}
.badge-ready { color: var(--gi-dim); border-color: var(--gi-dim); }
.badge-in_progress, .badge-round_over { color: var(--point-vert); border-color: var(--point-vert); }
.badge-finished { color: var(--gi); border-color: var(--gi); }

/* ---------- Affichage public ---------- */
.display-wrap {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.display-wrap .timer { font-size: 8rem; margin-bottom: 24px; }
.display-fighters {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}
.fighter-col {
    position: relative;
    flex: 1;
    max-width: 800px;
}
.display-fighter {
    border-radius: 14px;
    border: 2px solid var(--gi);
    padding: 24px 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.fighter-col:first-child .display-fighter { background: var(--corner-blue); }
.fighter-col:last-child .display-fighter { background: var(--belt-red); }
.display-fighter h2 { font-family: 'Bebas Neue', sans-serif; font-size: 4.2rem; margin: 0; color: var(--gi); }
.display-fighter .score { font-family: 'Bebas Neue', sans-serif; font-size: 22rem; line-height: 1; color: var(--gi); }
.vs { font-family: 'Bebas Neue', sans-serif; font-size: 4rem; color: var(--belt-red); align-self: center; margin-top: 60px; }

/* Grand drapeau affiché au-dessus du coin de chaque carte (en plus du petit à côté du nom) */
.fighter-flag-big {
    position: absolute;
    top: -34px;
    left: 24px;
    height: 48px;
    width: auto;
    border-radius: 4px;
    border: 3px solid var(--gi);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

/* ---------- Drapeaux, pénalités, pause (ajouts) ---------- */
.fighter-flag {
    height: 0.85em;
    width: auto;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(242, 237, 225, 0.25);
    margin-right: 6px;
}

.penalty-label {
    color: #ffd23f;
    font-weight: 700;
    min-height: 1em;
    margin-top: 4px;
}

.timer.paused {
    color: var(--point-orange);
    animation: pulse-pause 1.1s ease-in-out infinite;
}
@keyframes pulse-pause {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.btn#btnPause { background: var(--point-orange); color: #14120f; }
