:root {
  /* HUD logo styling controls */
  --hud-logo-font-family: "futura", sans-serif;
  --hud-logo-font-weight: 900;
  --hud-logo-size-min: 20px;
  --hud-logo-size-preferred: 2vw;
  --hud-logo-size-max: 80px;

  --palette-0-0: rgb(238, 238, 228);
  --palette-0-1: rgb(149, 157, 114);
  --palette-0-2: rgb(240, 245, 181);
  --palette-0-3: rgb(174, 220, 249);
  --palette-0-4: rgb(186, 172, 83);
  --palette-0-5: rgb(124, 135, 81);
  --palette-0-6: rgb(255, 255, 246);
  --palette-0-7: rgb(255, 255, 255);
  --palette-0-8: rgb(221, 226, 83);
  --palette-0-9: rgb(208, 163, 38);

  --palette-1-0: rgb(84, 32, 5);
  --palette-1-1: rgb(255, 240, 210);
  --palette-1-2: rgb(255, 210, 120);
  --palette-1-3: rgb(255, 180, 60);
  --palette-1-4: rgb(255, 140, 40);
  --palette-1-5: rgb(255, 100, 40);
  --palette-1-6: rgb(255, 70, 70);
  --palette-1-7: rgb(220, 40, 90);
  --palette-1-8: rgb(255, 120, 160);
  --palette-1-9: rgb(255, 200, 190);

  --palette-2-0: rgb(3, 42, 67);
  --palette-2-1: rgb(200, 230, 255);
  --palette-2-2: rgb(40, 120, 255);
  --palette-2-3: rgb(0, 190, 255);
  --palette-2-4: rgb(0, 150, 220);
  --palette-2-5: rgb(0, 110, 190);
  --palette-2-6: rgb(0, 80, 160);
  --palette-2-7: rgb(0, 220, 180);
  --palette-2-8: rgb(80, 255, 220);
  --palette-2-9: rgb(160, 255, 240);

  --palette-3-0: rgb(15, 20, 15);
  --palette-3-1: rgb(220, 230, 210);
  --palette-3-2: rgb(100, 160, 90);
  --palette-3-3: rgb(60, 130, 70);
  --palette-3-4: rgb(30, 100, 60);
  --palette-3-5: rgb(90, 60, 30);
  --palette-3-6: rgb(140, 90, 50);
  --palette-3-7: rgb(190, 130, 80);
  --palette-3-8: rgb(230, 190, 130);
  --palette-3-9: rgb(255, 230, 180);

  --palette-4-0: rgb(170, 102, 153);
  --palette-4-1: rgb(240, 255, 255);
  --palette-4-2: rgb(80, 255, 255);
  --palette-4-3: rgb(80, 255, 140);
  --palette-4-4: rgb(180, 255, 100);
  --palette-4-5: rgb(255, 255, 80);
  --palette-4-6: rgb(255, 190, 80);
  --palette-4-7: rgb(255, 120, 180);
  --palette-4-8: rgb(200, 100, 255);
  --palette-4-9: rgb(150, 120, 255);

  --palette-5-0: rgb(220, 220, 230);
  --palette-5-1: rgb(250, 250, 250);
  --palette-5-2: rgb(200, 220, 255);
  --palette-5-3: rgb(210, 230, 200);
  --palette-5-4: rgb(255, 220, 200);
  --palette-5-5: rgb(255, 210, 230);
  --palette-5-6: rgb(230, 210, 255);
  --palette-5-7: rgb(210, 230, 255);
  --palette-5-8: rgb(255, 230, 230);
  --palette-5-9: rgb(230, 250, 220);

  --palette-6-0: rgb(77, 16, 16);
  --palette-6-1: rgb(255, 230, 200);
  --palette-6-2: rgb(255, 180, 120);
  --palette-6-3: rgb(255, 140, 80);
  --palette-6-4: rgb(255, 90, 40);
  --palette-6-5: rgb(220, 40, 20);
  --palette-6-6: rgb(160, 20, 20);
  --palette-6-7: rgb(120, 0, 20);
  --palette-6-8: rgb(210, 40, 100);
  --palette-6-9: rgb(255, 100, 160);

  --palette-7-0: rgb(15, 15, 15);
  --palette-7-1: rgb(240, 240, 240);
  --palette-7-2: rgb(210, 210, 210);
  --palette-7-3: rgb(180, 180, 180);
  --palette-7-4: rgb(150, 150, 150);
  --palette-7-5: rgb(120, 120, 120);
  --palette-7-6: rgb(90, 90, 90);
  --palette-7-7: rgb(60, 60, 60);
  --palette-7-8: rgb(30, 30, 30);
  --palette-7-9: rgb(200, 200, 200);

  --palette-8-0: rgb(126, 186, 143);
  --palette-8-1: rgb(94, 57, 161);
  --palette-8-2: rgb(210, 160, 255);
  --palette-8-3: rgb(255, 140, 210);
  --palette-8-4: rgb(255, 110, 140);
  --palette-8-5: rgb(255, 150, 100);
  --palette-8-6: rgb(255, 190, 80);
  --palette-8-7: rgb(255, 220, 140);
  --palette-8-8: rgb(200, 230, 200);
  --palette-8-9: rgb(180, 210, 255);

  --palette-9-0: rgb(132, 6, 206);
  --palette-9-1: rgb(255, 255, 255);
  --palette-9-2: rgb(162, 191, 208);
  --palette-9-3: rgb(255, 80, 182);
  --palette-9-4: rgb(70, 12, 106);
  --palette-9-5: rgb(255, 240, 80);
  --palette-9-6: rgb(180, 80, 255);
  --palette-9-7: rgb(195, 207, 230);
  --palette-9-8: rgb(255, 120, 200);
  --palette-9-9: rgb(160, 200, 255);
}

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

