/* ══════════════════════════════════════════════════════════
   MAIN.CSS — Enchanted Tools
   Styles custom / overrides. Chargé en dernier.
   ══════════════════════════════════════════════════════════ */

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Sélection de texte — couleur tertiary */
::selection {
  background: var(--color-tertiary);
  color: var(--color-tertiary-fg);
}

/* Focus ring accessible */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

/* Tes overrides custom ici ↓ */

body {
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 11, 27, 0.28), rgba(17, 11, 27, 0.28)),
    url("../assets/images/wallpaper.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.hidden {
  display: none !important;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

#app {
  width: 100vw;
  min-height: 100vh;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 var(--container-pad) clamp(32px, 6vw, 72px);
  overflow: visible;
  background: transparent;
}

.hero__content {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding-top: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.hero__title-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.hero__title-img {
  align-self: center;
  position: relative;
  top: 0;
  left: auto;
  transform: none;
  z-index: 2;
  width: min(54vw, 380px);
  margin: 0;
}

.ghost-title,
.hero__halo,
.hero__robot-wrap,
.eyebrow,
.hero__description,
.hero__actions,
#header,
#footer {
  display: none !important;
}

.code-checker {
  width: min(100%, 760px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}

.code-helper-text {
  width: min(100%, 760px);
  margin: 20px 0 16px;
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
}

.code-checker__input {
  width: 100%;
  padding: 26px 28px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-interne);
}

.code-checker__input::placeholder {
  color: var(--color-muted-fg);
}

.code-checker__input:focus {
  outline: none;
  border-color: var(--color-ring);
}

.code-checker__button {
  justify-content: center;
  min-height: 64px;
  font-size: 1.05rem;
  color: var(--color-foreground);
  background: var(--secondary-500);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-big);
}

.code-checker__button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.code-checker__button:hover {
  background: var(--secondary-600);
  border-color: rgba(255, 255, 255, 0.24);
}

.code-checker__result {
  min-height: 1.6em;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}

.code-checker__result[data-status="success"] {
  color: var(--color-tertiary);
}

.code-checker__result[data-status="error"] {
  color: #ff9aa7;
}

.success-view {
  width: min(100%, 1160px);
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-top: 20px;
}

.success-view__artwork {
  position: relative;
  flex: 0 0 min(44vw, 520px);
  width: min(44vw, 520px);
  margin-top: 0;
  overflow: visible;
}

.success-view__content {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 40px;
  margin-top: 80px;
}

.success-view__blend-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: visible;
  isolation: isolate;
  background-image:
    linear-gradient(rgba(17, 11, 27, 0.28), rgba(17, 11, 27, 0.28)),
    url("../assets/images/wallpaper.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.success-view__blend-stage > * {
  grid-area: 1 / 1;
}

.success-view__image {
  height: auto;
}

.success-view__image--witch {
  position: relative;
  z-index: 1;
  width: min(78vw, 500px);
  opacity: 1;
  mix-blend-mode: lighten;
  pointer-events: none;
}

.reversed {
  transform: scaleX(-1);
}

.success-view__image--prize {
  position: relative;
  z-index: 2;
  width: min(72vw, 420px);
  mix-blend-mode: normal;
}

.success-view__image--prize[data-prize-key="boutique"] {
  width: min(54vw, 300px);
}

.success-view__image--prize[data-prize-key="boisson"] {
  width: min(78vw, 460px);
}

.success-view__image--prize[data-prize-key="ticket"] {
  width: min(90vw, 580px);
}

.success-view__code {
  max-width: 32ch;
  font-family: var(--font-body);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-tertiary);
  text-transform: uppercase;
}

.success-view__message {
  width: min(100%, 560px);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.9vw, 1.35rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-foreground);
  text-align: left;
}

.success-view__link {
  color: var(--color-tertiary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.success-view__link:hover {
  color: #ffd56b;
}

.success-view__footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding: 20px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  margin-top: 8px;
}

.success-view__button {
  width: auto;
  justify-content: flex-start;
  min-height: 64px;
  font-size: 1.05rem;
}

.success-view__button--primary {
  color: var(--color-foreground);
  background: var(--secondary-500);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-big);
}

