/* Onglets du salon et barre d'onglets. (chargé après 06-master.css, l'ordre compte pour la cascade) */

/* ---------- Salon : menu à onglets (Salon, Mode, Terrain, Réglages) ---------- */
.lobby-tabs {
  display: none !important;
  position: sticky;
  top: -4px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: -4px -16px 0;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.lobby-tab {
  font: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.lobby-tab .ic {
  width: 22px;
  height: 22px;
}
.lobby-tab:hover {
  background: var(--surface-2);
}
.lobby-tab.active {
  background: var(--accent);
  color: var(--on-accent);
}
.tab-dot {
  position: absolute;
  top: 5px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
}
.lobby-tab.active .tab-dot {
  border-color: var(--accent);
}
.tab-dot.warn {
  background: var(--warn);
}
.lobby-pane {
  display: flex;
  flex-direction: column;
}
.checklist button.chip {
  font: inherit;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
}

/* Salon : invitation et joueurs */
.invite-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 10px 14px;
}
.invite-code {
  flex: 1;
  min-width: 0;
}
.invite-code .code-big {
  font-size: 1.5rem;
  line-height: 1.2;
}
.invite-copy {
  padding-left: 12px;
  padding-right: 12px;
}
.invite-li {
  border-top: 1px solid var(--surface-2);
}
.invite-row {
  font: inherit;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px 0;
}
.invite-row:hover .row-title {
  text-decoration: underline;
}
.avatar.add {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed var(--line);
}
.avatar.add::after {
  display: none;
}
.avatar.add .ic {
  width: 20px;
  height: 20px;
}

/* Onglet Terrain : barre d'outils sur la carte (ce que pose un appui) */
.terrain-bar {
  position: absolute;
  z-index: 1000;
  top: calc(var(--top-h) + 8px);
  left: 12px;
  right: 64px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}
.terrain-tools {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  width: 100%;
}
.terrain-tool {
  font: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.terrain-tool .ic {
  width: 20px;
  height: 20px;
}
.terrain-tool.active {
  background: var(--accent);
  color: var(--on-accent);
}
.terrain-hint {
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.replaying .terrain-bar {
  display: none;
}

/* Onglet Terrain : étapes guidées */
.step-list {
  gap: 8px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 12px;
}
.step-card.open {
  border: 2px solid var(--accent);
  padding: 3px 11px 12px;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-open {
  font: inherit;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.step-open .row-main {
  display: flex;
  flex-direction: column;
}
.step-open .row-title {
  font-weight: 700;
}
.step-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--surface-2);
  color: var(--muted);
}
.step-n .ic {
  width: 16px;
  height: 16px;
}
.step-n.cur {
  background: var(--accent);
  color: var(--on-accent);
}
.step-n.done {
  background: var(--ok);
  color: #fff;
}
.step-n.warn {
  background: var(--danger);
  color: #fff;
}
.step-act {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875rem;
  flex: none;
}
.step-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* Onglet Réglages : tuiles par thème et page d'un thème */
.rule-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rule-tile {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 88px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.rule-tile:hover {
  background: var(--surface-2);
}
.rule-tile.off {
  opacity: 0.6;
  border-style: dashed;
}
.rule-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}
.rule-head .ic {
  width: 18px;
  height: 18px;
}
.rule-desc {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}
.back-bar {
  font: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
}
.back-bar .ic {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
}
.back-bar .back-mode {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Barre d'onglets : le salon du master lance la partie depuis l'action centrale ---------- */
.sheet-footer #startBtn {
  display: none;
}
.sheet-footer:not(:has(.checklist)) {
  display: none;
}
.replaying #tabbar,
.replaying #ribbon {
  display: none !important;
}
.terrain-tool.active {
  background: var(--text);
  color: var(--bg);
}
.terrain-hint {
  background: var(--text);
  color: var(--bg);
}
.lobby-tab.active {
  background: var(--text);
  color: var(--bg);
}
.step-card.open {
  border-color: var(--text);
}
.step-n.cur {
  background: var(--accent);
  color: var(--on-accent);
}
.step-n.done {
  background: var(--text);
  color: var(--bg);
}
.step-act {
  color: var(--accent-strong);
}
.rule-head {
  font: 800 0.9rem var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.list-item .ic {
  color: var(--text);
}
.leaflet-marker-icon > .pic {
  width: 100%;
  height: 100%;
  position: relative;
}
.leaflet-marker-icon > .reveal-pin,
.leaflet-marker-icon > .drop-pin,
.leaflet-marker-icon > .sprint-pin,
.leaflet-marker-icon > .bomb-pin,
.leaflet-marker-icon > .zone-pin {
  align-items: center;
  justify-content: center;
}
