/* ============================================
    TOURNOIS R5 — Design Industriel/Sportif
    Mobile-first | High Contrast | Outdoor Ready
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@400;500;600&display=swap');

/* ── Variables ── */
:root {
    --bg:          #0f1117;
    --bg-card:     #1a1d27;
    --bg-card2:    #222636;
    --border:      #2e3348;
    --orange:      #ff6b1a;
    --orange-dark: #cc4f0d;
    --orange-glow: rgba(255, 107, 26, 0.15);
    --text:        #f0f2f8;
    --text-muted:  #8890aa;
    --green:       #2ecc71;
    --red:         #e74c3c;
    --blue:        #3498db;
    --gold:        #f1c40f;
    --radius:      10px;
    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --shadow-orange: 0 4px 20px rgba(255, 107, 26, 0.25);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CANVAS TERRAIN ── */
#field-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.35;
}

/* Canvas Ballon animé  */
#ballon-canvas{
    position: relative;
    width: 25%;
    height: 25%;
    z-index: 1;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Barlow', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(255,107,26,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(52,152,219,0.04) 0%, transparent 50%);
}

/* ── Header ── */
header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--orange);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    z-index: 2;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

header h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    margin-top: 8px;
}

header h1 span {
    color: var(--orange);
}

header a {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.3rem 0.3rem 0.3rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
    
}

header a:hover {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--orange-glow);
}

header div {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
img{
    height: 40px;
    pointer-events: none; 
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ── Main Layout ── */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 1;
}

.btn-live {
    width: auto;
    padding: 0.5rem 1.25rem;
    background-color:var(--orange) ;
    color: var(--text);
}

/* ── Typography ── */
h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--orange);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.6rem;
    background: var(--orange);
    border-radius: 2px;
}

h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--orange);
    margin: 1.5rem 0 0.75rem;
    text-align: center;
}

h4 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    text-align: center;
}

p {
    margin-bottom: 0.75rem;
    color: var(--text);
}

strong {
    color: var(--orange);
    font-weight: 600;
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: var(--text); }

/* ── Cards / Sections ── */
section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.date{
    font-size:1.5rem ;
}

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
}

thead {
    background: var(--orange);
    color: #fff;
}

thead th {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.65rem 0.75rem;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-card2); }

/* tbody tr:first-child td:last-child::after {
    content: ' 🥇';
} */

td {
    padding: 0.6rem 0.75rem;
    color: var(--text);
    background: var(--bg-card);
}

td:first-child {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Points column highlight */
td:last-child {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--orange);
}

/* ── Forms ── */
form {
    display: flex;
    /* flex-wrap: wrap; */
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-direction: column;
}

label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
    width: 100%;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    background: var(--bg-card2);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    padding: 0.55rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
    flex: 1;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
}