.success-view__button--primary:hover {
  background: var(--secondary-600);
  border-color: rgba(255, 255, 255, 0.24);
}

.success-view__button--secondary {
  background: none;
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.success-view__button--secondary:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.success-view__button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.65;
}

html[lang="en"] .success-view__footer {
  justify-content: center;
}

html[lang="en"] .success-view__button {
  justify-content: center;
  text-align: center;
}

.language-switcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 30;
  display: flex;
  gap: 10px;
}

.language-switcher__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(12, 23, 65, 0.72);
  color: var(--color-foreground);
  box-shadow: var(--shadow-big);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.language-switcher__button.is-active {
  background: rgba(161, 51, 122, 0.86);
  border-color: rgba(255, 255, 255, 0.32);
}

.language-switcher__flag {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hero {
    padding-inline: 20px;
    padding-bottom: 32px;
  }

  .hero__content {
    width: 100%;
    padding-top: 0;
    gap: 18px;
    justify-content: center;
  }

  .hero__title-img {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 31;
    align-self: center;
    width: min(50vw, 280px);
  }

  .code-checker {
    width: min(100%, 640px);
  }

  .success-view {
    width: min(100%, 640px);
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
  }

  .success-view__footer {
    width: 100%;
    justify-content: flex-start;
  }

  .success-view__artwork {
    flex: none;
    width: min(88vw, 440px);
    margin-top: -22px;
  }

  .success-view__content {
    width: 100%;
    align-items: flex-start;
    gap: 12px;
    padding-top: 0;
    margin-top: 0;
  }

  .success-view__image--witch {
    width: min(84vw, 430px);
  }

  .success-view__image--prize {
    width: min(78vw, 360px);
  }

  .success-view__image--prize[data-prize-key="boutique"] {
    width: min(60vw, 270px);
  }

  .success-view__image--prize[data-prize-key="boisson"] {
    width: min(84vw, 390px);
  }

  .success-view__image--prize[data-prize-key="ticket"] {
    width: min(94vw, 500px);
  }

  .language-switcher {
    left: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  #app,
  .hero,
  .hero__content {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  #app,
  .hero {
    min-height: 100svh;
  }

  .hero {
    padding-inline: 16px;
    padding-bottom: 0;
  }

  .hero__content {
    padding-top: 84px;
    gap: 12px;
  }

  .hero__title-img {
    position: fixed;
    top: 18px;
    left: 16px;
    transform: none;
    z-index: 31;
    width: min(34vw, 150px);
  }

  .code-checker {
    width: 100%;
  }

  .success-view {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 28px;
  }

  .code-checker__input,
  .code-checker__button {
    min-height: 62px;
  }

  .code-checker__input {
    font-size: 1.2rem;
    padding: 22px 18px;
  }

  .success-view__artwork {
    position: relative;
    flex: none;
    width: min(76vw, 270px);
    margin-top: 0;
    top: -20px;
  }

  .success-view__content {
    width: 100%;
    gap: 10px;
    padding-top: 0;
    margin-top: 0;
  }

  .success-view__image--witch {
    width: min(70vw, 250px);
  }

  .success-view__image--prize {
    width: min(64vw, 220px);
  }

  .success-view__image--prize[data-prize-key="boutique"] {
    width: min(52vw, 175px);
  }

  .success-view__image--prize[data-prize-key="boisson"] {
    width: min(68vw, 240px);
  }

  .success-view__image--prize[data-prize-key="ticket"] {
    width: min(76vw, 290px);
  }

  .success-view__link {
    align-self: center;
    font-size: 0.92rem;
    text-align: center;
  }

  .success-view__code {
    max-width: 100%;
    font-size: clamp(1.2rem, 5vw, 1.7rem);
    text-align: center;
  }

  .success-view__message {
    width: 100%;
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .language-switcher {
    top: 18px;
    right: 16px;
    left: auto;
    bottom: auto;
    z-index: 31;
    gap: 8px;
  }

  .language-switcher__button {
    min-height: 44px;
    padding: 9px 12px;
  }
}
