/* =========================
   GLOBAL
   ========================= */

* {
  user-select: none;
}

@font-face {
  font-family: 'Simplicita';
  src: url('../Assets/Fonts/Simplicita.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Font2002';
  src: url('../Assets/Fonts/2002.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   FOND BOIS
   ========================= */

.parallax-bg {
  position: fixed;
  inset: 0;
  width: 110%;
  height: 110%;
  background: url('../Assets/Images/Fond-bois.jpg') center / cover no-repeat;
  transform: translate3d(0,0,0);
  will-change: transform;
  z-index: 0;
}

/* =========================
   CANVAS PRINCIPAUX
   ========================= */

canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  contain: strict;
  transform: translateZ(0);
}

#lightRays        { z-index: 2; mix-blend-mode: overlay; filter: blur(20px); }
#lightRaysStrong  { z-index: 3; mix-blend-mode: overlay; filter: blur(10px); }
#lightDustBig     { z-index: 3.5; mix-blend-mode: overlay; filter: blur(10px); }
#lightDust        { z-index: 4; mix-blend-mode: overlay; filter: blur(1.5px); }

/* =========================
   OMBRE MOBILE (personne)
   ========================= */

#movingShadow {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
  mix-blend-mode: multiply;
  opacity: 0;
  transform: translateX(-150%) scale(1.2);
  transition: opacity 2s ease, transform 8s ease;
  z-index: 4.5;
  pointer-events: none;
  will-change: transform, opacity;
  filter: blur(120px);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  box-shadow:
    inset 0 0 150px rgba(0,0,0,0.9),
    inset 0 0 400px rgba(0,0,0,0.7);
  z-index: 5;
  pointer-events: none;
}

.cursor-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 500px at center, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
  z-index: 6;
}

/* =========================
   CONTENU
   ========================= */

.content {
  position: relative;
  z-index: 7;
  color: #f5e9cc;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  top: 35%;
  transform: translateY(-50%);
  font-size: 2em;
  user-select: none;
  padding: 28px 48px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(52, 39, 14, 0.65) 18%,
    rgba(14, 10, 0, 0.8) 50%,
    rgba(44, 33, 13, 0.65) 82%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: 0 0px 30px rgba(0,0,0, 1);
}

.content::before,
.content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(245,233,204,0) 0%, rgba(245,233,204,0.8) 50%, rgba(245,233,204,0) 100%);
  pointer-events: none;
}

.content::before { top: 0; }
.content::after { bottom: 0; }

.ornament-top {
  position: absolute;
  z-index: 7;
  width: 240px;
  height: 56px;
  left: 50%;
  top: -30px;
  margin: 0;
  transform: translateX(-50%);
  background: url('../Assets/Images/Ornament-top.png') center / contain no-repeat;
  pointer-events: none;
}

.guild-emblem {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50%;
  bottom: 94%;
  transform: translateX(calc(-50% - 3px));
  z-index: 6;
  pointer-events: none;
}

.guild-emblem .emblem-frame,
.guild-emblem .emblem-base,
.guild-emblem .emblem-overlay,
.guild-emblem .emblem-logo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.guild-emblem .emblem-frame {
  background-image: url('../Assets/Images/Logo-border.png');
  z-index: 4;
}

.guild-emblem .emblem-logo {
  background-image: url('../Assets/Images/Logo.png');
  z-index: 2;
  filter: drop-shadow(0 -20px 50px rgba(0,0,0,1));
}

.guild-emblem .emblem-overlay {
  background-image: url('../Assets/Images/Logo-overlay.png');
  mix-blend-mode: darken;
  opacity: 0.9;
  z-index: 3;
}

.ornament-bottom {
  position: absolute;
  z-index: 7;
  width: 240px;
  height: 36px;
  left: 50%;
  bottom: -14px;
  margin: 0;
  transform: translateX(-50%);
  background: url('../Assets/Images/Ornament-bottom.png') center / contain no-repeat;
  pointer-events: none;
}

.title {
  margin: 0;
  font-size: clamp(42px, 4vw, 78px);
  text-shadow: 0 0 10px rgba(0,0,0,0.2), 0px 2px 2px rgba(0,0,0,0.4);
  font-family: 'Font2002', serif;
}