#landing {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#landing.hidden {
  opacity: 0;
  pointer-events: none;
}

.home-button {
  position: fixed;
  top: calc(16px + var(--sat));
  left: calc(30px + var(--sal));
  z-index: 2100;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.04em;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.home-button:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.home-button:active {
  transform: translateY(0);
}

.landing-inner {
  width: min(640px, 90vw);
  padding: clamp(28px, 4vw, 48px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.landing-helper,
.landing-tagline,
.landing-actions {
  width: 100%;
}

.landing-logo {
  font-family: "futura", sans-serif;
    color: #ffffff;     /* texte du bouton */
  font-size: 48px;
  font-weight: 700;
}

.landing-tagline {
  font-family: "Inter", sans-serif;
  font-size: 18px;
    font-weight: 100;
    color: #ffffff;     /* texte du bouton */
  line-height: 1.6;
}

.landing-helper {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.6;   /* ou 1.4 / 1.8 selon ce que tu veux */

    font-weight: 100;
    color: #ffffff;     /* texte du bouton */
}

/* Style du bouton d’accueil */
.landing-button {
  padding: 12px 28px;
  border: 1px solid #727272;          /* contour blanc */
  background-color: transparent;      /* fond transparent */
  color: #ffffff;
  font-size: 18px;
  font-weight: 100;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 20px;
}

/* État désactivé (quand pas encore de 8 chiffres) */
.landing-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #666;
}

#pi-band {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(calc(-50% + var(--pi-band-translate, 0px)));
  display: flex;
  justify-content: center;
  align-items: center;
  width: 92vw;
  max-width: 100%;
  pointer-events: none;
  gap: 6px;
}
.mobile-ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  display: none;
}
.mobile-ui[hidden] {
  display: none;
}
.mobile-hud {
  position: fixed;
  left: 12px;
  bottom: 12px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.3;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}
