/* ManageComp — client web.
   Jetons de couleur, coquille (barre latérale), composants, puis écrans. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fe;
  --text: #1b2b3c;
  --muted: #64748b;
  --accent: #0866cd;
  --accent-strong: #0a4f9e;
  --accent-soft: #e8f1fd;
  --violet: #3b8cf0;
  --border: #e3e8f2;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --present: #0866cd;
  --absent: #dc2626;
  --sh-1: 0 1px 2px rgb(15 29 61 / 0.05), 0 1px 3px rgb(15 29 61 / 0.04);
  --sh-2: 0 10px 30px -12px rgb(15 29 61 / 0.22), 0 2px 6px rgb(15 29 61 / 0.05);
  --sh-3: 0 24px 60px -18px rgb(15 29 61 / 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 100% -10%, #e1edfc 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 110%, #e6f4fb 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.02em; }
::selection { background: #cfe2fb; }

.spacer { flex: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 500; }

/* Icônes */
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.logo { display: block; width: 38px; height: 38px; flex: none; object-fit: contain; }
.brand-header { display: block; height: 44px; width: auto; max-width: 100%; }
.brand .logo { display: none; }

/* Coquille : barre latérale et contenu */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 15;
  display: flex; flex-direction: column; gap: 1.2rem;
  padding: 1.2rem 0.9rem;
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--text); padding: 0.2rem 0.4rem; }
.side-nav { display: grid; gap: 0.2rem; }
.side-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.75rem 0.3rem; }
.side-nav a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.75rem; border-radius: 11px;
  color: #334155; text-decoration: none; font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.side-nav a:hover { background: var(--accent-soft); color: var(--accent); transform: translateX(2px); }
.side-nav a.active { background: linear-gradient(135deg, #3b8cf0, var(--accent)); color: #fff; box-shadow: 0 8px 20px -8px rgb(8 102 205 / 0.6); }
.side-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--violet), var(--accent)); flex: none; }
.side-user-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1680px; margin: 0 auto; padding: 1.6rem 1.8rem 1rem; flex: 1; min-width: 0; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; animation: rise 0.45s var(--ease) both; }

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { height: auto; flex-direction: row; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border-right: none; border-bottom: 1px solid var(--border); }
  .side-title, .side-user-name { display: none; }
  .side-nav { display: flex; gap: 0.2rem; }
  .side-nav a { padding: 0.45rem 0.65rem; }
  .side-user { padding: 0.25rem; box-shadow: none; }
  .brand-header { height: 34px; }
  main { padding: 1rem 0.9rem; }
  .search input { width: 100%; }
}
@media (max-width: 560px) {
  .brand .brand-header { display: none; }
  .brand .logo { display: block; }
  .side-nav a { font-size: 0; gap: 0; }
  .side-nav a .icon { width: 20px; height: 20px; }
}

