/* Page Réservation : héros, bandeaux de rendez-vous, bouton d'entrée, barre de semaine, grille (colonne du jour,
 * vue « un jour à la fois » sur téléphone), légende et listes.
 * S'appuie sur home.css / saison.css (héros) et complète les règles de la grille de styles.css, qui servent aussi à
 * l'espace organisation. Chargée après styles.css : ses règles l'emportent à spécificité égale. */

/* ============ Héros : « Comment ça marche » ============ */
.res-steps { list-style: none; display: grid; gap: 12px; }
.res-steps li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 15px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
}
.res-step-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 0.85rem;
  background: rgba(255, 90, 31, 0.14); color: var(--accent); border: 1px solid rgba(255, 90, 31, 0.4);
}
.res-steps p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.res-steps a { color: var(--accent-2); }
.res-live { margin-top: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.res-live-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.res-live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: home-pulse 2s ease-out infinite;
}

/* ============ Rendez-vous à venir (tournoi, soirée événement) ============ */
.res-upcoming .panel {
  border-color: var(--accent); border-radius: 20px; padding: 26px 30px;
  background: linear-gradient(120deg, rgba(255, 90, 31, 0.14), rgba(34, 211, 238, 0.06) 70%), var(--surface);
  box-shadow: 0 24px 50px -34px rgba(255, 90, 31, 0.6);
}