input[type="number"] {
    width: 100px;
    flex: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

select {
    cursor: pointer;
    flex: none;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

input[type="radio"] {
    accent-color: var(--orange);
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

input[type="checkbox"] {
    accent-color: var(--orange);
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

/* ── Buttons ── */
button,
.btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Primary — Orange */
button[type="submit"],
button:not([class]) {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255,107,26,0.3);
    width: 50%;
}

button[type="submit"]:hover,
button:not([class]):hover {
    background: var(--orange-dark);
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}

button[type="submit"]:active,
button:not([class]):active {
    transform: translateY(0);
}

button[name="supprimer_operateur"]{
    width :70%;
}

/* Danger — Red (supprimer, forfait) */
button[name="supprimer_operateur"],
button[name="supprimer_id"],
button[name="forfait_e1"],
button[name="forfait_e2"],button.suprim-equ {
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
    box-shadow: none;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

button[name="supprimer_operateur"]:hover,
button[name="forfait_e1"]:hover,
button[name="forfait_e2"]:hover,
button.suprim-equ:hover {
    background: rgba(231, 76, 60, 0.15);
    transform: translateY(-1px);
}

/* Terminer tournoi — special */
button[name="terminer_tournoi"],
button[name="terminer_tournoi_sans_finale"],
button[name="terminer_poules"] ,
button[name="nouvelle_phase_poules"]{
    background: var(--bg-card2);
    color: var(--text);
    border: 1.5px solid var(--border);
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

button[name="terminer_tournoi"]:hover,
button[name="terminer_tournoi_sans_finale"]:hover,
button[name="terminer_poules"]:hover,
button[name="nouvelle_phase_poules"]:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-glow);
}

/* Config buttons (nb_qualifies) */
button[name="nb_qualifies"],
button[name="choisir_poules"] {
    background: var(--bg-card2);
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

button[name="nb_qualifies"]:hover,
button[name="choisir_poules"]:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-glow);
    transform: translateY(-1px);
}

/* ── Match Cards ── */
.match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    transition: border-color 0.2s;
    justify-content: center;
}

.match:hover { border-color: var(--orange); }

.match > span:first-of-type,
.match > span:last-of-type {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    min-width: 80px;
}

.match > span:nth-of-type(2) {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0;
}

/* Score display (terminated match) */
.match > span:only-child,
.match .score {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 2px;
}

/* ── Phase Finale Config ── */
.config-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.config-section p {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ── Classement Final ── */
.classement-final {
    background: var(--bg-card);
    border: 1px solid var(--orange);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-orange);
}

.classement-final p {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.classement-final p:last-child { border-bottom: none; }

.classement-final .vainqueur {
    color: var(--gold);
    font-size: 1.2rem;
}

/* ── Login / Auth Pages ── */
.auth-wrapper , .form-wrapper {
    max-width: 420px;
    margin: auto;
}

.auth-wrapper form ,.form-wrapper form {
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    gap: 0.75rem;
}

.auth-wrapper form input ,.form-wrapper form input , select{
    width: 100%;
    flex: none;
}

.auth-wrapper form button ,.form-wrapper form button  {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ── Dashboard ── */
.dashboard-grid {
    display: grid;
    gap: 1.25rem;
}

/* ── Error / Alert ── */
.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--red);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: var(--red);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* ── Lieu info bar ── */
.lieu-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.versus, .score {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    font-size: 20px;
}

.match form {
    margin:auto;
    width: 100%;
}

.pt-finale{
    flex-direction: column;
}

/* ── Responsive ── */
@media (max-width: 768px) {

    .match > span.prolongations {
        width: 100% !important;
        min-width: 0 !important;
        text-align: center !important;
        display: block !important;
    }

    #field-canvas{
        display: none;
    }
    
    main {
        padding: 1rem 0.75rem;
        flex-direction: column;
    }
    form{
        flex-direction: column;
    }

    h2 { 
        font-size: 1.4rem; 
    }

    table { 
        font-size: 0.78rem; 
    }

    thead th { 
        padding: 0.5rem 0.5rem; 
    }

    td { 
        padding: 0.5rem 0.5rem; 
    }

    /* .radio{
        display: flex;
        justify-content: space-between;
        width: 40%;
        margin-bottom: 2em;
    } */

    .hide-mobile { 
        display: none; 
    }

    .match {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .versus, .score {
        display: flex;
        gap: 1rem;
        width: 100%;
        justify-content: center;
        font-size: 20px;
    }

    


    input[type="number"] {
        width: 100px;
    }

    button[type="submit"],
    button:not([class]) {
        font-size: 0.85rem;
        padding: 0.55rem 1rem;
    }

    header h1 { 
        font-size: 1.3rem; 
    }
}

@media (max-width: 400px) {

    #field-canvas{
        display: none;
    }

    table { 
        font-size: 0.72rem; 
    }
    thead th { 
        padding: 0.4rem 0.35rem; 
        letter-spacing: 0; 
    }
    td { 
        padding: 0.4rem 0.35rem; 
    }

    button[type="submit"],
    button:not([class]) {
        width: 80%;
    }
    
}


/* ============================================================
   AJOUTS JS — Modal + Tabs
   À coller à la fin de style.css
   ============================================================ */

/* ── Modal double confirmation ── */
#r5-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
    animation: r5-fade-in 0.15s ease;
}

#r5-modal-overlay[hidden] {
    display: none;
}

@keyframes r5-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#r5-modal {
    background: var(--bg-card);
    border: 1px solid var(--orange);
    border-radius: var(--radius);
    box-shadow: var(--shadow-orange);
    padding: 1.75rem 2rem;
    max-width: 380px;
    width: 90%;
    animation: r5-slide-up 0.18s ease;
}

@keyframes r5-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#r5-modal-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.r5-modal-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    font-family: 'Barlow Condensed', sans-serif;
    color: var(--text);
    font-size: 1rem;
    text-align: center;
}

.r5-modal-score strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 2px;
}

.r5-modal-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

#r5-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

#r5-modal-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
}

#r5-modal-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

#r5-modal-confirm {
    background: var(--orange);
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255,107,26,0.3);
    transition: all 0.2s;
    width: auto;
}

#r5-modal-confirm:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
}

/* ── Tabs poules ── */
#r5-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    margin-top: 2rem;
}

#r5-tabs button {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1.1rem;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
    /* reset des overrides génériques */
    width: auto;
    box-shadow: none;
}

#r5-tabs button:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-glow);
    transform: translateY(1px);
}

#r5-tabs button.r5-tab-active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
    box-shadow: 0 2px 10px rgba(255,107,26,0.3);
}

#r5-tabs button.r5-tab-active:hover {
    background: var(--orange-dark);
    transform: none;
}

/* ── Modal — variante danger (suppression, forfait) ── */
#r5-modal-confirm[data-danger="true"] {
    background: var(--red);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

#r5-modal-confirm[data-danger="true"]:hover {
    background: #c0392b;
}

/* Message texte simple dans le modal */
.r5-modal-message {
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    color: var(--text);
    padding: 0.25rem 0;
}

.r5-modal-message strong {
    color: var(--red);
}

/* ── Modal — liste équipes (démarrage tournoi) ── */
.r5-modal-message--sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

.r5-modal-liste {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card2);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.r5-modal-liste li {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.r5-modal-liste li:last-child {
    border-bottom: none;
}

.r5-modal-liste li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Prolongations badge ── */
.prolongations {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    
}