/* =========================
   RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   GLOBAL
========================= */
body {
  min-height: 100vh;
  background: #0f0d0b;
  background-image: 
    radial-gradient(circle at top, rgba(255,255,255,0.03), transparent 60%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  color: #e0d6c3;
  font-family: "Times New Roman", Georgia, serif;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* =========================
   SCREEN (IMPORTANT)
========================= */
.screen {
  position: relative; /* ← CRUCIAL pour le bouton ⏩ */
  width: 90%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  background: rgba(20, 18, 15, 0.95);
  border: 1px solid #3a342c;
  box-shadow: 
    0 0 40px rgba(0,0,0,0.9),
    inset 0 0 60px rgba(0,0,0,0.6);
  animation: breathe 6s ease-in-out infinite;
}

/* =========================
   HIDDEN
========================= */
.hidden {
  display: none;
}

/* =========================
   TITLES / SUBTITLE
========================= */
h1 {
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.8rem;
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.75rem;
  margin-bottom: 2rem;
  opacity: 0.7;
}

/* =========================
   INPUT
========================= */
input {
  width: 100%;
  padding: 0.9rem;
  background: #0b0a08;
  border: 1px solid #5a5246;
  color: #e0d6c3;
  font-family: inherit;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
  caret-color: #e0d6c3;
}

input:focus {
  border-color: #e6dcc8; /* blanc chaud */
  box-shadow:
    0 0 8px rgba(230, 220, 200, 0.6),
    inset 0 0 6px rgba(255, 255, 255, 0.15);
}


/* =========================
   BUTTONS
========================= */
button {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: #1a1612;
  border: 1px solid #5a5246;
  color: #e0d6c3;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  cursor: pointer;
}

button:hover {
  background: #2a231d;
}

/* =========================
   ERROR
========================= */
#error-message {
  margin-top: 1.2rem;
  font-size: 0.7rem;
  color: #8b0000;
  letter-spacing: 0.1em;
}

/* =========================
   TEXT SCREEN
========================= */
#text-screen {
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 30px;
  padding-top: 80px; 
  font-size: 0.75rem;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
  scroll-behavior: auto;  
}

#manuscript {
  white-space: pre-wrap;
  opacity: 0.95;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
}

/* =========================
   SKIP BUTTON ⏩
========================= */
#skip-btn {
  position: absolute;
  bottom: 14px;
  right: 16px;

  background: none;
  border: none;
  padding: 0;
  width: auto;
  height: auto;

  opacity: 0.45;
  cursor: pointer;
  z-index: 5;

  transition: opacity 0.2s ease, transform 0.2s ease;
}

#skip-btn img {
  width: 26px;      /* ajuste si nécessaire */
  height: auto;
  display: block;
}

#skip-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

#skip-btn:active {
  transform: scale(0.95);
}

/* =========================
   CUBE BUTTON (STYLIZED)
========================= */
#cube-btn {
  margin-top: 2.2rem;
  padding: 1.1rem;
  width: 100%;

  background: linear-gradient(
    145deg,
    #2a231d,
    #15110e
  );

  border: 1px solid #6a5f52;
  color: #e6dcc8;

  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;

  cursor: pointer;

  box-shadow:
    0 0 18px rgba(0,0,0,0.9),
    inset 0 0 14px rgba(255,255,255,0.04);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

#cube-btn:hover {
  background: linear-gradient(
    145deg,
    #3a3027,
    #1b1612
  );

  transform: translateY(-2px);

  box-shadow:
    0 8px 28px rgba(0,0,0,1),
    inset 0 0 18px rgba(255,255,255,0.06);
}

#cube-btn:active {
  transform: translateY(0);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.9),
    inset 0 0 10px rgba(0,0,0,0.8);
}

/* =========================
   BREATHING EFFECT
========================= */
@keyframes breathe {
  0%, 100% {
    box-shadow:
      0 0 40px rgba(0,0,0,0.9),
      inset 0 0 60px rgba(0,0,0,0.6);
  }
  50% {
    box-shadow:
      0 0 55px rgba(0,0,0,1),
      inset 0 0 80px rgba(0,0,0,0.8);
  }
}

/* =========================
   HELLO / CUBE SCREEN
========================= */
#hello-screen {
  position: fixed;
  inset: 0;
  padding: 0;
  margin: 0;
  background: #0f0d0b;
  border: none;
  box-shadow: none;
  animation: none;
}

