/* Galaktik Rebels 501st - Fox · thème sombre aux couleurs du renard */
:root {
  --bg: #0d1c1f;
  --bg-2: #10232650;
  --surface: #15292c;
  --surface-2: #1c3437;
  --line: #2a4448;
  --line-soft: #223a3d;
  --text: #edf2ef;
  --muted: #a3b5b0;
  --header: #0a1719;

  --fox: #f58a35;
  --fox-hover: #ff9e52;
  --fox-ink: #1d1008;

  --yes: #6fe0a0;   --yes-bg: #173d2b;  --yes-line: #2f8a58;
  --maybe: #ffc65c; --maybe-bg: #3d2f12; --maybe-line: #a87a1f;
  --no: #ff8a7c;    --no-bg: #43201d;   --no-line: #b0463b;
  --none: #b3c0bc;  --none-bg: #26393b; --none-line: #4c6265;

  --danger: #d2473a;
  --radius: 14px;
  --focus: 0 0 0 3px #ffb46e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(1200px 500px at 85% -10%, #f58a3514, transparent 60%), var(--bg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fox); color: var(--fox-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- En-tête ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--header); border-bottom: 1px solid #f58a3540;
  padding: 14px 26px; min-height: 76px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-by { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.brand-by img { width: 16px; height: 16px; }
.site-foot { display: flex; justify-content: center; padding: 10px 20px 36px; }
.site-foot img { width: 220px; height: auto; display: block; opacity: .9; }
.site-foot a:hover img { opacity: 1; }
.brand-name { font-weight: 800; font-size: 1.45rem; letter-spacing: .01em; }
.brand-name span:last-child { color: var(--fox); }
.player-btn {
  background: #1a3033; border: 1px solid #3b5659; border-radius: 10px;
  padding: 10px 14px; font-weight: 700; font-size: .95rem; white-space: nowrap;
}
.player-btn:hover { border-color: var(--fox); }
.player-btn b { color: var(--fox); }

/* ---------- Page ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 26px 56px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 20px;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); margin: 0; letter-spacing: -.01em; line-height: 1.1; }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; border: 1px solid var(--line-soft); }
.tabs [role=tab] {
  border: 0; background: transparent; border-radius: 9px; padding: 11px 20px; font-weight: 700; color: var(--muted);
}
.tabs [role=tab]:hover { color: var(--text); }
.tabs [role=tab][aria-selected=true] { background: var(--fox); color: var(--fox-ink); }

.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 22px 0 24px; }
.weekbar h2 { font-size: 1.55rem; margin: 0; }
.week-nav { display: flex; gap: 8px; align-items: center; }
.btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; min-height: 44px;
}
.btn:hover:not(:disabled) { border-color: var(--fox); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.icon { width: 46px; padding: 0; font-size: 1.4rem; line-height: 1; }
.btn.primary { background: var(--fox); border-color: var(--fox); color: var(--fox-ink); }
.btn.primary:hover:not(:disabled) { background: var(--fox-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 22px 28px; }
.card-head h3 { font-size: 1.7rem; margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); }
.card-meta { color: var(--muted); font-weight: 700; }
.note { color: var(--muted); margin: 14px 4px 0; }
.empty { max-width: 640px; margin: 8px auto; padding: 26px 30px 30px; }
.empty h3 { font-size: 1.7rem; margin: 0 0 18px; }
.empty p { color: var(--muted); }
label.field { display: block; font-weight: 700; margin-bottom: 8px; }
.input {
  width: 100%; background: #0f2023; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 48px; font-size: 1.05rem;
}
.input::placeholder { color: #7f938f; }
.input:focus { border-color: var(--fox); }
.form-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.form-error { color: var(--no); margin: 10px 0 0; font-weight: 600; }

/* ---------- Mes soirées ---------- */
.days { list-style: none; margin: 0; padding: 0; }
.day-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px;
  padding: 14px 28px; border-top: 1px solid var(--line-soft);
}
.day-name { font-weight: 800; font-size: 1.15rem; }
.today-tag { font-size: .78rem; font-weight: 700; color: var(--fox); margin-left: 8px; text-transform: uppercase; letter-spacing: .04em; }
.choices { display: grid; grid-template-columns: repeat(4, auto); gap: 10px; }
.choice {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 16px; min-height: 44px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.choice:hover { border-color: #5d777a; color: var(--text); }
.choice .sym { font-weight: 800; }
.choice[aria-checked=true].yes   { background: var(--yes-bg);   border-color: var(--yes-line);   color: var(--yes); }
.choice[aria-checked=true].maybe { background: var(--maybe-bg); border-color: var(--maybe-line); color: var(--maybe); }
.choice[aria-checked=true].no    { background: var(--no-bg);    border-color: var(--no-line);    color: var(--no); }
.choice[aria-checked=true].none  { background: var(--none-bg);  border-color: var(--none-line);  color: var(--text); }
.row-status { grid-column: 1 / -1; font-size: .92rem; color: var(--muted); min-height: 0; }
.row-status:empty { display: none; }
.row-status.error { color: var(--no); font-weight: 600; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-status .btn { min-height: 36px; padding: 6px 12px; }

/* ---------- Badges et pastilles ---------- */
.badge { display: inline-flex; flex-direction: column; align-items: center; border-radius: 9px; padding: 6px 10px; line-height: 1.2; }
.badge strong { font-size: 1.15rem; }
.badge span { font-size: .85rem; }
.v-full  { background: var(--yes-bg);   color: var(--yes); }
.v-maybe { background: var(--maybe-bg); color: var(--maybe); }
.v-short { background: var(--no-bg);    color: var(--no); }
.v-empty { background: var(--none-bg);  color: var(--none); }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 1.05rem;
}
.chip.yes   { background: var(--yes-bg);   color: var(--yes); }
.chip.maybe { background: var(--maybe-bg); color: var(--maybe); }
.chip.no    { background: var(--no-bg);    color: var(--no); }
.chip.none  { background: var(--none-bg);  color: var(--none); }

/* ---------- Tableau d'équipe (ordinateur) ---------- */
.table-wrap { overflow-x: auto; }
table.team { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 760px; }
table.team th, table.team td { padding: 10px 8px; text-align: center; border-top: 1px solid var(--line-soft); }
table.team thead th { border-top: 0; background: #12262950; vertical-align: bottom; padding-bottom: 12px; }
table.team thead th:first-child, table.team tbody th { text-align: left; padding-left: 28px; width: 160px; }
table.team .dname { display: block; font-weight: 800; margin-bottom: 8px; }
table.team .today .dname { color: var(--fox); }
table.team .badge { display: flex; justify-content: center; min-height: 58px; }
table.team .badge span { font-size: .8rem; }
table.team tbody th { font-weight: 800; font-size: 1.08rem; }
table.team tr.me { background: #f58a350d; }
.you { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 6px; }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin: 16px 4px 0; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Liste d'équipe (mobile) ---------- */
.team-list { list-style: none; margin: 0; padding: 0; display: none; }
.team-list > li { border-top: 1px solid var(--line-soft); }
.disclosure {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent; border: 0; padding: 16px 20px; min-height: 64px; text-align: left;
}
.disclosure .dname { font-weight: 800; font-size: 1.12rem; }
.disclosure.today .dname { color: var(--fox); }
.disclosure .right { display: flex; align-items: center; gap: 10px; }
.pill { border-radius: 9px; padding: 8px 12px; font-weight: 800; font-size: .92rem; white-space: nowrap; }
.chev { color: var(--muted); transition: transform .15s; font-size: 1.1rem; }
.disclosure[aria-expanded=true] .chev { transform: rotate(180deg); }
.groups { margin: 0; padding: 0 20px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; }
.groups dt { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .95rem; }
.groups dd { margin: 0; overflow-wrap: anywhere; }
.groups dd.nobody { color: var(--muted); }

/* ---------- Calendrier « Choisir une date » ---------- */
.picker-wrap { position: relative; }
.picker {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 340px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px #0009; padding: 16px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.picker-head strong { font-size: 1.2rem; text-transform: capitalize; }
.picker-head button { width: 40px; height: 40px; border-radius: 9px; border: 0; background: transparent; font-size: 1.4rem; }
.picker-head button:hover { background: var(--surface); }
.picker table { width: 100%; border-collapse: collapse; }
.picker th { color: var(--muted); font-size: .85rem; padding: 6px 0; font-weight: 700; }
.picker td { text-align: center; padding: 2px; }
.picker td button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; font-size: 1rem;
}
.picker td button:hover { background: var(--surface); }
.picker td button.in-week { background: #f58a3526; }
.picker td button.is-today { box-shadow: inset 0 0 0 2px var(--fox); }
.picker td button:focus-visible { background: var(--fox); color: var(--fox-ink); box-shadow: var(--focus); }
.picker-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------- Fenêtres ---------- */
.modal {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(620px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px #000a;
}
.modal.small { width: min(560px, calc(100vw - 24px)); }
.modal::backdrop { background: #050c0dcc; }
.modal-body { padding: 26px 30px 28px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal h2 { margin: 0; font-size: 1.75rem; }
.modal p { color: var(--muted); line-height: 1.55; }
.close { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; font-size: 1.6rem; color: var(--text); }
.close:hover { background: var(--surface-2); }
.hint { color: var(--muted); margin: 0 0 8px; }
.notice { background: #3d2f12; color: var(--maybe); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600; }
.roster { list-style: none; margin: 0 0 22px; padding: 0; }
.roster li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.roster .pick {
  flex: 1; text-align: left; background: transparent; border: 0; padding: 14px 4px; min-height: 52px;
  font-weight: 800; font-size: 1.15rem; border-radius: 8px;
}
.roster .pick:hover { color: var(--fox); }
.roster .pick[aria-pressed=true] { color: var(--fox); }
.roster .remove { background: transparent; border: 0; color: var(--no); font-weight: 800; padding: 10px 6px; min-height: 44px; border-radius: 8px; }
.roster .remove:hover { text-decoration: underline; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Divers ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
  background: #f3ece4; color: #1d1008; padding: 12px 18px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 12px 30px #0008; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); color: #fff; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.panel-error { padding: 28px; text-align: center; }
.panel-error p { color: var(--no); font-weight: 700; }
.noscript { padding: 20px; }
#panel:focus { box-shadow: none; }

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; min-height: 72px; }
  .brand { gap: 10px; }
  .brand-logo { width: 42px; height: 42px; }
  .brand-name { font-size: 1.12rem; line-height: 1.15; }
  .brand-by { font-size: .72rem; }
  .site-foot img { width: 180px; }
  .brand-name span { display: block; }
  .player-btn { padding: 8px 10px; font-size: .8rem; white-space: normal; text-align: center; max-width: 52vw; }
  .page { padding: 20px 14px 40px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; padding-bottom: 16px; }
  .tabs { align-self: flex-start; }
  .tabs [role=tab] { padding: 10px 14px; }
  .weekbar { flex-direction: column; align-items: flex-start; margin: 16px 0 18px; gap: 10px; }
  .weekbar h2 { font-size: 1.25rem; }
  .week-nav { width: 100%; }
  .week-nav .btn { padding: 8px 6px; font-size: .9rem; white-space: nowrap; }
  .disclosure { padding: 14px 16px; }
  .disclosure .dname { white-space: nowrap; font-size: 1.05rem; }
  .pill { padding: 7px 9px; font-size: .82rem; }
  .week-nav .btn.icon { width: 42px; flex: none; }
  .week-nav > .btn:not(.icon), .picker-wrap { flex: 1; }
  .picker-wrap > .btn { width: 100%; }
  .picker-wrap { position: static; }
  .week-nav { position: relative; }
  .picker { left: 0; right: auto; width: min(340px, calc(100vw - 28px)); }
  .card-head { padding: 18px 18px; }
  .card-head h3 { font-size: 1.4rem; }
  .day-row { grid-template-columns: 1fr; padding: 14px 16px; }
  .choices { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .choice { padding: 8px 4px; font-size: .8rem; gap: 4px; white-space: normal; text-align: center; line-height: 1.15; }
  .table-wrap { display: none; }
  .team-list { display: block; }
  .legend { display: none; }
  .modal-body { padding: 22px 20px 24px; }
  .modal h2 { font-size: 1.45rem; }
}
@media (max-width: 420px) {
  .choices { grid-template-columns: repeat(2, 1fr); }
  .choice { font-size: .9rem; }
  .pill { padding: 7px 9px; font-size: .85rem; }
  .disclosure { padding: 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
