/* ===============================
   Tron – styles spécifiques
   =============================== */

.tr-root {
  /* Barre commune (css/games.css) aux couleurs de la grille */
  --mg-jeu-largeur: 864px;
  --mgb-fond: radial-gradient(120% 160% at 0% 0%, rgba(39, 232, 255, 0.22), transparent 55%),
    linear-gradient(120deg, #02050b, #0c1f3a);
  --mgb-texte: #e3f4ff;
  --mgb-doux: #8aa5c4;
  --mgb-accent: #27e8ff;
  --mgb-titre: linear-gradient(100deg, #27e8ff, #9ff6ff 50%, #ff8a3d);
  --mgb-police-titre: "Orbitron", "Madimi One", sans-serif;
  --mg-fs-fond: radial-gradient(circle at 50% 40%, #0c1f3a, #02050b);
  --mg-bulle-fond: #0b1a2e;
  align-items: center;
}

.tr-root .mg-barre-titre {
  font-weight: 900;
  letter-spacing: 0.06em;
}

.tr-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* Carte d'un pilote : nom, manches gagnées, jauge de turbo */
.tr-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 96px;
  padding: 4px 12px 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border-top: 3px solid var(--c);
  box-sizing: border-box;
  transition: opacity 0.3s;
}

.tr-chip.tr-out {
  opacity: 0.45;
}

.tr-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tr-name {
  font-family: "Orbitron", "Madimi One", sans-serif;
  font-weight: 700;
  font-size: 0.82em;
  color: #fff;
  white-space: nowrap;
}

.tr-pips {
  display: flex;
  gap: 3px;
}

.tr-pips i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
  box-sizing: border-box;
}

.tr-pips i.on {
  background: var(--c);
  box-shadow: 0 0 5px var(--c);
}

.tr-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.tr-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--c);
  border-radius: 3px;
}

#tr-help {
  font-family: "Orbitron", "Madimi One", sans-serif;
  font-weight: 900;
  font-size: 20px;
}

.tr-canvas-wrap {
  position: relative;
}

#tr-canvas {
  display: block;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(39, 232, 255, 0.35),
    0 6px 28px rgba(0, 60, 120, 0.45);
  background: #03060d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

/* ---------- Options de partie ---------- */
.tr-options {
  justify-content: center;
  gap: 10px 18px;
}

.tr-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tr-opt-lbl {
  font-size: 0.72em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7a8494;
}

.tr-seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  background: #eef2f8;
  border-radius: 10px;
}

.tr-seg button {
  border: none;
  border-radius: 7px;
  background: transparent;
  padding: 6px 10px;
  font-weight: bold;
  font-size: 0.9em;
  color: #445066;
  cursor: pointer;
  white-space: nowrap;
}

.tr-seg button:hover {
  background: #eef3f9;
}

.tr-seg button.sel {
  background: #0b1a2e;
  color: #27e8ff;
  box-shadow: 0 0 8px rgba(39, 232, 255, 0.35);
}

/* ---------- Modale d'aide ---------- */
.tr-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(2, 8, 20, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.tr-help-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #e8f7fb;
  color: #0b1a2e;
  font-size: 16px;
  cursor: pointer;
}

.tr-help-close:hover {
  background: #cfeef6;
}

.tr-help {
  position: relative;
  max-width: 640px;
  max-height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0;
  background: #fff;
  border-radius: 14px;
  padding: 16px 22px 18px 22px;
  color: #444;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  line-height: 1.45;
}

.tr-help-title {
  font-family: "Orbitron", "Madimi One", sans-serif;
  font-weight: 900;
  font-size: 1.25em;
  color: #0b1a2e;
  padding-right: 36px;
}

.tr-help p {
  margin: 6px 0 10px 0;
}

.tr-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 16px;
  font-size: 0.93em;
}

.tr-help-lv {
  font-size: 0.93em;
  margin-top: 12px !important;
}

/* ---------- Plein écran ---------- */

.tr-root.mg-fs {
  justify-content: center;
  overflow: hidden;
  --mgc-fond: rgba(255, 255, 255, 0.06);
  --mgc-bord: rgba(255, 255, 255, 0.1);
}

.tr-root.mg-fs .tr-opt-lbl {
  color: #9fb4cc;
}

@media (max-width: 560px) {
  .tr-chip {
    min-width: 80px;
    padding: 4px 8px 6px 8px;
  }
  .tr-seg button {
    padding: 6px 7px;
    font-size: 0.85em;
  }
}
