/* ============================================================
   LIGUE 042 — Basketball Challenge
   Thème clair : parquet, craie, terre cuite.
   ============================================================ */

:root {
  --bg:         #f6efe6;
  --surface:    #ffffff;
  --surface-2:  #fbf5ec;
  --ink:        #221a14;
  --muted:      #7a6a5c;
  --line:       rgba(34, 26, 20, .12);
  --line-2:     rgba(34, 26, 20, .22);
  --accent:     #d9622b;
  --accent-2:   #ef7a3c;
  --amber:      #c98a2b;
  --success:    #2f8f63;
  --danger:     #b8453c;
  --radius:     12px;
  --shadow:     0 10px 30px rgba(60, 40, 25, .10);
  --shadow-lg:  0 18px 44px rgba(60, 40, 25, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .mode-name, .loading-title, .brand-text strong {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}

button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.tiny-note { color: var(--muted); font-size: 10px; margin: 0; }

/* ============================================================
   ÉCRAN DE CHARGEMENT
   ============================================================ */

.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 115%, rgba(217, 98, 43, .16), transparent 55%),
    linear-gradient(160deg, #fff7ec 0%, #f7ecdd 55%, #f0e1cf 100%);
  overflow: hidden;
}

.loading-glow {
  position: absolute;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 98, 43, .18), transparent 66%);
  filter: blur(10px);
}

.loading-inner {
  position: relative;
  text-align: center;
  padding: 24px;
  opacity: 0;
  animation: fadeIn .5s ease .1s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.logo-badge {
  width: 132px;
  height: 132px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(60, 40, 25, .18);
  display: grid;
  place-items: center;
}

.logo-badge img { width: 100%; height: 100%; border-radius: 50%; display: block; }

.loading-title {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
}

.loading-sub {
  margin: 12px 0 34px;
  font-size: 10px;
  letter-spacing: .38em;
  color: var(--muted);
  text-transform: uppercase;
}

.loading-bar {
  width: min(280px, 76vw);
  height: 3px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: rgba(34, 26, 20, .12);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--accent);
  transition: width .12s linear;
}

.loading-meta {
  width: min(280px, 76vw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
}

.loading-foot {
  position: absolute;
  bottom: 26px;
  font-size: 9px;
  letter-spacing: .24em;
  color: rgba(34, 26, 20, .4);
}

/* ============================================================
   STRUCTURE GÉNÉRALE
   ============================================================ */

.app {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    /* arc à 3 points */
    radial-gradient(circle at 50% 122%, transparent 0 320px, rgba(217, 98, 43, .12) 321px 325px, transparent 326px),
    radial-gradient(circle at 50% 122%, transparent 0 520px, rgba(217, 98, 43, .08) 521px 525px, transparent 526px),
    /* ballon en filigrane */
    radial-gradient(circle at 94% 4%, rgba(217, 98, 43, .10) 0 96px, transparent 97px),
    /* texture parquet */
    repeating-linear-gradient(115deg, rgba(34, 26, 20, .018) 0 2px, transparent 2px 28px);
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(14px, 4vw, 36px);
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  color: var(--ink);
  padding: 0;
}

.brand-logo { width: 38px; height: 38px; border-radius: 50%; display: block; }

.brand-text { display: flex; flex-direction: column; align-items: flex-start; }
.brand-text strong { font-size: 15px; letter-spacing: .02em; }
.brand-text small { font-size: 8px; letter-spacing: .26em; color: var(--muted); }

.player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.player-chip:hover { border-color: var(--line-2); box-shadow: var(--shadow); }

.player-chip canvas {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f3e9dc;
}

.player-chip-txt { display: flex; flex-direction: column; align-items: flex-start; }
.player-chip-txt small { font-size: 8px; letter-spacing: .18em; color: var(--muted); }
.player-chip-txt strong { font-size: 12px; font-weight: 600; }

.stage { padding: clamp(20px, 3vw, 40px); max-width: 1200px; margin: 0 auto; }

/* ============================================================
   ACCUEIL
   ============================================================ */

.home-head { margin-bottom: 24px; }

.home-head h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
}

.lead { color: var(--muted); margin: 10px 0 0; max-width: 620px; font-size: 14px; }

.home-grid { display: flex; flex-direction: column; gap: 20px; }

.section-title {
  margin: 4px 0 -8px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 800;
}

.section-sub {
  margin: -14px 0 -6px;
  font-size: 12px;
  color: var(--muted);
}

