:root {
  /* Thème clair, lisible en plein jour et au gymnase */
  --bg: #f3f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #eef3fa;
  --line: #d3deec;
  --text: #13233a;
  --muted: #586a84;
  --accent: #f5b800;       /* fonds (boutons, puces actives) */
  --accent-ink: #8a5a00;   /* texte et icônes accentués sur fond clair */
  --ok: #16a34a;
  --bad: #dc2626;
  --p: #f5b301;
  --pt: #ef4444;
  --r: #3b82f6;
  --c: #16a34a;
  --l: #a855f7;
  --radius: 14px;
  --gutter: 14px;
  --shadow: 0 2px 10px rgba(19, 35, 58, .07);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
[hidden] { display: none !important; }

/* ---------- En-tête et onglets ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-title { font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg2); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  border: 0; background: none; padding: 9px 4px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .8rem; color: var(--muted); font-weight: 600;
}
.tabs .ti { font-size: 1.25rem; line-height: 1; }
.tabs button[aria-selected="true"] { color: var(--accent-ink); }

main { max-width: 1180px; margin: 0 auto; padding: 12px var(--gutter) 8px; }
.tab { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Mise en page Terrain ---------- */
.layout {
  display: grid; gap: 12px;
  grid-template-areas: "controls" "court" "info";
}
.controls { grid-area: controls; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.controls > * { min-width: 0; }
.layout { grid-template-columns: minmax(0, 1fr); }
body { overflow-x: hidden; }
.court-wrap { grid-area: court; min-width: 0; }
.info { grid-area: info; min-width: 0; }

.label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.label .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }

.chips { display: flex; gap: 6px; }
.chips.scroll {
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
  scroll-snap-type: x proximity;
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 7px 12px; cursor: pointer;
  font-size: .9rem; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--card2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.75); }
.dot.p { background: var(--p); } .dot.pt { background: var(--pt); } .dot.r { background: var(--r); }
.dot.c { background: var(--c); } .dot.l { background: var(--l); } .dot.team { background: conic-gradient(var(--p) 0 20%, var(--pt) 0 40%, var(--r) 0 60%, var(--c) 0 80%, var(--l) 0); }