.mh-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.mh-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mh-sep {
  opacity: 0.6;
}
.mobile-controls {
  position: fixed;
  right: 12px;
  bottom: 22px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.mobile-ui.mobile-ui--blind .mobile-controls .mobile-zoom,
.mobile-ui.mobile-ui--blind .mobile-controls .mobile-pan-pad,
.mobile-ui.mobile-ui--blind .mobile-controls .mobile-actions button:not(#hudToggleBtn) {
  display: none;
}
.mobile-pan-pad {
  position: fixed;
  right: 12px;
  bottom: 180px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  z-index: 1202;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-pan-pad.hidden,
#mobilePanPad {
  display: none !important;
}
.mobile-pan-pad .pan-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(10, 10, 12, 0.85);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease, transform 0.2s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-pan-pad .pan-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(1px);
}
.pan-btn.pan-up { grid-area: 1 / 2 / 2 / 3; }
.pan-btn.pan-left { grid-area: 2 / 1 / 3 / 2; }
.pan-btn.pan-right { grid-area: 2 / 3 / 3 / 4; }
.pan-btn.pan-down { grid-area: 3 / 2 / 4 / 3; }
.mobile-pan-pad .pan-btn .icon {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-zoom,
.mobile-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.mz-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(10, 10, 12, 0.85);
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  line-height: 54px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
#muteBtn,
#viewToggleBtn,
#hudToggleBtn {
  color: transparent;
  font-size: 0;
}
#fsBtn {
  color: transparent;
  font-size: 0;
}
.mz-btn {
  position: relative;
}
.mz-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
  pointer-events: none;
}
#muteBtn {
  background-color: transparent;
}
 #muteBtn::after { background-image: url("icone-note-N.png"); }

#viewToggleBtn {
  background-color: transparent;
}
#viewToggleBtn::after {
  background-image: url("icone-cible-N.png");
}

#hudToggleBtn {
  background-color: transparent;
}
#hudToggleBtn::after {
  background-image: url("icone-oeil-N.png");
}
#fsBtn {
  background-color: transparent;
}
#fsBtn::after {
  background-image: url("icone-ecran-N.png");
}
.mz-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 820px) {
  #pi-band {
    top: 46px;
    padding: 0 16px;
    width: 96vw;
    max-width: 96vw;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: center;
    overflow: hidden;
    display: flex;
  }
  #pi-band .pi-digit {
    flex: 0 0 auto;
    min-width: 18px;
    margin: 0 14px;
  }
  .mobile-ui {
    display: block;
  }
}

/* Survol */
.landing-button:not(:disabled):hover {
  background-color: rgba(255,255,255,0.12); /* léger glow */
  border-color: #fff;
  transform: translateY(-2px);              /* lift subtil */
}

/* Pressé */
.landing-button:not(:disabled):active {
  transform: translateY(0);
  background-color: rgba(255,255,255,0.2);
}

.landing-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.landing-button--ghost {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.65);
}

#hud,
#hud *,
#mobileUI .mobile-hud,
#mobileUI .mobile-hud *,
.mz-btn,
.pan-btn {
  color: #6f6c6c;
  border-color: rgba(168, 168, 168, 0.7);
}

.mz-btn,
.pan-btn {
  background: rgba(20, 20, 20, 0.85);
}

#mobileUI .mobile-hud {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

#mobileUI .mobile-hud *,
#mobileUI .mz-btn,
#mobileUI .pan-btn {
  color: #1a1a1a;
  border-color: rgba(30, 30, 30, 0.35);
}

#mobileUI .mz-btn,
#mobileUI .pan-btn {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.landing-button--ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.landing-input {
  color: #000000;     /* texte tapé dans l’input */
}

.pi-owned-digit {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
#pi-band .pi-digit {
  display: inline-flex;
  margin: 0 6px;
  letter-spacing: normal;
  align-items: baseline;
}

#pi-band.blind-hidden {
  display: none !important;
}

#hud .hud-logo {
  display: inline-block;
  font-family: var(--hud-logo-font-family);
  font-size: clamp(
    var(--hud-logo-size-min),
    var(--hud-logo-size-preferred),
    var(--hud-logo-size-max)
  );
  font-weight: var(--hud-logo-font-weight);
  text-transform: uppercase;
}

body.fs-pseudo {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}

#p5-canvas {
  touch-action: none;
}

#p5-canvas.fs-pseudo {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

#hud.fs-pseudo {
  position: fixed;
  top: calc(32px + var(--sat));
  left: calc(12px + var(--sal));
  right: calc(12px + var(--sar));
  z-index: 3000;
}
