/* ==========================================================================
   2256 : HOMO SYNTHÉSIS — BASE UI
   Palette et grammaire visuelle communes à toutes les interfaces.
   Inspiré des interfaces 2256 / Nimbus existantes.
   ========================================================================== */

:root {

  /* Archive temporelle — variables partagées Joueur + Table */
  --hs-archive-content-filter: saturate(.42) contrast(.96);
  --hs-archive-text-color: #9aa7a4;
  --hs-archive-portrait-filter: grayscale(0.5) sepia(1) hue-rotate(164deg) saturate(6) contrast(0.7);
  --hs-archive-overlay-line: rgba(133,188,198,.025);
  --hs-archive-overlay-tint-top: rgba(53,128,143,.08);
  --hs-archive-overlay-tint-bottom: rgba(22,70,82,.08);
  --hs-archive-scan-color: rgba(157,217,226,.07);
  --hs-archive-accent: #b88b48;
  --hs-archive-accent-soft: rgba(184,139,72,.20);
  /* Couleurs */
  --hs-fond: #141c1c;
  --hs-fond-sombre: #0d1414;
  --hs-surface: #111b1b;
  --hs-surface-claire: #162120;

  --hs-accent: #49adb6;
  --hs-accent-fonce: #137680;
  --hs-accent-doux: rgba(73, 173, 182, 0.12);
  --hs-accent-ligne: rgba(73, 173, 182, 0.35);
  --hs-accent-fort: rgba(73, 173, 182, 0.62);

  --hs-secondaire: #b16517;
  --hs-danger: #b0432e;

  --hs-texte: #fcfbe4;
  --hs-texte-muted: #8a9a8a;
  --hs-texte-faded: rgba(252, 251, 228, 0.55);

  /* Typographies */
  --hs-font-texte: Roboto, Arial, sans-serif;
  --hs-font-titre: Oswald, "Arial Narrow", sans-serif;
  --hs-font-mono: "IBM Plex Mono", Consolas, monospace;
  --hs-font-serif: "Source Serif 4", Georgia, serif;

  /* Dimensions */
  --hs-page: 1120px;
  --hs-gap: 18px;

  /* Effets */
  --hs-ombre: 0 16px 50px rgba(0, 0, 0, 0.36);
  --hs-glow: 0 0 30px rgba(73, 173, 182, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--hs-fond-sombre);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(13, 20, 20, 0.96), rgba(13, 20, 20, 0.96)),
    repeating-linear-gradient(
      135deg,
      #16211f 0 4px,
      #0f1918 4px 10px
    );
  color: var(--hs-texte);
  font-family: var(--hs-font-texte);
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border-radius: 0;
}

a {
  color: var(--hs-accent);
  text-decoration: none;
}

a:hover {
  color: var(--hs-texte);
}

::selection {
  background: var(--hs-accent);
  color: var(--hs-fond-sombre);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--hs-fond-sombre);
}

::-webkit-scrollbar-thumb {
  background: #22302f;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--hs-accent);
}

.hs-app {
  min-height: 100vh;
}


/* ==========================================================================
   DÉCOR D'INTERFACE COMMUN — CIRCUITS
   Lobby / Joueur / MJ

   UTILISATION :
   ajouter la classe `.hs-interface-background` au conteneur principal
   de la vue concernée.

   RÉGLAGES RAPIDES :
   - `--hs-circuit-top-width`    = taille du motif en HAUT À DROITE
   - `--hs-circuit-top-height`   = hauteur de sa zone
   - `--hs-circuit-bottom-width` = taille du motif en BAS À GAUCHE
   - `--hs-circuit-bottom-height`= hauteur de sa zone
   - les deux variables `opacity` permettent de régler leur présence

   Les PNG restent des éléments purement décoratifs : ils ne captent aucun clic.
   Le filtre inverse les lignes sombres des assets pour les rendre gris/blanc
   sur le fond sombre ; `screen` les fond ensuite dans l'interface.
   ========================================================================== */

.hs-interface-background {
  /* ----- TAILLE DES DEUX BACKGROUNDS : modifier ici en priorité ----- */
  --hs-circuit-top-width: min(36vw, 560px);
  --hs-circuit-top-height: min(54vw, 535px);
  --hs-circuit-bottom-width: min(38vw, 590px);
  --hs-circuit-bottom-height: min(56vw, 565px);

  /* ----- VISIBILITÉ ----- */
  --hs-circuit-top-opacity: 0.18;
  --hs-circuit-bottom-opacity: 0.16;

  position: relative;
  isolation: isolate;
}

.hs-interface-background::before,
.hs-interface-background::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  filter: grayscale(1) invert(1) brightness(1.25) contrast(0.9);
  mix-blend-mode: screen;
}