/* Boutons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent; border-radius: 11px;
  background: linear-gradient(135deg, #3b8cf0, var(--accent));
  color: #fff; font: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 6px 16px -8px rgb(8 102 205 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.18);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s, border-color 0.2s, opacity 0.2s;
}
button:hover:not(:disabled), .button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgb(8 102 205 / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.2); }
button:active:not(:disabled), .button:active { transform: translateY(0) scale(0.97); }
button:focus-visible, .button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: 0 0 0 4px rgb(8 102 205 / 0.25); }
button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
button.light, .button.light { background: var(--surface); color: var(--accent); border-color: var(--border); box-shadow: var(--sh-1); }
button.light:hover:not(:disabled), .button.light:hover { background: var(--accent-soft); border-color: #cfe2fb; box-shadow: var(--sh-1); }
button.ghost { background: transparent; color: var(--muted); box-shadow: none; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
button.danger { background: var(--surface); border-color: #fecaca; color: var(--danger); box-shadow: var(--sh-1); }
button.danger:hover:not(:disabled) { background: #fef2f2; box-shadow: var(--sh-1); }
button.ghost.danger { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost.danger:hover:not(:disabled) { background: #fef2f2; color: var(--danger); }
button.small { padding: 0.25rem 0.6rem; font-size: 0.8rem; border-radius: 8px; }
button.big { padding: 0.8rem 1.2rem; font-size: 1rem; border-radius: 13px; }
button.icon-only { padding: 0.45rem; }
button.round { width: 42px; height: 42px; padding: 0; border-radius: 50%; flex: none; }
button.round .icon { width: 1.3em; height: 1.3em; }
button.active { background: linear-gradient(135deg, #3b8cf0, var(--accent)) !important; color: #fff !important; border-color: transparent !important; }

/* Champs */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="time"], input[type="email"], select, textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 0.92rem; color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:hover, select:hover, textarea:hover { border-color: #c7d2e8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(8 102 205 / 0.15); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1.05em; height: 1.05em; }
.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon > .icon { position: absolute; left: 0.75rem; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 2.35rem; width: 100%; }
.search input { width: 230px; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.1rem 1.3rem; box-shadow: var(--sh-1); }
.card h2 { margin: 0; font-size: 1.1rem; }
.card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #f1f5f9; color: #334155; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.banner { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-radius: 12px; font-weight: 500; animation: rise 0.35s var(--ease) both; }
.banner.warn { background: #fff7e6; color: #92400e; border: 1px solid #fde1a8; }

/* En-tête de page */
.page-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.85rem; font-weight: 800; }
.page-head p { margin: 0.15rem 0 0; }

/* Accueil : cartes des compétitions */
.contest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.contest-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: var(--sh-1); cursor: pointer;
  animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.contest-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--c, #0866cd) 45%, var(--border)); }
.cc-band { height: 7px; background: linear-gradient(90deg, var(--c, #0866cd), color-mix(in srgb, var(--c, #0866cd) 35%, #3b8cf0)); }
.cc-body { padding: 0.9rem 1.1rem 1rem; display: grid; gap: 0.45rem; flex: 1; align-content: start; }
.cc-top { display: flex; align-items: center; gap: 0.5rem; min-height: 30px; }
.cc-weapon { flex: 1; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cc-top button { opacity: 0; transition: opacity 0.2s; }
.contest-card:hover .cc-top button, .contest-card:focus-within .cc-top button { opacity: 1; }
@media (hover: none) { .cc-top button { opacity: 1; } }
.contest-card h3 { margin: 0; font-size: 1.18rem; font-weight: 750; line-height: 1.25; }
.cc-label { margin: 0; font-size: 0.88rem; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; color: var(--muted); font-size: 0.85rem; }
.cc-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.cc-foot { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.35rem; padding-top: 0.7rem; border-top: 1px dashed var(--border); }
.cc-open { color: var(--muted); display: inline-flex; transition: transform 0.25s var(--ease), color 0.2s; }
.contest-card:hover .cc-open { transform: translateX(4px); color: var(--accent); }
.contest-card.skeleton { height: 190px; cursor: default; background: linear-gradient(100deg, #eef2f9 30%, #f8faff 50%, #eef2f9 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.empty { display: grid; justify-items: center; gap: 0.5rem; text-align: center; padding: 3.5rem 1rem; background: var(--surface); border: 1px dashed #cbd5e1; border-radius: 20px; animation: rise 0.45s var(--ease) both; }
.empty > .icon { width: 52px; height: 52px; padding: 12px; border-radius: 16px; color: var(--accent); background: var(--accent-soft); }
.empty h2 { margin: 0.4rem 0 0; }
.empty p { margin: 0 0 0.6rem; max-width: 420px; }

/* Compétition : bandeau et frise des phases */
.contest-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap;
  padding: 1.4rem 1.7rem 1.5rem; border-radius: 22px; color: #fff;
  background: linear-gradient(125deg, #0c1724 0%, var(--accent-strong) 38%, #3b8cf0 75%, color-mix(in srgb, var(--c, #0866cd) 70%, #3b8cf0) 100%);
  box-shadow: 0 22px 50px -24px rgb(8 80 170 / 0.7);
}
.contest-hero::before, .contest-hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); }
.contest-hero::before { width: 340px; height: 340px; right: -60px; top: -170px; background: color-mix(in srgb, var(--c, #0866cd) 80%, white); opacity: 0.55; animation: float 12s ease-in-out infinite alternate; }
.contest-hero::after { width: 260px; height: 260px; left: 30%; bottom: -190px; background: #3b8cf0; opacity: 0.45; animation: float 15s ease-in-out infinite alternate-reverse; }
.hero-main { display: grid; gap: 0.35rem; min-width: 0; }
.contest-hero .back { display: inline-flex; align-items: center; gap: 0.2rem; color: rgb(255 255 255 / 0.8); text-decoration: none; font-size: 0.85rem; font-weight: 600; width: fit-content; transition: color 0.2s, transform 0.2s var(--ease); }
.contest-hero .back:hover { color: #fff; transform: translateX(-2px); }
.contest-hero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.15; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.chip.glass, button.glass { background: rgb(255 255 255 / 0.16); color: #fff; border: 1px solid rgb(255 255 255 / 0.25); backdrop-filter: blur(8px); box-shadow: none; }
button.glass:hover:not(:disabled) { background: rgb(255 255 255 / 0.28); box-shadow: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.stepper-bar { display: flex; align-items: center; gap: 0.7rem; }
.stepper { flex: 1; min-width: 0; display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--sh-1); scrollbar-width: thin; }
.stepper .step { flex: none; gap: 0.55rem; padding: 0.4rem 0.85rem 0.4rem 0.4rem; border-radius: 12px; background: transparent; color: var(--muted); box-shadow: none; font-weight: 500; border: 1px solid transparent; }
.stepper .step:hover:not(:disabled) { background: var(--surface-2); box-shadow: none; transform: none; color: var(--text); }
.stepper .step.active { background: var(--accent-soft); color: var(--text); font-weight: 650; border-color: #cfe2fb; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 750; flex: none; background: #f1f5f9; color: var(--muted); border: 1.5px dashed #cbd5e1; transition: transform 0.25s var(--ease); }
.step .dot .icon { width: 15px; height: 15px; }
.step.done .dot { background: #dcfce7; color: var(--success); border: 1.5px solid #bbf7d0; }
.step.current .dot { background: linear-gradient(135deg, #3b8cf0, var(--accent)); color: #fff; border: none; animation: pulse 2.2s ease-out infinite; }
.step.current { color: var(--text); }
.step:hover .dot { transform: scale(1.08); }
.step > .icon { opacity: 0.55; width: 0.95em; height: 0.95em; }
.step-label { white-space: nowrap; }

.stage { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.25rem 1.35rem; min-height: 320px; box-shadow: var(--sh-1); min-width: 0; }
.stage-in { animation: rise 0.35s var(--ease) both; }
.stage-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.stage-error { color: var(--danger); font-weight: 600; margin-right: 0.5rem; }
.toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tally { display: inline-flex; align-items: baseline; gap: 0.35rem; padding: 0.3rem 0.8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tally .present { color: var(--present); font-size: 1.35rem; font-weight: 800; }
.tally .absent { color: var(--absent); font-size: 1.35rem; font-weight: 800; }

/* Onglets (segments) */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.3rem; background: #eef2f9; border-radius: 13px; width: fit-content; max-width: 100%; }
.tabs .tab { background: transparent; color: var(--muted); border: none; box-shadow: none; border-radius: 10px; padding: 0.45rem 0.9rem; font-weight: 600; }
.tabs .tab:hover:not(:disabled) { color: var(--text); box-shadow: none; transform: none; }
.tabs .tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--sh-1); }
.tabs .tab.future { font-style: italic; }

/* Listes */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); font-size: 0.92rem; }
table.list th, table.list td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid #edf1f7; }
table.list th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
table.list tr:first-child th:first-child { border-top-left-radius: 10px; }
table.list tr:first-child th:last-child { border-top-right-radius: 10px; }
table.list tbody tr { transition: background 0.15s; }
table.list tbody tr:hover { background: #f3f8fe; }
table.list td.name { font-weight: 600; }
table.list .number { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.actions { text-align: right; }
table.list tr.clickable { cursor: pointer; }
table.list tr.absent td { color: #94a3b8; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 5px; border: 1px solid #0001; }

/* Fenêtres */
.overlay, .modal-backdrop {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 1rem 1rem;
  background: rgb(15 23 42 / 0.42); backdrop-filter: blur(6px);
  animation: fade 0.2s ease both;
}
.modal-backdrop { align-items: center; padding-top: 1rem; }
.dialog, .modal {
  background: var(--surface); border-radius: 22px; border: 1px solid var(--border);
  padding: 1.5rem 1.7rem; max-height: 88vh; overflow: auto;
  box-shadow: var(--sh-3);
  animation: pop 0.28s var(--ease) both;
}
.dialog { width: min(760px, 94vw); display: grid; gap: 0.9rem; }
.modal { min-width: min(340px, 92vw); max-width: 680px; }
.dialog h2, .modal h3 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.modal h3 { margin-bottom: 0.8rem; }
.modal fieldset { border: 1px solid var(--border); border-radius: 12px; margin: 0 0 0.8rem; padding: 0.6rem 0.9rem; }
.modal fieldset legend { font-weight: 700; font-size: 0.85rem; padding: 0 0.3rem; }
.modal .actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.1rem; align-items: center; flex-wrap: wrap; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.75rem 1rem; }
.fields label, .dialog > label { display: grid; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.fields label.wide { grid-column: 1 / -1; }
label.check { display: flex !important; align-items: center; gap: 0.55rem; color: var(--text) !important; font-weight: 500 !important; font-size: 0.92rem !important; cursor: pointer; }
.buttons { display: flex; gap: 0.5rem; justify-content: flex-end; align-items: center; margin-top: 0.3rem; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 0.9rem; align-items: center; }
ul.plain { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

label.inline { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
label.inline input[type="number"] { width: 4.8rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; margin-top: 0.3rem; }

/* Réglages repliables */
details.settings { border: 1px solid var(--border); border-radius: 14px; padding: 0.55rem 0.95rem; margin-bottom: 0.9rem; background: var(--surface-2); transition: background 0.2s; }
details.settings[open] { background: var(--surface); box-shadow: var(--sh-1); }
details.settings summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 0.6rem; }
details.settings summary::-webkit-details-marker { display: none; }
details.settings summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
details.settings[open] summary::before { transform: rotate(45deg); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem 1.5rem; padding: 0.7rem 0 0.3rem; }
.settings-grid > div { display: grid; gap: 0.35rem; align-content: start; }
.settings-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; padding: 0.5rem 0; }

/* Messages passagers */
#toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 0.5rem; width: min(520px, 92vw); pointer-events: none; }
.toast { pointer-events: auto; padding: 0.85rem 1.1rem; border-radius: 14px; background: #0f172a; color: #f8fafc; font-weight: 500; box-shadow: var(--sh-3); white-space: pre-line; animation: toast-in 0.35s var(--ease) both; }
.toast.leaving { animation: toast-out 0.3s ease both; }

/* Connexion */
.login-screen { position: relative; min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 1rem; padding: 1.5rem; overflow: hidden; isolation: isolate; background: #0c1724; }
.login-glow {
  position: absolute; inset: -20%; z-index: -1; filter: blur(70px); opacity: 0.9;
  background:
    radial-gradient(35% 40% at 25% 30%, #0866cd 0%, transparent 70%),
    radial-gradient(30% 35% at 75% 25%, #3b8cf0 0%, transparent 70%),
    radial-gradient(35% 40% at 60% 80%, #00b4d8 0%, transparent 70%);
  animation: aurora 18s ease-in-out infinite alternate;
}
.login-card { width: min(430px, 100%); display: grid; justify-items: center; gap: 0.6rem; text-align: center; padding: 2.4rem 2rem 2rem; border-radius: 26px; background: rgb(255 255 255 / 0.9); backdrop-filter: blur(20px); border: 1px solid rgb(255 255 255 / 0.6); box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.6); animation: pop 0.5s var(--ease) both; }
.login-card .brand-header { height: 64px; margin: 0 auto 0.2rem; }
.login-card p { margin: 0 0 0.6rem; }
.login-card form { display: grid; gap: 0.7rem; width: 100%; }
.login-card .input-icon input { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.login-screen .app-footer { color: rgb(255 255 255 / 0.6); }
.login-screen .app-footer a { color: rgb(255 255 255 / 0.85); }

/* Animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(8 102 205 / 0.45); } 70% { box-shadow: 0 0 0 9px rgb(8 102 205 / 0); } 100% { box-shadow: 0 0 0 0 rgb(8 102 205 / 0); } }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(-40px, 30px); } }
@keyframes aurora { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(4%, -3%) rotate(12deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Entraînement des jeunes */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0.8rem; }
.group-head { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin-bottom: 0.4rem; }
ul.fencers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.fencers li { display: flex; justify-content: space-between; padding: 0.3rem 0.55rem; border-radius: 8px; background: var(--surface-2); border: 1px solid #edf1f7; cursor: grab; transition: background 0.15s, transform 0.15s var(--ease); }
ul.fencers li:hover { background: var(--accent-soft); transform: translateX(2px); }
.drop-over { outline: 2px dashed var(--accent); outline-offset: 3px; background: var(--accent-soft); border-radius: 12px; }

/* Composition des poules */
.pools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
@media (max-width: 900px) { .pools-grid { grid-template-columns: 1fr; } }
.pool-head { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.3rem; font-size: 1.05rem; }
.pool-head .ok { color: #2e7d32; }
.pool-head .ko { color: var(--danger); }
.roadmap { color: darkgreen; font-style: italic; font-weight: 600; }
table.compact td, table.compact th { padding: 0.2rem 0.4rem; }
tr.draggable { cursor: grab; }
td.mark { width: 1.2rem; color: #b26a00; }

/* Feuille de poule : les cases gardent leur taille, les noms se réduisent. */
.sheet-head { display: flex; gap: 1rem; align-items: baseline; }
.sheet-head h3 { margin: 0.2rem 0 0.6rem; }
.sheet-wrap { overflow-x: auto; }
table.sheet { border-collapse: collapse; }
table.sheet th, table.sheet td { white-space: nowrap; }
table.sheet th.num { width: 44px; min-width: 44px; max-width: 44px; text-align: center; font-weight: 600; padding: 0 0 2px; }
table.sheet th.head { font-size: 0.75rem; color: var(--muted); padding: 0 0.3rem; font-weight: 600; }
table.sheet td.name {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
  text-align: right;
  color: #00008b;
  font-size: 0.9rem;
}
table.sheet td.pos { width: 1.8rem; padding-right: 0.3rem; text-align: right; font-weight: 700; }
table.sheet td.cell {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  border: 2px solid #222;
  text-align: center;
  padding: 0;
  background: white;
}
table.sheet td.cell.grey { background: #bebebe; }
table.sheet td.dash { padding: 0 0.45rem; text-align: center; font-size: 0.95rem; }
table.sheet td.dash select { font-size: 0.8rem; padding: 0.1rem; }
table.sheet td.dash.rank { font-weight: 700; }
table.sheet td.cell input.score {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: none;
  padding: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: transparent;
  text-transform: uppercase;
}
input.score:focus { outline: 3px solid #87ceeb; background: #eaf7ff; }
input.score.error { background: #f4b6b6; }
.bouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.4rem 1.5rem; }
.bout { display: flex; gap: 0.6rem; align-items: center; padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.bout .opponent { display: inline-flex; gap: 0.3rem; align-items: center; }
.bout input.score { width: 3rem; height: 1.8rem; border: 1px solid var(--border); border-radius: 4px; text-align: center; font-weight: 700; text-transform: uppercase; }

/* Tableaux */
.bracket-scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.bracket { position: relative; }
.bracket svg.connectors { position: absolute; left: 0; top: 0; pointer-events: none; }
.b-header { position: absolute; font-weight: 700; display: flex; align-items: center; justify-content: center; background: #eef0f4; border-radius: 4px; }
.b-cell { position: absolute; display: flex; align-items: center; gap: 0.4rem; padding: 0 0.3rem; overflow: hidden; white-space: nowrap; font-size: 0.9rem; }
.b-cell strong { color: #00008b; }
.b-cell .club { color: dimgrey; font-style: italic; font-size: 0.8rem; }
.b-label { position: absolute; font-size: 0.75rem; color: var(--muted); display: flex; gap: 0.4rem; align-items: center; }
input.b-score { position: absolute; border: 1px solid #999; border-radius: 3px; background: white; font-size: 0.9rem; }

/* Impression */
@media print {
  .sidebar, .stepper-bar, .hero-actions, .banner, .toolbar, .tabs, .stage-bar, details.settings, .card-head button, .actions, button, #toasts { display: none !important; }
  .shell { display: block; }
  .page, .stage-in { animation: none; }
  .contest-hero { background: none !important; color: #000; box-shadow: none; border: 1px solid #888; border-radius: 6px; padding: 8px 12px; }
  .contest-hero::before, .contest-hero::after, .contest-hero .back { display: none; }
  .chip.glass { color: #000; border-color: #aaa; background: none; }
  .stage { box-shadow: none; border: none; border-radius: 0; padding: 0; }
  body { background: white; }
  main { max-width: none; margin: 0; padding: 0; }
  table.sheet td.cell.grey, .b-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bracket-scroll { overflow: visible; max-height: none; border: none; }
  input.score { border: none !important; }
}

/* Feuilles de match (barrage, tableaux) */
.match-sheet { border-bottom: 1px dashed #c0c0c0; padding: 4mm 0 5mm; break-inside: avoid; }
.ms-head { display: flex; align-items: center; gap: 8mm; margin-bottom: 3mm; }
.ms-name { font-size: 1.15rem; font-weight: 700; color: grey; }
.ms-box { display: inline-flex; align-items: center; gap: 4px; min-width: 45mm; min-height: 7mm; border: 1px solid #ccc; padding: 0 6px; color: darkgreen; font-weight: 700; }
.ms-label { color: grey; font-size: 0.7rem; font-weight: 700; }
.ms-fencer { display: grid; grid-template-columns: 55mm 1fr 14mm 40mm; align-items: center; gap: 3mm; margin: 2mm 0; }
.ms-identity { display: flex; flex-direction: column; font-size: 0.8rem; }
.ms-identity strong { color: darkblue; }
.ms-identity .muted { font-style: italic; font-size: 0.7rem; }
.ms-touches { display: grid; grid-template-columns: repeat(15, 6.2mm); gap: 1px; }
.ms-touch { width: 6mm; height: 6mm; border: 1px solid #222; font-size: 0.6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ms-score { height: 8mm; border: 1.5px solid #222; }
.ms-signature { height: 8mm; background: #d9d9d9; color: #f2f2f2; font-weight: 700; display: flex; align-items: center; justify-content: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bout .winner { color: #168456; font-weight: 700; }

/* Feuilles des groupes (entraînement des jeunes) */
.print-sheets { position: fixed; inset: 0; z-index: 20; background: #e8eaee; overflow: auto; padding: 1rem; }
.print-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 0.6rem; align-items: center; background: rgb(255 255 255 / 0.92); backdrop-filter: blur(10px); padding: 0.7rem 1rem; border-radius: 16px; margin-bottom: 1rem; box-shadow: var(--sh-2); }
.print-page { background: white; width: 210mm; min-height: 290mm; margin: 0 auto 1rem; padding: 10mm; box-shadow: 0 2px 10px #0003; }
.page-header { display: flex; justify-content: space-between; align-items: center; border: 1px solid #888; background: #eed680; padding: 6px 10px; margin-bottom: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.page-header .group-title { font-size: 1.6rem; font-weight: 800; }
.page-pools { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-bottom: 6mm; }
.print-pool .pp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.85rem; }
.print-pool .box-label { color: grey; font-weight: 700; }
.print-pool .box-line { flex: 1; border-bottom: 1px solid #555; min-width: 40px; height: 1em; }
.print-pool .box-line.short { flex: 0 0 40px; }
table.sheet.print td.cell { width: 30px; min-width: 30px; max-width: 30px; height: 30px; border: 1.5px solid #222; }
table.sheet.print td.cell.small { width: 24px; min-width: 24px; max-width: 24px; border-width: 1px; }
table.sheet.print td.name { max-width: 120px; font-size: 0.72rem; }
table.sheet.print th.num { width: 30px; min-width: 30px; font-size: 0.75rem; }
table.sheet.print th.head { font-size: 0.6rem; padding: 0 2px; }
table.sheet.print td.cell.grey { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-bouts { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 4px; font-size: 0.68rem; }
.pp-bout { display: flex; gap: 6px; align-items: center; border-bottom: 1px dotted #bbb; }
.pp-bout > strong { width: 2.2em; }
.pp-bout > div { flex: 1; }
.pp-opp { display: flex; justify-content: space-between; gap: 4px; }
.touches { display: inline-flex; gap: 1px; }
.touch { display: inline-block; width: 10px; height: 10px; border: 1px solid #333; font-size: 6px; line-height: 10px; text-align: center; }
.print-bracket { position: relative; overflow: hidden; }
.bs-slot { position: absolute; border-bottom: 1.5px solid #333; font-size: 12px; font-weight: 700; color: #00008b; white-space: nowrap; overflow: hidden; }
.bs-score { position: absolute; border: 1px solid #555; background: white; }
.bs-match { position: absolute; font-size: 10px; color: #666; white-space: nowrap; }
.bs-title { position: absolute; font-size: 14px; font-weight: 800; white-space: nowrap; }

@media print {
  @page { size: A4; margin: 8mm; }
  body.print-groups * { visibility: hidden; }
  body.print-groups .print-sheets, body.print-groups .print-sheets * { visibility: visible; }
  body.print-groups .print-sheets { position: absolute; left: 0; top: 0; padding: 0; background: white; overflow: visible; }
  body.print-groups .print-bar { display: none !important; }
  body.print-groups .print-page { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; page-break-after: always; break-after: page; }
}

/* Organisation */
.organisation .org-head { flex-wrap: wrap; gap: 1rem; }
.card.organisation { background: transparent; border: none; box-shadow: none; padding: 0; }
.org-head h2 { font-size: 1.85rem; font-weight: 800; }
.org-clock { padding: 0.2rem 0.8rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); }
.org-clock { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.org-warnings { display: inline-flex; gap: 0.3rem; }
.warning-box { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.8rem; }
.org-time { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.5rem 0; }
.org-time .cursor-time { background: black; color: white; padding: 0.15rem 0.6rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.org-time .muted { font-size: 0.8rem; }
.org-timeline { width: 100%; height: 48px; display: block; background: white; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.org-overlaps { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.org-overlaps button.warning { font-weight: 700; }
.org-columns { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.6fr) minmax(300px, 1.2fr); gap: 1rem; margin-top: 0.8rem; align-items: start; }
.org-columns.no-referees { grid-template-columns: minmax(320px, 1.6fr) minmax(300px, 1.2fr); }
.org-columns.no-pistes { grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.4fr); }
.org-columns.no-referees.no-pistes { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .org-columns, .org-columns.no-referees, .org-columns.no-pistes { grid-template-columns: 1fr; } }
.org-col { border: 1px solid var(--border); border-radius: 16px; padding: 0.8rem; background: var(--surface); box-shadow: var(--sh-1); min-width: 0; }
.org-toolbar { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.org-toolbar.wrap { flex-wrap: wrap; }
.weapon-tabs, .batch-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.batch-tabs { border-left: 4px solid; padding-left: 0.4rem; }
.weapon-tabs button.active, .batch-tabs button.active { background: var(--accent); color: white; }
.hall-scroll { overflow: auto; max-height: 70vh; background: white; border: 1px solid var(--border); border-radius: 12px; }
svg.hall { display: block; user-select: none; touch-action: none; }
svg.hall .piste { cursor: grab; }
svg.hall .piste-bg { stroke: black; stroke-width: 0.75; }
svg.hall .piste.selected .piste-bg { stroke-width: 3; }
svg.hall .piste-id { font: bold 13px sans-serif; }
svg.hall .piste-title { font: 10px sans-serif; }
svg.hall .piste-title.small { font-size: 8px; }
svg.hall .piste-referee { font: bold 8px sans-serif; }
svg.hall .piste-mark { font-size: 12px; }
table.list.jobs tr, table.list.referees tr { cursor: pointer; }
table.list tr.selected td { background: var(--accent-soft); }
table.list tr.held td { outline: 2px solid var(--accent); }
table.list tr.unavailable td { color: #9aa; }
table.list td.icon { width: 1.5em; }
.hint { background: #fff7e6; border: 1px solid #fde1a8; border-radius: 10px; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.job-board-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0.9rem; border-radius: 12px; margin-bottom: 0.5rem; }
.job-board-head strong { font-size: 1.2rem; }
p.small { font-size: 0.78rem; }

/* Tickets repas et carnet de paiement */
.print-page.tickets { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 44mm; gap: 3mm; }
.ticket { border: 1px solid grey; border-radius: 4px; display: grid; grid-template-columns: 1fr 1fr; padding: 2mm; }
.ticket-name { font-size: 0.95rem; }
.ticket-food { display: grid; gap: 1px; }
.ticket-food span { background: #bbb; text-align: right; padding: 0 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.payment-title { text-align: center; }
table.payment { width: 100%; border-collapse: collapse; }
table.payment td { border-bottom: 1px solid #999; height: 11mm; padding: 0 4px; }
.page-number { text-align: right; font-weight: 700; }

/* Organisation : les matchs à placer, bien visibles en haut */
.org-columns .org-batches { grid-column: 1 / -1; order: -1; }
.jobs-summary { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.pill { border-radius: 999px; padding: 0.15rem 0.7rem; font-weight: 700; font-size: 0.85rem; }
.pill.pending { background: #fff3d6; color: #b45309; border: 1px solid #f5c26b; }
.pill.placed { background: #e7f6ec; color: #15803d; border: 1px solid #9fd8b3; }
table.list.jobs thead th { text-align: left; font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--border); }
table.list.jobs tr.to-place { background: #fff9eb; }
table.list.jobs tr.to-place td.state { color: #b45309; font-weight: 700; }
table.list.jobs td.state { white-space: nowrap; color: #15803d; }
table.list.jobs td.center { text-align: center; }
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; max-height: 50vh; overflow: auto; }
.two-lists fieldset { display: flex; flex-direction: column; gap: 0.2rem; }

/* Impression des groupes : arbitres et répartition des matchs */
.print-pool .pp-referees { flex: 1; color: #00008b; font-weight: 700; font-size: 0.75rem; }
.pp-bout .pp-res { width: 7.5em; font-size: 0.6rem; color: #555; line-height: 1.15; }
.pp-bout .pp-res b { color: #00008b; }
.page-header .group-referees { font-size: 0.7rem; font-weight: 700; color: #00008b; text-align: center; }

/* Tableau d'affichage d'une piste (/live/) */
.live-board { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; font-family: system-ui, sans-serif; }
.live-title { background: #0866cd; color: #fff; text-align: center; font-size: 4vh; font-weight: 800; padding: 1.5vh; min-height: 6vh; }
.live-scores { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
.live-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.live-side.red .live-score { color: #ff5252; }
.live-side.green .live-score { color: #00e676; }
.live-name { font-size: 5vh; font-weight: 700; text-align: center; padding: 0 2vw; }
.live-score { font-size: 30vh; font-weight: 900; line-height: 1; }
.live-clock { text-align: center; font-size: 16vh; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-waiting { position: absolute; top: 45%; width: 100%; text-align: center; font-size: 4vh; color: #aaa; }
.live-piste { position: absolute; right: 1.5vw; bottom: 1.5vh; display: flex; align-items: center; gap: 0.8rem; font-size: 2.5vh; opacity: 0.6; }
.live-piste button { background: #333; color: #fff; border: none; border-radius: 6px; font-size: 2.5vh; padding: 0.2rem 0.9rem; }

/* Impression des groupes remplie */
table.sheet.print td.cell { text-align: center; font-weight: 700; font-size: 0.8rem; }
table.sheet.print td.cell.small { font-weight: 400; font-size: 0.65rem; }
table.sheet.print td.cell.small.rank { font-weight: 800; }
.pp-opp .pp-score { font-weight: 800; color: #00008b; min-width: 1.6em; text-align: right; }
.bs-score { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }

/* Feuilles de match par équipes (relais) */
.print-page.relay-page { padding: 6mm; }
.print-page.relay-page svg { width: 100%; height: auto; display: block; }

/* Pied de page : licence et crédits */
.app-footer { text-align: center; font-size: 0.78rem; color: var(--muted); padding: 1.5rem 1rem; }
.app-footer a { color: inherit; text-decoration: underline; text-decoration-color: #cbd5e1; text-underline-offset: 2px; }
body.print-groups .app-footer { display: none; }
@media print { .app-footer { display: none; } }

/* ManageComp Arbitre : téléphone d'abord */
body:has(.ref-app) { background: #f3f6fb; }
.ref-app { max-width: 640px; margin: 0 auto; padding: 12px 12px 48px; font-size: 17px; color: #1b2b3c; }
.ref-screen h1 { margin: 0.2rem 0; }
.ref-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ref-head > div { min-width: 0; }
.ref-head > button { flex-shrink: 0; }
.ref-app { overflow-wrap: anywhere; }
.ref-brand { font-weight: 800; font-size: 1.25rem; color: #0866cd; }
.ref-back { font-weight: 700; text-decoration: none; color: #0866cd; padding: 6px 0; }
.ref-title { font-size: 1.35rem; margin: 6px 0 2px; }
.ref-muted { color: #5f6f8c; }
.ref-small { font-size: 0.85rem; }
.ref-center { text-align: center; justify-content: center; }
.ref-error { color: #b42318; font-weight: 600; }
.ref-ok { color: #168456; font-weight: 700; }
.ref-place { color: #0866cd; font-weight: 700; font-size: 1.05rem; }
.ref-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ref-grow { flex: 1; min-width: 0; }
.ref-board .ref-row { flex-wrap: nowrap; }
.ref-pre { white-space: pre-line; text-align: right; }
.ref-card { display: block; background: #fff; border: 1px solid #dce5f4; border-radius: 14px; padding: 12px 14px; margin: 10px 0; text-decoration: none; color: inherit; }
.ref-card.done { opacity: 0.65; }
.ref-fencer { margin-top: 6px; }
.ref-pos { width: 1.6em; font-weight: 700; color: #5f6f8c; }
.ref-score { font-size: 1.5rem; font-weight: 800; color: #0866cd; min-width: 1.6em; text-align: right; }
.ref-grid-scroll { overflow-x: auto; margin: 10px 0; }
.ref-grid { border-collapse: collapse; background: #fff; font-size: 0.9rem; }
.ref-grid th, .ref-grid td { border: 1px solid #dce5f4; padding: 6px 7px; text-align: center; }
.ref-grid td.grey { background: #bdbdbd; }
.ref-grid .ref-gname { text-align: left; font-weight: 700; white-space: nowrap; }
.ref-clock { margin: 12px auto 6px; font-size: clamp(3rem, 17vw, 4.4rem); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; background: #fff; border-radius: 16px; padding: 6px 0; user-select: none; }
.ref-clock.zero { color: #b42318; }
.ref-main { background: #00ba32; color: #fff; border: none; border-radius: 12px; font-size: 1.2rem; font-weight: 800; padding: 12px 34px; }
.ref-main.pause { background: #ffa000; }
.ref-main:disabled { opacity: 0.5; }
.ref-adjust { flex-wrap: wrap; margin: 8px 0; }
.ref-light { background: #fff; color: #0866cd; border: 1px solid #0866cd; border-radius: 10px; padding: 8px 12px; font-size: 0.95rem; }
.ref-light.chosen, .ref-team.chosen { background: #0866cd; color: #fff; }
.ref-light:disabled { opacity: 0.45; }
.ref-wide { width: 100%; margin-top: 8px; }
.ref-link { background: none; border: none; color: #5f6f8c; text-decoration: underline; }
.ref-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 12px 0; }
.ref-side { min-width: 0; background: #111; color: #fff; border-radius: 16px; padding: 10px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ref-side .ref-name { font-weight: 700; text-align: center; min-height: 2.6em; font-size: 0.95rem; }
.ref-side .ref-big { font-size: clamp(2.8rem, 15vw, 4.4rem); font-weight: 900; line-height: 1; }
.ref-side.red .ref-big { color: #ff5252; }
.ref-side.green .ref-big { color: #00e676; }
.ref-step { width: clamp(44px, 15vw, 64px); height: clamp(44px, 15vw, 64px); border-radius: 14px; border: none; font-size: 2rem; font-weight: 800; background: #3a3a3a; color: #fff; }
.ref-step.plus { background: #0866cd; }
.ref-cards { display: flex; gap: 6px; }
.ref-cards button { width: clamp(28px, 9vw, 38px); height: clamp(36px, 11vw, 46px); border-radius: 6px; border: 1px solid #555; font-weight: 800; }
.card-y { background: #f5d90a; color: #111; }
.card-r { background: #e02424; color: #fff; }
.card-b { background: #111; color: #fff; }
.ref-send { display: block; width: 100%; margin-top: 14px; background: #0866cd; color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: 1.15rem; font-weight: 800; }
.ref-send:disabled { opacity: 0.5; }
.ref-status { text-align: center; font-weight: 600; min-height: 1.4em; }
.ref-team { flex: 1 1 0; min-width: 0; background: #fff; border: 2px solid #0866cd; color: #0866cd; border-radius: 12px; padding: 12px; font-weight: 800; font-size: 1rem; }
.ref-lineup { margin: 6px 0; }
.ref-lineup select { flex: 1; font-size: 1rem; padding: 8px; border-radius: 8px; }
.ref-num { width: 2.2em; font-weight: 800; font-size: 1.1rem; }
.ref-final { font-size: 1.6rem; font-weight: 800; text-align: center; margin: 14px 0; color: #0866cd; }
.ref-history { padding-left: 18px; }
.ref-screen.ref-center { padding-top: 30vh; }

/* Comptes : connexion, Mon compte, Administration */
.side-user-name { display: grid; line-height: 1.2; }
.side-user-name small { color: var(--muted); font-weight: 500; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; }
.login-tabs { width: 100%; margin: 0.4rem 0 0.2rem; }
.login-tabs .tab { flex: 1; padding: 0.45rem 0.4rem; font-size: 0.85rem; }
.login-card .banner { text-align: left; width: 100%; margin: 0; font-size: 0.88rem; }
.banner.ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.small { font-size: 0.8rem; }
.login-card p.small { margin: -0.2rem 0 0; text-align: left; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; }
.card-head > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.2rem; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 0.85rem; }
dl.facts dd { margin: 0; font-weight: 600; }
form.stack { display: grid; gap: 0.6rem; }
.grow { flex: 1; min-width: 220px; }
.new-key { display: grid; gap: 0.7rem; padding: 1rem 1.1rem; margin: 0.4rem 0 1rem; border-radius: 14px; background: linear-gradient(135deg, #ecfdf3, #eef4ff); border: 1px solid #bbf7d0; animation: pop 0.3s var(--ease) both; }
.new-key p { margin: 0.15rem 0 0; }
.new-key code { display: block; padding: 0.7rem 0.9rem; border-radius: 10px; background: #0f172a; color: #e2e8f0; font-size: 0.9rem; word-break: break-all; user-select: all; }
.new-key .buttons { justify-content: flex-start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.9rem; }
.stat { display: grid; gap: 0.15rem; padding: 1rem 1.1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.stat .icon { width: 32px; height: 32px; padding: 7px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); margin-bottom: 0.4rem; }
.stat strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat.warn { background: linear-gradient(135deg, #fff7e6, #fff); border-color: #fde1a8; }
.stat.warn .icon { color: var(--warning); background: #fef3c7; }
.card.highlight { border-color: #fde1a8; box-shadow: 0 0 0 4px #fff7e6, var(--sh-1); }
.requests { display: grid; gap: 0.6rem; }
.request { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(180px, 260px) auto; align-items: center; gap: 0.9rem; padding: 0.8rem 0.9rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.request-who { display: grid; min-width: 0; }
@media (max-width: 760px) { .request { grid-template-columns: auto 1fr; } .request select, .request .row { grid-column: 1 / -1; } }
.pill.off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.chip.tiny { font-size: 0.68rem; padding: 0.05rem 0.45rem; margin-left: 0.4rem; vertical-align: middle; }
.table-scroll { overflow-x: auto; }
td.actions { white-space: nowrap; }
td.actions button + button { margin-left: 0.3rem; }
.skeleton-block { height: 160px; background: linear-gradient(100deg, #eef2f9 30%, #f8faff 50%, #eef2f9 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.extra-criterion { display: inline-flex; align-items: center; gap: 2px; }

/* Tout tient dans la fenêtre : un bloc plus large que l'écran défile dans
   son propre cadre au lieu d'élargir la page. */
.page > *, .stage-in, .stage-in > * { min-width: 0; max-width: 100%; }
.stage { overflow-x: auto; }
.pools-grid > *, .pool.card, .org-col { min-width: 0; overflow-x: auto; }
.contest-hero, .stepper-bar { min-width: 0; }
.hero-main { flex: 1 1 320px; }

/* Point de scission */
.split-settings { display: grid; gap: 0.6rem; padding: 0.6rem 0 0.2rem; }
.split-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.split-row input[type="number"], .split-settings input[type="number"] { width: 5.5rem; }
table.list tr.moved td { background: #f3f8fe; }

/* Garde-fou des catégories */
table.list td.cat-up { background: #fff3d6; color: #9a5b00; font-weight: 600; }
table.list td.cat-up2 { background: #f1e8ff; color: #6b35c9; font-weight: 600; }
table.list td.cat-check { background: #fdecec; color: #b42318; font-weight: 600; }
.ref-double { flex-direction: column; gap: 4px; margin: 6px 0; }
td.move-up { color: #15803d; font-weight: 700; }
td.move-down { color: #b42318; font-weight: 700; }
.help-text { white-space: pre-line; }
.points-settings { display: grid; gap: 0.5rem; }
.pillow-list { max-height: 55vh; overflow: auto; display: grid; gap: 4px; }
.place-input { width: 4.5rem; }
.b-label.b-found { outline: 3px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); border-radius: 4px; z-index: 2; }