#cube-container {
  width: 100vw;
  height: 100vh;
  border: none;
}

/* =========================
   LANGUAGE TAB
========================= */
#lang-tab {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(15, 13, 11, 0.95);
  border-radius: 999px;
  border: 1px solid #3a342c;
  z-index: 1000;
  box-shadow:
    0 6px 18px rgba(0,0,0,0.85),
    inset 0 0 20px rgba(0,0,0,0.6);
}

.lang-flag {
  width: 54px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.lang-flag.active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px rgba(224, 214, 195, 0.6),
    0 4px 10px rgba(0,0,0,0.8);
}

.lang-flag:active {
  transform: scale(0.96);
}

/* =========================
   RETURN BUTTON
========================= */
#return-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;

  background: none;
  border: none;
  padding: 0;

  width: auto;
  height: auto;

  opacity: 0.5;
  cursor: pointer;
  z-index: 1001;

  transition: opacity 0.25s ease, transform 0.25s ease;
}

#return-btn img {
  padding-bottom: 5px;
  width: 34px;
  height: auto;
  display: block;
}

#return-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

#return-btn:active {
  transform: scale(0.95);
}

/* =========================
   INTRO SCREEN
========================= */

#intro-screen {
  text-align: center;
}

#story-title {
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  margin-bottom: 2.2rem;
  text-transform: uppercase;
  font-family: "Press Start 2P", serif;
  color: #e6dcc8;
}

.intro-warning {
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.75;
  margin-bottom: 2.4rem;
  letter-spacing: 0.08em;
}

#story-title-img {
  max-width: 100%;
  height: auto;
  margin-bottom: 2.2rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: drop-shadow(0 0 12px rgba(0,0,0,0.8));
}

/* =========================
   STORY IMAGE DRAW EFFECT
========================= */

.story-image-wrapper {
  width: 100%;
  max-width: 520px;

  margin: 2.8rem auto;   /* 👈 CENTRAGE HORIZONTAL */
  display: block;

  text-align: center;   /* sécurité pour SVG inline */
}

.story-image {
  width: 100%;
  margin: 0 auto;  
  height: auto;
  display: block;
  image-rendering: auto;
  will-change: transform;
}

.story-svg-wrapper {
  display: flex;
  justify-content: center;
}

.story-svg-wrapper svg {
  max-width: 100%;
  height: auto;
}
@media (min-width: 600px) {
  #cube-phrase {
    position: absolute;
    top: 2vh;
    left: 170%;
    transform: translateX(-50%);

    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.1rem, 2.5vw, 2rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;

    color: transparent;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
  }
}

@media (max-width: 600px) {
  #cube-phrase {
    position: absolute;
    top: 6vh;
    left: 55%;
    transform: translateX(-50%);

    font-family: "Cormorant Garamond", serif;
    font-size: clamp(0.8rem, 2.5vw, 1.5rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;

    color: transparent;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
  }
}



/* chaque lettre */
.cube-letter {
  opacity: 0;
  display: inline-block;

  color: #f5e6a8;
  text-shadow:
    0 0 6px rgba(255, 220, 150, 0.2),
    0 0 12px rgba(255, 200, 120, 0.15);

  animation: revealLetter 0.9s ease forwards;
}

@keyframes revealLetter {
  0% {
    opacity: 0;
    filter: blur(6px);
    text-shadow: none;
  }
  60% {
    opacity: 1;
    filter: blur(1px);
    text-shadow:
      0 0 12px rgba(255, 220, 150, 0.6),
      0 0 28px rgba(255, 180, 90, 0.4);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    text-shadow:
      0 0 8px rgba(255, 210, 130, 0.35),
      0 0 18px rgba(255, 170, 80, 0.25);
  }
}

/* =========================
   FIXED FOOTER
========================= */

#fixed-footer {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;

  height: 56px; /* 👈 hauteur sacrée */
  padding: 0 18px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  pointer-events: none; /* sauf boutons */
  z-index: 1001;
}

#fixed-footer button {
  pointer-events: auto;
  background: none;
  border: none;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#fixed-footer button:hover {
  opacity: 1;
  transform: scale(1.15);
}

#fixed-footer button:active {
  transform: scale(0.95);
}