.rot-row { display: flex; align-items: center; gap: 6px; }
.chips.rot { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.rotchip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 5px 0 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  font-weight: 800; font-size: 1.05rem; line-height: 1.1;
}
.rotchip small { font-size: .62rem; font-weight: 600; color: var(--muted); }
.rotchip[aria-pressed="true"] { border-color: var(--accent); background: #fff7d6; color: var(--accent-ink); }
.rotchip[aria-pressed="true"] small { color: var(--accent-ink); }

.icon-btn {
  flex: 0 0 auto; width: 38px; height: 42px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); cursor: pointer;
  font-size: 1.5rem; line-height: 1; display: grid; place-items: center;
}
.icon-btn.big { width: 46px; height: 46px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 9px 6px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #1b1300; }

/* ---------- Terrain SVG ---------- */
.court-box {
  background: linear-gradient(180deg, #24597a, #1d4a66);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(19,35,58,.18);
  display: flex; justify-content: center;
}
#court { display: block; width: 100%; height: auto; max-height: 66vh; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#court text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.token { cursor: default; }
.draggable .token.on { cursor: grab; touch-action: none; }
.token.dragging { cursor: grabbing; }

.phasebar { display: grid; gap: 8px; margin-top: 10px; }
.phase-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ph-btn {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 8px;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 11px; cursor: pointer;
  font-weight: 700; font-size: .86rem; line-height: 1.15; text-align: left; box-shadow: var(--shadow);
}
.ph-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); font-size: .75rem; font-weight: 900; color: var(--muted); }
.ph-btn[aria-pressed="true"] { border-color: var(--accent); background: #fff7d6; color: var(--accent-ink); }
.ph-btn[aria-pressed="true"] .ph-num { background: var(--accent); color: #1b1300; }
.play-btn {
  min-height: 44px; border-radius: 11px; border: 0; cursor: pointer;
  background: var(--accent); color: #1b1300; font-size: .95rem; font-weight: 800;
}
.play-btn.playing { background: var(--bad); color: #fff; }

.legal { margin-top: 10px; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: .92rem; border: 1.5px solid; display: flex; gap: 10px; align-items: flex-start; }
.legal.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.legal.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.legal .reset { margin-left: auto; flex: 0 0 auto; }
.legal-txt { flex: 1; }
.legal-txt small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }

/* ---------- Carte d'explication ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.info .card + .card { margin-top: 10px; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who-name { font-weight: 800; font-size: 1.08rem; }
.badge { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .03em; padding: 3px 8px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.badge.front { background: #ffedd5; border-color: #fb923c; color: #9a3412; }
.badge.back { background: #dbeafe; border-color: #60a5fa; color: #1e3a8a; }
.badge.serve { background: var(--accent); border-color: var(--accent); color: #1b1300; }
.badge.bench { background: #e5e7eb; border-color: #9ca3af; color: #374151; }
.phase-desc { margin: 10px 0 0; color: var(--muted); font-size: .93rem; }
.todo { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.todo li { position: relative; padding: 9px 10px 9px 38px; background: var(--card2); border-radius: 10px; }
.todo li::before { content: attr(data-i); position: absolute; left: 9px; top: 8px; width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: #1b1300; font-weight: 900; font-size: .8rem; display: grid; place-items: center; }
.todo li.warn::before { content: "!"; background: var(--bad); color: #fff; }
.todo li.rule-li::before { content: "§"; background: var(--r); color: #fff; }
.constraints { margin-top: 12px; }
.constraints h4 { margin: 0 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.constraints ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.constraints li { display: flex; gap: 8px; align-items: center; font-size: .93rem; }
.arrow-ic { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; background: var(--card2); font-weight: 900; }
.team-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.team-list li { display: flex; gap: 9px; align-items: flex-start; font-size: .92rem; }
.team-list .dot { margin-top: 3px; }
.team-list b { white-space: nowrap; }


.legend { margin-top: 10px; }
.legend-title { font-weight: 700; margin-bottom: 8px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .88rem; }
.legend-items span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Règles ---------- */
.rules { display: grid; gap: 12px; }
.rules h2 { margin: 0 0 6px; font-size: 1.25rem; }
.rules h3 { margin: 0 0 8px; font-size: 1.08rem; padding-right: 36px; }
.rules p { margin: 8px 0 0; }
.rules ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.rule { position: relative; }
.rule.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rule-num { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 800; color: var(--accent-ink); }
.ref { color: var(--muted); font-size: .8em; white-space: nowrap; }
.tip { background: var(--card2); padding: 9px 11px; border-radius: 10px; }
.mini-court { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 360px; margin: 6px auto 4px; background: #e8955a; padding: 4px; border-radius: 8px; border: 2px solid #fff; position: relative; }
.mini-court .net { grid-column: 1 / -1; text-align: center; font-size: .7rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #fff; background: #1f2937; border-radius: 4px; padding: 2px 0; }
.mz { background: rgba(255,255,255,.18); border-radius: 6px; padding: 8px 4px; text-align: center; font-size: 1.5rem; font-weight: 900; color: #3b1d06; line-height: 1.1; }
.mz small { display: block; font-size: .64rem; font-weight: 700; }
.mz.front { background: rgba(255,255,255,.32); }
.arrows .mz { font-size: 1.25rem; }
.arrows .mz b { color: #0f3b8c; }
.two { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 4px; }
.pill-box { border-radius: 12px; padding: 10px; font-size: .9rem; }
.pill-box.recv { background: color-mix(in srgb, var(--r) 20%, transparent); border: 1.5px solid var(--r); }
.pill-box.serve { background: color-mix(in srgb, var(--ok) 16%, transparent); border: 1.5px solid var(--ok); }
.postes { margin: 4px 0 0; display: grid; gap: 8px; }
.postes div { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; align-items: start; }
.postes dt { font-weight: 800; grid-column: 2; }
.postes dd { margin: 0; grid-column: 2; color: var(--muted); font-size: .92rem; }
.postes .dot { grid-row: 1; grid-column: 1; margin-top: 4px; }
.sources ul { padding-left: 18px; }

/* ---------- Quiz ---------- */
.quiz { max-width: 640px; margin: 0 auto; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; }
.quiz-head h2 { margin: 0; }
.score { font-weight: 800; background: var(--card2); border-radius: 999px; padding: 4px 12px; }
.q-text { font-size: 1.08rem; font-weight: 700; margin: 12px 0; }
.q-opts { display: grid; gap: 8px; }
.q-opt { text-align: left; border: 1.5px solid var(--line); background: var(--card2); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.q-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 20%, transparent); }
.q-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 18%, transparent); }
.q-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #e8955a; padding: 6px; border-radius: 10px; border: 2px solid #fff; max-width: 340px; margin: 0 auto; }
.q-grid .net { grid-column: 1 / -1; text-align: center; font-size: .7rem; font-weight: 800; letter-spacing: .2em; color: #fff; background: #1f2937; border-radius: 4px; padding: 2px 0; }
.q-zone { border: 2px solid transparent; background: rgba(255,255,255,.3); border-radius: 8px; padding: 16px 4px; font-size: 1.5rem; font-weight: 900; color: #3b1d06; cursor: pointer; }
.q-zone.right { border-color: #065f46; background: #6ee7b7; }
.q-zone.wrong { border-color: #7f1d1d; background: #fca5a5; }
.q-feedback { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card2); }
.q-feedback.ok { border-left: 4px solid var(--ok); }
.q-feedback.ko { border-left: 4px solid var(--bad); }
.quiz-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; cursor: pointer; background: var(--card2); }
.btn.primary { background: var(--accent); color: #1b1300; }
.btn.small-btn { padding: 6px 10px; font-size: .82rem; border-radius: 9px; border: 1px solid var(--line); }

.foot { text-align: center; padding: 18px var(--gutter) 10px; }

/* ---------- Équipe ---------- */
.chip.ghost { border-style: dashed; color: var(--muted); }
.who-role { font-size: .8rem; font-weight: 700; color: var(--muted); margin-left: 4px; }
.slot-pick { margin-top: 10px; display: grid; gap: 6px; }
.seg.mini button { padding: 7px 6px; font-size: .9rem; }
.team, .how { max-width: 720px; margin: 0 auto; }
.how { margin-top: 12px; }
.how h3 { margin: 0 0 6px; }
.how ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.team-head { display: flex; justify-content: space-between; align-items: center; }
.team-head h2 { margin: 0; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.add-row input, .add-row select, .players select {
  font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; min-width: 0; width: 100%;
}
.add-row .btn { grid-column: 1 / -1; }
.hint { color: var(--accent-ink); margin: 8px 0 0; min-height: 0; }
.hint:empty { display: none; }
.empty { text-align: center; padding: 18px 0 6px; }
.role-group { margin-top: 14px; }
.role-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.role-head .count { margin-left: auto; font-size: .8rem; color: var(--muted); background: var(--card2); border-radius: 999px; padding: 1px 9px; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; grid-template-areas: "name me del" "role role role";
  gap: 6px 8px; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px;
}
.players li.me { border-color: var(--accent); }
.pname { grid-area: name; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players select { grid-area: role; padding: 7px 9px; font-size: .9rem; }
.players [data-me] { grid-area: me; }
.icon-del { grid-area: del; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 1.2rem; color: var(--muted); }
.team-actions { display: grid; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; max-width: calc(100% - 32px); background: #111827; color: #fff; border: 1px solid var(--accent);
  border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .92rem; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
@media (min-width: 600px) {
  .add-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .add-row .btn { grid-column: auto; }
  .players li { grid-template-columns: minmax(0, 1fr) 260px auto 34px; grid-template-areas: "name role me del"; }
  .team-actions { grid-template-columns: 1fr 1fr; }
}

/* ---------- Grand écran (PC / tablette) ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; }
  .tabs button { flex-direction: row; gap: 7px; font-size: .95rem; padding: 8px 14px; border-radius: 10px; }
  .tabs .ti { font-size: 1rem; }
  .tabs button[aria-selected="true"] { background: var(--card); }
  main { padding-top: 18px; }
  .layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-areas: "court controls" "court info";
    grid-template-rows: auto 1fr;
    align-items: start; column-gap: 22px;
  }
  .court-wrap { position: sticky; top: 76px; }
  #court { max-height: calc(100vh - 190px); }
  .chips.scroll { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
  .legend { max-width: calc(50% - 11px); margin-left: auto; }
  .rules { grid-template-columns: 1fr 1fr; align-items: start; }
  .rule-intro, .sources { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .two { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tab { animation: none; }
}

.unlock { margin-top: 12px; display: grid; gap: 7px; font-size: .9rem; background: var(--card2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.unlock-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.unlock input { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.players.ro li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name me"; }
@media (min-width: 600px) { .players.ro li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name me"; } }

/* ---------- Je suis ---------- */
.me-bar {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 12px; box-shadow: var(--shadow);
}
.me-bar .dot { width: 22px; height: 22px; }
.me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.me-txt b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-change { flex: 0 0 auto; font-weight: 800; font-size: .85rem; color: var(--accent-ink); background: #fff7d6; border: 1px solid var(--accent); border-radius: 999px; padding: 5px 11px; }

/* ---------- Écran « Qui es-tu ? » ---------- */
body.modal-open { overflow: hidden; }
.chooser {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.chooser-box {
  max-width: 640px; min-height: 100%; margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  animation: rise .25s ease;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.chooser-logo { width: 64px; height: 64px; display: block; margin: 0 auto 10px; }
.chooser-box h2 { margin: 0; font-size: 2rem; text-align: center; }
.chooser-box > p { text-align: center; font-size: 1rem; margin: 6px 0 4px; }
.chooser-box h3 { margin: 22px 0 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; }
.ch-group { margin-top: 14px; }
.ch-role { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 1rem; margin-bottom: 8px; }
.ch-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 7px; }
.ch-name, .ch-slot {
  min-height: 54px; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; cursor: pointer;
  font-weight: 700; font-size: 1.08rem; padding: 6px 10px; box-shadow: var(--shadow);
}
.ch-name.on, .ch-slot.on { border-color: var(--accent); background: #fff7d6; }
.chooser-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ch-slot { display: flex; align-items: center; gap: 8px; text-align: left; font-size: .92rem; }
.btn.wide { width: 100%; margin-top: 14px; border: 1.5px solid var(--line); }
@media (min-width: 600px) {
  .chooser-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .phase-btns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.phase-btns.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .phase-btns.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ch-empty { text-align: center; margin-top: 14px; }
.ch-empty p { margin: 0 0 4px; }