/* --- athlète --- */
.char-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.char-bar-avatar {
  position: relative;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  background: #f3e9dc;
}

.char-bar-avatar canvas { width: 100%; height: 100%; display: block; }

.char-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, .8);
}

.char-bar-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.char-bar-info p { margin: 0; }
.char-bar-info strong { font-size: 14px; font-weight: 700; }
.char-bar-info span { font-size: 12px; color: var(--muted); }

.char-bar-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* --- cartes de jeu --- */
.modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.mode-card {
  flex: 1 1 280px;
  max-width: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 20px 20px;
  min-height: 250px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-card, var(--accent));
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.mode-3pt { --accent-card: #d9622b; }
.mode-dribble { --accent-card: #b8453c; }
.mode-dunk { --accent-card: #2f2a26; }
.mode-buzzer { --accent-card: #c98a2b; }
.mode-gage { --accent-card: #2f8f63; }
.mode-lucky { --accent-card: #7a5bd6; }
.mode-bank { --accent-card: #c98a2b; }

/* panneaux de la banque */
.bk-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
  width: min(560px, 92%);
  padding: 22px;
  border-radius: 14px;
  background: rgba(255, 252, 246, .97);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
  text-align: center;
  color: var(--ink);
}

.bk-panel h3 {
  font-size: clamp(18px, 2.4vw, 24px);
  text-transform: uppercase;
  margin: 4px 0 10px;
}

.bk-panel .kicker { color: var(--accent); }

.bk-row {
  justify-content: center;
  margin-top: 12px;
}

.bk-row .btn {
  width: auto;
  min-width: 108px;
}

.mode-card:not(.locked):hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.mode-card.locked { opacity: .55; cursor: not-allowed; }

.mode-badge {
  font-size: 9px;
  letter-spacing: .2em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.mode-icon { display: block; width: 44px; height: 44px; color: var(--accent-card, var(--accent)); }
.mode-icon svg { width: 100%; height: 100%; }

.mode-name { font-size: 18px; line-height: 1.15; font-weight: 800; }
.mode-desc { font-size: 12px; color: var(--muted); }

.mode-play {
  margin-top: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent-card, var(--accent));
}

/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  transition: background .18s, border-color .18s, box-shadow .18s;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 16px rgba(217, 98, 43, .28);
  width: 100%;
}
.btn-primary:hover { background: var(--accent-2); }

.btn-compact { width: auto; padding: 10px 18px; white-space: nowrap; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.btn-notice:hover { border-color: var(--accent); color: var(--accent); }
.btn-notice span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
}

.btn-quit {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(184, 69, 60, .4);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.btn-quit:hover { background: rgba(184, 69, 60, .08); }

.btn-restart {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.btn-restart:hover { background: rgba(217, 98, 43, .09); }

.game-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   CRÉATEUR DE JOUEUR
   ============================================================ */

.creator-head { margin-bottom: 20px; }
.creator-head h2 {
  font-size: clamp(22px, 3vw, 32px);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
}

.creator-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.creator-preview {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 112%, rgba(217, 98, 43, .14), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  position: sticky;
  top: 78px;
}

.creator-preview canvas { width: 100%; height: auto; display: block; }

.preview-name {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
}

.creator-options { display: flex; flex-direction: column; gap: 16px; }

.opt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.opt legend {
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 700;
}

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

.swatch, .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  transition: border-color .18s, background .18s;
}

.swatch:hover, .pill:hover { border-color: var(--line-2); background: #f6ece0; }

.swatch.active, .pill.active {
  border-color: var(--accent);
  background: rgba(217, 98, 43, .1);
}

.swatch.disabled { opacity: .35; }

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(34, 26, 20, .25);
}

.teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  transition: border-color .18s, background .18s;
}
.team:hover { border-color: var(--line-2); }
.team.active { border-color: var(--accent); background: rgba(217, 98, 43, .08); }

.jersey {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  border-radius: 6px 6px 8px 8px;
  background: var(--c);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18);
}

.team-txt { display: flex; flex-direction: column; overflow: hidden; }
.team-txt strong { font-size: 12px; letter-spacing: .02em; }
.team-txt small { font-size: 10px; color: var(--muted); }

/* --- curseurs de taille --- */
.sizes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.size {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.size output { font-weight: 700; color: var(--ink); font-size: 11px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.creator-actions { display: flex; gap: 12px; align-items: center; }
.creator-actions .btn-primary { width: auto; flex: 1; }

/* ============================================================
   JEU
   ============================================================ */

.game { display: flex; flex-direction: column; gap: 14px; }

.game-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }

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

.hud-box {
  min-width: 84px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.hud-box small { font-size: 8px; letter-spacing: .18em; color: var(--muted); }
.hud-box strong { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

/* score de match : plus gros */
.hud-match { min-width: 128px; }
.hud-match strong {
  font-size: 26px;
  letter-spacing: .01em;
  color: var(--ink);
}

.hud-box:nth-child(3) strong { color: var(--success); }

/* --- jauge de sprint --- */
.hud-sprint { min-width: 140px; }
.hud-sprint small { display: flex; justify-content: space-between; gap: 8px; }
.hud-sprint small span { color: var(--ink); font-weight: 700; }

.sprint-bar {
  margin-top: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(34, 26, 20, .12);
  overflow: hidden;
}

.sprint-bar span {
  display: block;
  height: 100%;
  width: 60%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), var(--accent));
  transition: width .15s linear;
}

.canvas-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: #0b0b0c;
}

.canvas-wrap canvas { display: block; width: 100%; height: auto; }

.game-msg {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(16, 12, 9, .88);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff9ef;
  font-size: 10px;
  letter-spacing: .14em;
  white-space: nowrap;
  pointer-events: none;
}
.game-msg b { color: #ffb37f; }

.go-overlay, .end-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 9, 6, .78);
  color: #fff9ef;
  animation: fadeIn2 .2s ease both;
}

@keyframes fadeIn2 {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.go-overlay span {
  font-size: clamp(44px, 10vw, 96px);
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff9ef;
  animation: goZoom .9s ease both;
}

@keyframes goZoom {
  0%   { transform: scale(.7); opacity: 0; }
  30%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.02); opacity: 0; }
}

.end-overlay {
  background: rgba(12, 9, 6, .94);
  text-align: center;
  padding: 20px;
  overflow-y: auto;
}
.end-overlay h2 { font-size: clamp(26px, 4vw, 42px); text-transform: uppercase; letter-spacing: .02em; color: #fff9ef; }
.end-overlay .kicker { color: #e2b48f; }

.end-stats {
  display: flex;
  justify-content: center;
  gap: 44px;
  margin: 20px 0 24px;
}
.end-stats div { display: flex; flex-direction: column; }
.end-stats small { font-size: 9px; letter-spacing: .2em; color: #c9a98f; }
.end-stats strong { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff9ef; }

.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.end-actions .btn { width: auto; min-width: 150px; }

.game-help {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.game-help b { color: var(--ink); }

/* ============================================================
   DUNK CONTEST
   ============================================================ */

.dunk-panel {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(540px, 92%);
  max-height: calc(100% - 40px);
  overflow: auto;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: rgba(255, 252, 246, .97);
  border: 1px solid rgba(34, 26, 20, .12);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  color: var(--ink);
}

.dunk-panel-wide { width: min(760px, 94%); }

.dunk-panel .kicker { color: var(--accent); }

.dunk-panel h3 {
  font-size: clamp(18px, 2.4vw, 24px);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin: 4px 0 8px;
  color: var(--ink);
}

.dunk-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.dunk-sub b { color: var(--ink); }

.dunk-hits { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 6px 0; }
.dunk-hits strong {
  font-size: 46px;
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.dunk-hits span {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.dunk-meter {
  height: 6px;
  border-radius: 99px;
  background: rgba(34, 26, 20, .12);
  overflow: hidden;
  margin: 10px 0 6px;
}
.dunk-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--accent));
  transition: width .08s linear;
}

.dunk-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  text-align: left;
  margin-top: 10px;
}

.dunk-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.key-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.key-btn b {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(34, 26, 20, .07);
  color: var(--accent);
  font-size: 10px;
}

.key-btn:hover { border-color: var(--line-2); }

.key-btn.active {
  background: rgba(217, 98, 43, .1);
  border-color: var(--accent);
}

.dunk-selected { border-left: 1px solid var(--line); padding-left: 18px; }
.dunk-selected .kicker { color: var(--muted); }

.moves { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }

.move {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(217, 98, 43, .1);
  border: 1px solid rgba(217, 98, 43, .35);
  font-size: 11px;
  color: var(--ink);
}
.move b { color: var(--accent); margin-right: 4px; }

.move-empty { color: var(--muted); font-size: 12px; font-style: italic; }

.dunk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
.dunk-actions .btn { width: auto; flex: 1; }

.dunk-timer { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dunk-timer b { color: var(--ink); font-size: 15px; }

/* --- résultat du dunk (sur le canvas sombre) --- */
.dunk-total {
  font-size: 16px;
  color: #d9bda6;
  margin: 4px 0 14px;
  font-weight: 600;
}
.dunk-total strong { font-size: 40px; color: #fff9ef; font-weight: 800; }

.dunk-score {
  list-style: none;
  margin: 0 auto 16px;
  padding: 0;
  width: min(320px, 100%);
  display: grid;
  gap: 5px;
}
.dunk-score li {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #f3e6d8;
}
.dunk-score b { color: #fff9ef; font-variant-numeric: tabular-nums; }

.dunk-history { width: min(360px, 100%); margin: 0 auto 16px; text-align: left; }
.dunk-history .kicker { text-align: center; color: #e2b48f; }

.dunk-history ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 112px;
  overflow-y: auto;
}

.dunk-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
}

.dunk-history li span {
  color: #f3e6d8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dunk-history li b { color: #fff9ef; font-variant-numeric: tabular-nums; }

/* --- classement (fenêtre claire) --- */
.rank-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
}

.rank-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
}

.rank-list li span { color: var(--ink); }
.rank-list li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-list li.top { border-color: var(--accent); background: rgba(217, 98, 43, .1); }

.pulse { animation: softPulse .18s ease; }
@keyframes softPulse {
  0%   { opacity: 1; }
  50%  { opacity: .86; }
  100% { opacity: 1; }
}

.pop { animation: softPop .24s ease both; }
@keyframes softPop {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: scale(1); }
}

/* panneau de gage */
.gage-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
  width: min(520px, 90%);
  padding: 24px;
  border-radius: 14px;
  background: rgba(255, 252, 246, .97);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
  text-align: center;
  color: var(--ink);
}

.gage-panel h3 {
  font-size: clamp(20px, 2.6vw, 28px);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin: 4px 0 10px;
}

.gage-panel .kicker { color: var(--accent); }

.gage-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 10px;
}

.gage-panel .dunk-actions { margin-top: 10px; }

/* réglage du nombre de joueurs */
.gage-setup {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  margin: 0 auto;
  width: min(520px, 92%);
  padding: 16px 22px 14px;
  border-radius: 12px;
  background: rgba(255, 252, 246, .96);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  text-align: center;
  color: var(--ink);
}

.gage-setup .kicker { color: var(--accent); }

.gage-count {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 8px;
}

.gage-count input { flex: 1; }

.gage-count output {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  min-width: 76px;
  text-align: left;
}

.gage-names { display: grid; gap: 6px; margin: 10px 0 8px; }

.gage-names + .btn-primary { margin-bottom: 8px; }

.gage-name { display: flex; align-items: center; gap: 10px; }

.gage-name span {
  width: 26px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.gage-name input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

.gage-name input:focus { outline: none; border-color: var(--accent); }

/* ============================================================
   MODALES
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(40, 28, 18, .45);
  backdrop-filter: blur(5px);
  animation: fadeIn2 .2s ease both;
}

.modal-card {
  width: min(460px, 100%);
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  position: relative;
}

/* petit lien RETOUR en haut à droite des cartes blanches */
.modal-back {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 4px 6px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  cursor: pointer;
}

.modal-back:hover { color: var(--ink); }

.modal-wide { width: min(560px, 100%); }

.modal-card h3 { font-size: 20px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .02em; }
.modal-card p { color: var(--muted); font-size: 13px; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.modal-actions .btn { flex: 1; min-width: 150px; width: auto; }

.rules {
  margin: 14px 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.85;
}
.rules b { color: var(--ink); font-weight: 700; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
  .mode-card { min-height: 220px; }
  .creator-grid { grid-template-columns: 1fr; }
  .creator-preview { position: static; }
  .sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .char-bar { flex-wrap: wrap; }
  .char-bar-action { align-items: flex-start; width: 100%; }
  .char-bar-action .btn { width: 100%; }
  .dunk-cols { grid-template-columns: 1fr; }
  .dunk-selected { border-left: 0; padding-left: 0; }
}

@media (max-width: 640px) {
  .teams { grid-template-columns: 1fr; }
  .sizes { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .game-help { font-size: 10px; }
  .hud-box { min-width: 70px; padding: 6px 10px; }
  .game-top { flex-direction: column; }
}