.warcraft-btn {
  position: relative;
  z-index: 8;
  display: block;
  width: fit-content;
  height: 48px;
  min-width: 220px;
  padding: 0 24px;
  margin: 50px auto;
  border: 0;
  background: url('../Assets/Images/Button.png') center / contain no-repeat;
  color: #f7e6bf;
  font-family: "Simplicita";
  font-size: 14px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  text-decoration: none;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: filter 1800ms ease;
  scale: 1.75;
}

.warcraft-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../Assets/Images/Button-Highlight.png') center / contain no-repeat;
  opacity: 0;
  z-index: 1;
  transition: opacity 380ms ease;
  pointer-events: none;
}

.warcraft-btn > span {
  position: relative;
  z-index: 2;
  display: block;
}

.warcraft-btn:hover::after { opacity: 1; }

.warcraft-btn:active {
  background-image: url('../Assets/Images/Button-Pressed.png');
}

.warcraft-btn:active::after { opacity: 0; }

.warcraft-btn:disabled {
  cursor: default;
  color: rgba(245,233,204,0.5);
}

.site-footer {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 6;
  color: rgba(245,233,204,0.75);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  pointer-events: none;
}

.subtitle {
  margin: 12px 0 18px;
  font-size: clamp(18px, 1.4vw, 24px);
  opacity: 1;
  font-family: inherit;
  text-shadow: 0px 2px 2px rgba(0,0,0,0.5);
  margin-bottom: 40px;
}

.whisper {
  font-size: 14px;
  opacity: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: inherit;
  text-shadow: 0px 2px 2px rgba(0,0,0,0.5);
}

.fade { opacity: 0; transition: opacity 0s ease; }

.parallax-bg, canvas, .overlay, .cursor-spotlight {
  transition: opacity 4s ease;
}

/* =========================================================
   FIX SMARTPHONE (iOS / Android) — stabilité viewport + layout
   ========================================================= */

/* Viewport height moderne : évite le "saut" de la barre d'adresse */
body{
  min-height: 100vh;
}

@supports (height: 100dvh){
  body{ min-height: 100dvh; }
}

@supports (height: 100svh){
  body{ min-height: 100svh; }
}

/* Stabilise les layers fixed sur iOS (glitch transform/fixed) */
.parallax-bg,
canvas,
.overlay,
.cursor-spotlight,
#movingShadow{
  top: 0; right: 0; bottom: 0; left: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Safe-area (encoche) pour le footer */
.site-footer{
  padding-bottom: env(safe-area-inset-bottom);
}

/* Ajustements responsive */
@media (max-width: 768px){

  /* Fond : on évite les bords visibles quand ça bouge */
  .parallax-bg{
    width: 120%;
    height: 120%;
    left: -10%;
    top: -10%;
    will-change: transform;
  }

  /* Contenu : centrage robuste (évite top% qui saute) */
  .content{
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 640px);
    padding: 22px 18px;
    font-size: clamp(18px, 4.2vw, 28px);
  }

  /* Emblème un poil plus petit */
  .guild-emblem{
    width: 160px;
    height: 160px;
    bottom: calc(100% - 12px);
  }

  /* Bouton : scale énorme = débordement/flou sur mobile */
  .warcraft-btn{
    scale: 1;
    min-width: 220px;
    margin: 28px auto 0;
  }

  /* Spotlight : adapte la taille au viewport */
  .cursor-spotlight{
    background: radial-gradient(circle 42vw at center, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
  }

  /* Blur trop coûteux sur mobile => légère baisse */
  #movingShadow{ filter: blur(80px); }
  #lightRays{ filter: blur(16px); }
  #lightRaysStrong{ filter: blur(8px); }
  #lightDustBig{ filter: blur(8px); }
  #lightDust{ filter: blur(1.2px); }

  /* Prévention zoom iOS (si jamais input plus tard) */
  input, textarea, select, button { font-size: 16px; }
}
#fxToggle {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 9999;

  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--mono);
  border-radius: 8px;

  border: 1px solid var(--stroke);
  background: rgba(51, 51, 51, 0.45);
  color: var(--text);

  cursor: pointer;
  opacity: 0.75;
}

#fxToggle:hover {
  opacity: 1;
}

#fxToggle.is-off {
  color: var(--muted);
}