/* ============ Barre « Rendez-vous à venir » et sa fenêtre ============ */
/* Une seule ligne sous « Réserver une session », quel que soit le nombre de rendez-vous : la liste s'ouvre dans la fenêtre. */
.rdv-bar {
  display: flex; align-items: center; gap: 14px; margin: -8px 0 28px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 14px;
}
.rdv-bar-ic {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(34, 211, 238, 0.12); color: var(--accent-2);
}
.rdv-bar-ic svg { width: 20px; height: 20px; }
.rdv-bar-text { flex: 1; min-width: 0; }
.rdv-bar-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: "Oxanium", sans-serif; font-size: 1rem; }
.rdv-bar-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rdv-chip {
  padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; line-height: 1.5; white-space: nowrap;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
}
.rdv-chip b { color: var(--text); font-weight: 600; }
.rdv-chip--ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.45); }
.rdv-chip--warn { color: #f2b13c; border-color: rgba(242, 177, 60, 0.5); }
.rdv-bar-btn { flex: none; }

.rdv-backdrop { align-items: center; }
.rdv-modal {
  max-width: 660px; padding: 0; display: flex; flex-direction: column; overflow: hidden;
  max-height: min(88vh, 800px);
}
.rdv-modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.rdv-modal-head h3 { margin: 0; font-size: 1.15rem; }
.rdv-close {
  flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.rdv-close:hover { border-color: var(--accent); }
.rdv-modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 22px; display: grid; gap: 22px; }
.rdv-group-h {
  margin: 0 0 10px; font-family: "Oxanium", sans-serif; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.rdv-list { display: grid; gap: 12px; }

/* Une carte par rendez-vous : pastille de date, titre, horaire, effectif et état de mon inscription, puis l'action. */
.rdv-card { padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.rdv-card-main { display: flex; align-items: flex-start; gap: 14px; }
.rdv-date {
  flex: none; width: 54px; padding: 7px 0 8px; display: grid; justify-items: center; gap: 3px; line-height: 1;
  border-radius: 12px; background: rgba(255, 90, 31, 0.14); border: 1px solid rgba(255, 90, 31, 0.4);
}
.rdv-date b { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--accent); }
.rdv-date i { font-style: normal; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rdv-card-info { flex: 1; min-width: 0; }
.rdv-card-title { margin: 0; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.rdv-card-when { margin: 3px 0 0; font-size: 0.88rem; color: var(--text); }
.rdv-card-count { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }
.rdv-tag {
  flex: none; padding: 2px 10px; border-radius: 999px; font-family: "Oxanium", sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.rdv-tag--ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.08); }
.rdv-tag--warn { color: #f2b13c; border-color: rgba(242, 177, 60, 0.55); background: rgba(242, 177, 60, 0.08); }
.rdv-tag--err { color: var(--bad); border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); }
.rdv-tag--alert { color: var(--accent); border-color: rgba(255, 90, 31, 0.6); background: rgba(255, 90, 31, 0.12); }
.rdv-card-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.rdv-card-action:empty { display: none; }
/* Les textes de tournament-event.js portent des marges en ligne (utiles dans le bandeau de la page Tournoi) : ici c'est le « gap » qui espace. */
.rdv-card-action > * { margin-top: 0 !important; }
.rdv-card-action > p, .rdv-card-action > form { flex: 1 1 100%; }
.rdv-note, .rdv-card-action .section-note { margin: 0; font-size: 0.88rem; color: var(--muted); }
.rdv-note a, .rdv-card-action a { color: var(--accent-2); }
.rdv-card .form-msg { min-height: 0; margin-top: 0; }
.rdv-card .form-msg:not(:empty) { margin-top: 10px; }

@media (max-width: 760px) {
  /* Icône + titre sur une ligne, pastilles sur toute la largeur dessous, puis le bouton : « display: contents » rend le titre
     et les pastilles indépendants dans la grille de la barre. */
  .rdv-bar { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px 12px; margin-top: -10px; }
  .rdv-bar-text { display: contents; }
  .rdv-bar-title { grid-column: 2; grid-row: 1; }
  .rdv-bar-chips { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .rdv-bar-btn { grid-column: 1 / -1; grid-row: 3; justify-content: center; }
}
@media (max-width: 640px) {
  /* Fenêtre collée au bas de l'écran, comme les confirmations. */
  .rdv-backdrop { padding: 0; align-items: flex-end; }
  .rdv-modal { max-width: none; margin: 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .rdv-modal-body { padding: 16px 16px 24px; }
  .rdv-card { padding: 12px 12px; }
  /* La pastille d'état passe sous le titre plutôt que d'écraser le texte. */
  .rdv-card-main { flex-wrap: wrap; gap: 8px 11px; }
  .rdv-date { width: 48px; }
  .rdv-card-info { flex: 1 1 calc(100% - 60px); }
  .rdv-card-main > .rdv-tag { margin-left: 59px; }
}

/* ============ Bouton d'entrée « Réserver une session » ============ */
.res-main { padding-top: 56px; }
.res-entry { display: block; margin: 0 0 28px; }
.res-entry-card {
  padding: 20px 24px; border-radius: 18px; gap: 18px; border-color: var(--accent);
  background: linear-gradient(110deg, rgba(255, 90, 31, 0.2), rgba(34, 211, 238, 0.07) 80%), var(--surface);
  box-shadow: 0 22px 44px -30px rgba(255, 90, 31, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.res-entry-ic { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 90, 31, 0.2); }
.res-entry-ic svg { width: 26px; height: 26px; }
.res-entry-text strong { font-size: 1.15rem; }
.res-entry-desc { font-size: 0.9rem; margin-top: 3px; }
.res-entry-go {
  margin-left: auto; flex: none; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1;
  color: var(--accent); transition: transform 0.2s ease;
}

/* Assistant : une couleur par mode, comme sur l'accueil (orange Shootout, cyan Capture the Base, ambre Sabotage). */
.wizard-choice[data-pick-mode="2v2"], .wizard-choice[data-pick-mode="capture"], .wizard-choice[data-pick-mode="sabotage"] { border-left-width: 3px; }
.wizard-choice[data-pick-mode="2v2"] { --wc: var(--accent); --wc-soft: rgba(255, 90, 31, 0.14); border-left-color: var(--accent); }
.wizard-choice[data-pick-mode="capture"] { --wc: var(--accent-2); --wc-soft: rgba(34, 211, 238, 0.14); border-left-color: var(--accent-2); }
.wizard-choice[data-pick-mode="sabotage"] { --wc: #f2b13c; --wc-soft: rgba(242, 177, 60, 0.14); border-left-color: #f2b13c; }
.wizard-choice[data-pick-mode] .wizard-choice-ic { background: var(--wc-soft); color: var(--wc); }

/* ============ Barre de semaine ============ */
.week-nav { margin: 8px 0 14px; gap: 14px; }
.week-nav h2 { font-size: 1.1rem; text-align: center; }
.week-nav button { padding: 9px 16px; border-radius: 12px; transition: border-color 0.15s ease, background 0.15s ease; }
.week-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.week-nav button:disabled:hover { border-color: var(--border); }
.week-nav-mid { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.week-nav .week-today { padding: 3px 12px; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.08); }
.week-nav .week-today:disabled { color: var(--muted); border-color: var(--border); background: transparent; }

/* Rangée des jours (téléphone seulement) */
.day-tabs { display: none; }

/* ============ Grille ============ */
.slot-grid-wrap { border-radius: 18px; box-shadow: 0 30px 60px -44px rgba(0, 0, 0, 0.9); }
.slot-grid .gh { padding: 12px 5px; }
.slot-grid .gh.gh--today { color: var(--accent); }
.slot-grid .gh.gh--today small { color: var(--accent); opacity: 0.85; }
.slot-grid .gh.gh--today::after {
  content: "Aujourd'hui"; display: block; margin: 5px auto 0; width: max-content; padding: 2px 8px; border-radius: 999px;
  font-size: 0.56rem; letter-spacing: 0.08em; background: rgba(255, 90, 31, 0.16); color: var(--accent);
}
/* Colonne du jour : léger voile orange sur tous les créneaux (les sept jours = colonnes 2 à 8 de chaque ligne de 8). */
.slot-grid[data-today="0"] > div:nth-child(8n+2), .slot-grid[data-today="1"] > div:nth-child(8n+3),
.slot-grid[data-today="2"] > div:nth-child(8n+4), .slot-grid[data-today="3"] > div:nth-child(8n+5),
.slot-grid[data-today="4"] > div:nth-child(8n+6), .slot-grid[data-today="5"] > div:nth-child(8n+7),
.slot-grid[data-today="6"] > div:nth-child(8n+8) { background: rgba(255, 90, 31, 0.035); }
.slot { border-radius: 10px; transition: filter 0.15s ease, transform 0.15s ease; }
.slot--mine { box-shadow: 0 0 0 1px var(--accent) inset, 0 0 18px -8px var(--accent); }

/* Légende : pastilles dans un cadre, avec les mêmes couleurs que les cellules. */
.grid-legend {
  margin-top: 16px; padding: 12px 16px; gap: 8px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.grid-legend-dot { width: 9px; height: 9px; }
.grid-legend-dot--open { background: #34d399; box-shadow: 0 0 6px #34d399; }
.grid-legend-dot--filling { background: #f2c94c; box-shadow: 0 0 6px #f2c94c; }
.grid-legend-dot--confirmed { background: #f87171; box-shadow: 0 0 6px #f87171; }
.grid-legend-dot--mine { background: transparent; border: 2px solid var(--accent); }
.grid-legend-dot--closed { background: var(--muted); opacity: 0.6; }

/* ============ Listes (« Mes créneaux », « Demandes de match reçues ») et note ============ */
.res-h { display: flex; align-items: center; gap: 10px; margin: 34px 0 0; font-size: 1.15rem; }
.res-h::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.res-list { margin-top: 14px; }
.res-list li { border-radius: 14px; padding: 14px 18px; }
.res-note {
  margin-top: 30px; padding: 14px 18px; color: var(--muted); font-size: 0.9rem;
  border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 12px; background: var(--surface);
}
.res-note strong { color: var(--text); }

@media (hover: hover) {
  .res-entry-card:hover { transform: translateY(-3px); box-shadow: 0 28px 50px -30px rgba(255, 90, 31, 0.85); }
  .res-entry-card:hover .res-entry-go { transform: translateX(5px); }
  .week-nav button:not(:disabled):hover { background: var(--bg-alt); }
}

/* ============ Tablette et téléphone ============ */
@media (max-width: 960px) {
  .res-hero { padding-bottom: 52px; }
}
@media (max-width: 760px) {
  .week-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .week-nav-mid { grid-column: 1 / -1; grid-row: 1; }
  .week-nav button#prevWeek { grid-row: 2; grid-column: 1; }
  .week-nav button#nextWeek { grid-row: 2; grid-column: 2; }
  .week-nav button { padding: 9px 8px; font-size: 0.8rem; }

  /* Un jour à la fois : la colonne des heures + la colonne du jour choisi (attribut data-day posé par reservation.js). */
  .day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
  .day-tab {
    position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 2px 7px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--muted); font: inherit;
  }
  .day-tab span { font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .day-tab strong { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--text); }
  .day-tab--today span { color: var(--accent); }
  .day-tab--active { border-color: var(--accent); background: rgba(255, 90, 31, 0.12); }
  .day-tab--active span { color: var(--accent); }
  .day-tab-n {
    position: absolute; top: -6px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    display: grid; place-items: center; font-style: normal; font-size: 0.62rem; font-weight: 700;
    background: #34d399; color: #07130e;
  }

  .slot-grid-wrap { overflow-x: visible; }
  .slot-grid { min-width: 0; grid-template-columns: 56px minmax(0, 1fr); }
  .slot-grid[data-day="0"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+2)),
  .slot-grid[data-day="1"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+3)),
  .slot-grid[data-day="2"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+4)),
  .slot-grid[data-day="3"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+5)),
  .slot-grid[data-day="4"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+6)),
  .slot-grid[data-day="5"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+7)),
  .slot-grid[data-day="6"] > div:not(:nth-child(8n+1)):not(:nth-child(8n+8)) { display: none; }
  .slot-grid .gh.gh--today::after { display: none; }
  .slot { min-height: 70px; }
  .res-entry-card { padding: 16px 16px; gap: 14px; }
  .res-entry-ic { width: 46px; height: 46px; }
  .res-upcoming .panel { padding: 22px 20px; }
}
@media (max-width: 420px) {
  .res-entry-go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .res-live-dot::after { animation: none !important; }
  .res-entry-card, .slot, .res-entry-go { transition: none !important; }
}

/* Modes de jeu fermés à la réservation : encadré d'explication en haut de page + mode grisé dans l'assistant. */
.gm-notice { border-color: rgba(242, 177, 60, 0.6); background: linear-gradient(160deg, rgba(242, 177, 60, 0.1), transparent 70%), var(--surface); }
.gm-notice-title { margin: 0 0 8px; font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 1.05rem; color: #f2b13c; }
.gm-notice ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gm-notice li { color: var(--text); font-size: 0.95rem; line-height: 1.45; }
.gm-notice li strong { color: #f2b13c; }
.wizard-choice.is-off { border-left-color: var(--border) !important; }
.wizard-choice.is-off .wizard-choice-ic { background: rgba(255, 255, 255, 0.05) !important; color: var(--muted) !important; }
.wizard-choice-off { display: block; margin-top: 4px; color: #f2b13c; font-size: 0.82rem; line-height: 1.35; }
.msg-badge.gm-off { white-space: normal; }
/* Mode fermé : le bouton reste lisible (pas de « disabled » natif qui grise aussi l'explication), seul le reste est atténué. */
.wizard-choice.is-off { cursor: not-allowed; }
.wizard-choice.is-off:hover { border-color: var(--border); background: var(--bg); }
.wizard-choice.is-off .wizard-choice-ic, .wizard-choice.is-off .wizard-choice-text strong,
.wizard-choice.is-off .wizard-choice-text > span:not(.wizard-choice-off) { opacity: 0.5; }
.wizard-choice-text .wizard-choice-off { display: block; margin-top: 4px; color: #f2b13c; font-size: 0.82rem; line-height: 1.35; opacity: 1; }

/* « Comment ça marche » : repliable (ouvert sur ordinateur, fermé sur téléphone par reservation.js). */
.res-how > summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; cursor: pointer; list-style: none; }
.res-how > summary::-webkit-details-marker { display: none; }
.res-how > summary::after { content: "▾"; color: var(--accent-2); font-size: 0.9rem; transition: transform 0.15s ease; }
.res-how[open] > summary { margin-bottom: 16px; }
.res-how:not([open]) > summary::after { transform: rotate(-90deg); }
@media (max-width: 760px) {
  .res-hero { padding-top: 40px; padding-bottom: 36px; }
  .res-hero .home-actions { margin-top: 22px; }
}