/* Motif n°1 : HAUT À DROITE */
.hs-interface-background::before {
  bottom: 0;
  right: 0;
  width: var(--hs-circuit-top-width);
  height: var(--hs-circuit-top-height);
  background-image: url("../img/ui/interface-circuit-top-left.png");
  background-position: right bottom;
  opacity: var(--hs-circuit-top-opacity);
}

/* Motif n°2 : BAS À GAUCHE */
.hs-interface-background::after {
  left: 0;
  top: 0;
  width: var(--hs-circuit-bottom-width);
  height: var(--hs-circuit-bottom-height);
  background-image: url("../img/ui/interface-circuit-bottom-right.png");
  background-position: right top;
  opacity: var(--hs-circuit-bottom-opacity);
  transform: scaleX(-1);
}

/* Le contenu de l'interface reste systématiquement au-dessus du décor. */
.hs-interface-background > * {
  position: relative;
  z-index: 1;
}

.hs-shell {
  width: min(var(--hs-page), calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hs-brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--hs-accent-ligne);
  padding-bottom: 14px;
}

.hs-brand__titre {
  margin: 0;
  color: var(--hs-texte);
  font-family: var(--hs-font-titre);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.hs-brand__code {
  color: var(--hs-accent);
  font-family: var(--hs-font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hs-logo-lockup {
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-logo-lockup__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.hs-title {
  margin: 0 0 18px;
  color: var(--hs-texte);
  font-family: var(--hs-font-titre);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hs-subtitle {
  margin: 0 0 12px;
  color: var(--hs-texte);
  font-family: var(--hs-font-titre);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hs-meta {
  color: var(--hs-texte-muted);
  font-family: var(--hs-font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.hs-muted {
  color: var(--hs-texte-muted);
}

.hs-cache {
  display: none !important;
}

@media (max-width: 720px) {
  .hs-shell {
    width: min(100% - 24px, var(--hs-page));
    padding-top: 24px;
  }

  .hs-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   CONTRÔLES D'AFFICHAGE COMMUNS — PLEIN ÉCRAN
   Lobby / Joueur / MJ / Table

   Le JavaScript associé est `web/js/ui-shell.js`.
   Le bouton ne touche qu'à l'API Fullscreen du navigateur : aucune logique
   de partie, de carte ou d'interaction MJ n'est liée à ce composant.

   Deux présentations :
   - normale : icône + texte (Lobby)
   - compacte : icône seule (headers Joueur/MJ et Table)
   ========================================================================== */

.hs-header-display-control {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.hs-header-display-control--compact {
  min-height: 66px;
  border-left: 1px solid #22302f;
}

.hs-fullscreen-button {
  min-height: 32px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #2a3a39;
  background: transparent;
  color: var(--hs-texte-muted);
  cursor: pointer;
  font-family: var(--hs-font-titre);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hs-fullscreen-button:hover,
.hs-fullscreen-button:focus-visible,
.hs-fullscreen-button[aria-pressed="true"] {
  color: var(--hs-accent);
  border-color: var(--hs-accent-ligne);
  background: var(--hs-accent-doux);
  outline: none;
}

.hs-fullscreen-button__icon {
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.hs-fullscreen-button--compact {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.hs-fullscreen-button--compact .hs-fullscreen-button__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* La Table n'a volontairement pas de header : son bouton flotte en haut à droite. */
.hs-table-display-control {
  position: fixed;
  z-index: 2000;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  pointer-events: auto;
}

/* En mode PWA standalone, le navigateur masque déjà sa barre d'adresse.
   Le bouton reste disponible lorsque l'API Fullscreen existe réellement. */
@media (display-mode: standalone) {
  .hs-fullscreen-button {
    opacity: .82;
  }
}

/* ==========================================================================
   RESPONSIVE COMMUN — HEADERS HORS TABLE
   ========================================================================== */
@media (max-width: 1050px) {
  .hs-header-display-control--compact {
    padding-left: 6px;
    padding-right: 6px;
  }
}
@media (max-width: 700px) {
  .hs-header-display-control--compact {
    min-height: 52px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .hs-fullscreen-button--compact {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }
}
/* Sélecteurs de fichiers natifs harmonisés avec la DA sur toutes les vues. */
input[type="file"] {
  color: var(--hs-texte-muted);
  font-family: var(--hs-font-mono);
  font-size: 10px;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(73, 173, 182, .42);
  background: rgba(9, 31, 33, .92);
  color: var(--hs-accent);
  cursor: pointer;
  font-family: var(--hs-font-titre);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--hs-accent);
  background: var(--hs-accent-doux);
}
