/*
 * Orbitale — pages où l'on joue (solo, défi du jour, défi entre amis, duel,
 * entraînement) et zone de jeu.
 *
 * Contraintes du réseau :
 *   - #app reste à 800 px hors partie : au-delà, les blocs latéraux fixes
 *     (Infos, Jeux à la une) recouvrent le contenu dès 1280 px. Pendant la
 *     partie ils sont masqués.
 *   - padding horizontal de #app jamais sous 24 px : le banner partagé sort
 *     du conteneur avec des marges négatives calées sur cette valeur.
 *   - pas d'animation continue d'interface, pas d'ombre colorée, pas de flou.
 */

* { box-sizing: border-box; }

body.page-orbitale {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, #1c2560 0%, #0f1438 55%, #070a1d 100%);
  color: #e8edff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.page-orbitale #app {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.page-orbitale h1 { font-size: 1.6rem; color: #ffffff; margin: 8px 0 12px; text-align: center; }
.page-orbitale h2 { font-size: 1.1rem; color: #c9d6ff; margin: 18px 0 8px; }
.page-orbitale a { color: #7df9ff; }

.setup-intro {
  color: #d3dbf8;
  line-height: 1.6;
  font-size: 0.95rem;
  text-align: center;
  margin: 0 auto 16px;
  max-width: 62ch;
}
.message-partie { min-height: 1.2em; text-align: center; color: #ffe066; font-size: 0.92rem; margin: 10px 0; }
.resume-record { text-align: center; color: #e8edff; font-size: 0.95rem; margin: 0 0 8px; }
.resume-record strong { color: #7df9ff; }
.lien-mode { text-align: center; margin: 14px 0 4px; font-size: 0.95rem; }
.date-titre { text-align: center; color: #c9d6ff; margin: -4px 0 14px; }

/* ---- Boutons ---------------------------------------------------------------- */
.or-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0; }
.or-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 2px solid #7df9ff;
  border-radius: 999px;
  background: #7df9ff;
  color: #071026;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.or-btn small { font-weight: 600; font-size: 0.75rem; opacity: 0.75; }
.or-btn.grand { min-height: 54px; padding: 12px 30px; font-size: 1.1rem; }
.or-btn.secondaire { background: transparent; color: #e8edff; border-color: rgba(201, 214, 255, 0.45); }
.or-btn:hover, .or-btn:focus-visible { outline: none; border-color: #ffffff; }
.or-btn.secondaire:hover, .or-btn.secondaire:focus-visible { border-color: #7df9ff; color: #ffffff; }
.or-btn[disabled] { opacity: 0.5; cursor: default; }
.page-orbitale a.or-btn { color: #071026; }
.page-orbitale a.or-btn.secondaire { color: #e8edff; }

/* ---- Entraînement : choix du niveau ----------------------------------------- */
.choix-niveau {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.choix-niveau .or-btn { border-radius: 14px; min-height: 70px; gap: 2px; }

/* ---- Duel : salons -------------------------------------------------------------- */
.choix-duel { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.carte-mode {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 14px; border-radius: 16px; border: 2px solid #3f51c9; background: #151c4a;
  color: #e8edff; font: inherit; cursor: pointer; text-align: center;
}
.carte-mode:hover, .carte-mode:focus-visible { border-color: #7df9ff; outline: none; }
.mode-glyphe { font-size: 1.6rem; }
.mode-nom { font-weight: 800; font-size: 1.05rem; }
.mode-resume { font-size: 0.85rem; color: #c9d6ff; }
.rejoindre-code { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 10px 0; }
.champ-code, .champ-lien {
  min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid #3f51c9;
  background: #0b1026; color: #ffffff; font: inherit;
}
.champ-code { width: 7.5em; text-transform: uppercase; letter-spacing: 0.25em; text-align: center; font-weight: 800; }
.champ-lien { flex: 1 1 260px; min-width: 0; }
.bloc-code { text-align: center; margin: 10px 0; }
.bloc-code-label { color: #c9d6ff; margin: 0; }
.bloc-code-valeur { font-size: 2.4rem; font-weight: 900; letter-spacing: 0.3em; color: #7df9ff; margin: 4px 0; }
.setup-aide { margin-top: 20px; color: #d3dbf8; line-height: 1.6; font-size: 0.93rem; }
#attente { text-align: center; }
#attente[hidden], #lobby[hidden] { display: none; }

/* ---- Défi du jour --------------------------------------------------------------- */
.defi-compte { text-align: center; line-height: 1.6; }
.defi-variante {
  text-align: center; margin: 0 auto 10px; padding: 8px 14px; max-width: 60ch;
  border-radius: 10px; background: rgba(199, 125, 255, 0.12); border: 1px solid rgba(199, 125, 255, 0.35);
}
.defi-etat { text-align: center; line-height: 1.6; }
.defi-etat strong { color: #7df9ff; }
.classement-section {
  margin: 22px 0;
  padding: 14px 16px;
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.classement-section[hidden] { display: none; }
.classement-section h2 { text-align: center; margin-top: 0; }
.classement-invite, .classement-lien { text-align: center; }
.defi-intro { line-height: 1.6; color: #d3dbf8; }

/* ---- Zone de jeu dans la page -------------------------------------------------- */
.zone-jeu { margin: 6px auto 18px; }
.zone-jeu[hidden] { display: none; }
body.or-en-partie .bandeau-infos-wrap,
body.or-en-partie .bloc-jeux-une-wrap { display: none !important; }

.orbitale {
  margin: 0 auto;
  max-width: min(100%, calc(100vh - 150px), 640px);
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background: #0b1026;
  color: #f1f4ff;
  border-radius: 14px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.or-hud, .or-adv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.or-hud { background: #141a44; border-bottom: 2px solid #26318a; min-height: 36px; }
.or-adv { background: #1d1440; border-bottom: 2px solid #4b2a85; font-size: 0.85rem; }
.or-adv-nom { font-weight: 800; color: #e2c2ff; }
.or-adv-manches { margin-left: auto; }
.or-hud-lib { opacity: 0.7; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
#hud-score { color: #7df9ff; font-size: 1.05rem; }
.or-multi { font-weight: 900; padding: 1px 8px; border-radius: 999px; background: #26318a; }
.or-multi[data-anneau="0"] { background: #ffd84d; color: #1a1033; }
.or-multi[data-anneau="1"] { background: #ffb547; color: #1a1033; }
.or-chaine { color: #ffd84d; font-weight: 800; }
.or-chaine[hidden], .or-bouclier[hidden] { display: none; }

.or-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  touch-action: manipulation;
  cursor: pointer;
}
.or-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.or-annonce {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  max-width: 90%; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(11, 16, 38, 0.85); border: 1px solid rgba(125, 249, 255, 0.4);
  font-weight: 700; font-size: 0.9rem; text-align: center; pointer-events: none;
}
.or-annonce[hidden] { display: none; }

.or-outils { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.or-outils button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(201, 214, 255, 0.35);
  background: rgba(11, 16, 38, 0.75); color: #e8edff; font-size: 1.05rem; cursor: pointer;
}
.or-outils button:hover, .or-outils button:focus-visible { border-color: #7df9ff; outline: none; }
.or-outils button[hidden] { display: none; }
.orbitale:not(.partie-lancee) #btn-pause { display: none; }

.or-voile {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(7, 10, 29, 0.78); cursor: default;
}
.or-voile[hidden] { display: none; }
.or-carte {
  width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto;
  padding: 18px 18px 14px; border-radius: 16px; background: #141a44; border: 1px solid #3f51c9;
  text-align: center;
}
.or-carte:focus { outline: none; }
.or-carte h2 { margin: 0 0 8px; color: #ffffff; font-size: 1.3rem; }
.or-titre { font-size: 1.5rem; }
.or-sous-titre { color: #c9d6ff; margin: 0 0 8px; }
.or-commandes { font-size: 0.86rem; line-height: 1.5; color: #d3dbf8; margin: 6px 0; }
.or-debut-message { color: #ffe066; min-height: 1em; margin: 6px 0; }
.mode-entrainement .or-note-classee { display: none; }
.score-final { font-size: 2rem; font-weight: 900; color: #7df9ff; margin: 4px 0 8px; }
.score-final small { font-size: 0.9rem; color: #c9d6ff; font-weight: 600; }
.bilan table { margin: 0 auto; border-collapse: collapse; font-size: 0.9rem; }
.bilan th { text-align: left; font-weight: 500; color: #c9d6ff; padding: 3px 12px 3px 0; }
.bilan td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.or-fin-statut { margin: 10px 0 4px; line-height: 1.5; font-size: 0.92rem; }
.or-fin-statut.ok strong { color: #7df9ff; }
.or-fin-statut.erreur { color: #ff8a9a; }
.or-fin-statut.attente { color: #c9d6ff; }

/* Plein écran : la scène prend la plus grande taille carrée possible. */
.orbitale:fullscreen { max-width: none; width: 100vw; height: 100vh; border-radius: 0; justify-content: center; align-items: center; }
.orbitale:fullscreen .or-hud, .orbitale:fullscreen .or-adv { width: min(100vw, 100vh - 80px); }
.orbitale:fullscreen .or-scene { width: min(100vw, calc(100vh - 80px)); }

@media (max-width: 600px) {
  .or-hud { gap: 2px 10px; font-size: 0.82rem; }
  .orbitale { max-width: 100%; }
}
