/*
  Site développé par phomsay pour zaki.
  Contact Discord : @phomsay671.
  Dev web : phomsay. Admin : sauci.
  Recherche et édition : Zaki & B.
*/

:root {
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --wakfu-teal: #2ecfb0;
  --dark-bg: #080810;
  --text-main: #eee4d2;
  --text-soft: #fff7df;
  --text-muted: #b8aa92;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: #07070e;
  color: var(--text-main);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6,7,13,0.9), rgba(6,7,13,0.34) 48%, rgba(6,7,13,0.92)),
    linear-gradient(180deg, rgba(6,7,13,0.2), #07070e 88%),
    url('../assets/personnages/backgrounds/bg-personnages.png') center / cover no-repeat;
  opacity: 0.96;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.54), transparent),
    radial-gradient(1px 1px at 76% 12%, rgba(255,255,255,0.42), transparent),
    radial-gradient(2px 2px at 82% 72%, rgba(46,207,176,0.26), transparent),
    radial-gradient(circle at 72% 30%, rgba(46,207,176,0.18), transparent 24rem),
    radial-gradient(circle at 18% 62%, rgba(201,168,76,0.16), transparent 22rem);
}

header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: rgba(7, 7, 12, 0.94);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: #f6f2e7;
  text-decoration: none;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.brand span { line-height: 1; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  flex-wrap: wrap;
}

.top-nav > a[href$="contact.html"],
.top-nav > a[href$="contact-html/contact.html"] { margin-left: auto; }

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  background: transparent;
  color: #f3efe4;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.nav-item:focus-within > .nav-link {
  color: var(--gold-light);
  background: rgba(201,168,76,0.08);
  outline: none;
}

.nav-caret { font-size: 0.8em; opacity: 0.8; }

.nav-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 240px;
  padding: 0.45rem;
  border: 1px solid rgba(201,168,76,0.16);
  background: rgba(12, 12, 18, 0.97);
  box-shadow: 0 16px 35px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-item {
  width: 100%;
  display: block;
  padding: 0.7rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu-item:hover,
.nav-menu-item:focus-visible {
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
  outline: none;
}

.mobile-nav-toggle { display: none; }

.personality-main {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
}

.krosmoz-legal-notice {
  position: relative;
  z-index: 2;
  margin-bottom: 1.4rem;
}

.personality-hero {
  min-height: clamp(560px, 76vh, 760px);
  display: grid;
  align-content: center;
  justify-items: start;
  max-width: 900px;
}

.personality-kicker,
.question-kicker,
.quiz-topline p {
  color: var(--gold-light);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-transform: uppercase;
}

.personality-hero h1 {
  margin-top: 0.75rem;
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 18px 54px rgba(0,0,0,0.9), 0 0 34px rgba(201,168,76,0.18);
}

.personality-hero p:not(.personality-kicker) {
  width: min(760px, 100%);
  margin-top: 1.35rem;
  color: #f5ead8;
  font-size: clamp(1.2rem, 2vw, 1.52rem);
  font-style: italic;
}

.personality-start,
.quiz-ghost,
.result-actions a,
.result-actions button {
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(232,201,122,0.32);
  background: rgba(8,8,16,0.54);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.personality-start {
  margin-top: 2rem;
}

.personality-start:hover,
.personality-start:focus-visible,
.quiz-ghost:hover,
.quiz-ghost:focus-visible,
.result-actions a:hover,
.result-actions a:focus-visible,
.result-actions button:hover,
.result-actions button:focus-visible {
  border-color: rgba(232,201,122,0.78);
  background: rgba(8,8,16,0.78);
  color: #fff7df;
  box-shadow: 0 0 24px rgba(201,168,76,0.18);
  transform: translateY(-1px);
  outline: none;
}

.quiz-shell,
.result-shell {
  min-height: 72vh;
  padding: clamp(1.2rem, 3vw, 2rem) 0;
}

.quiz-progress {
  height: 3px;
  overflow: hidden;
  background: rgba(255,247,223,0.12);
}

.quiz-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--wakfu-teal));
  box-shadow: 0 0 16px rgba(46,207,176,0.36);
  transition: width 0.28s ease;
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.35rem;
}

.quiz-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.quiz-ghost {
  min-height: 36px;
  padding: 0.55rem 0.75rem;
  font-size: 0.64rem;
  background: transparent;
}

.quiz-ghost:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.question-card {
  margin-top: clamp(1.8rem, 4vw, 3rem);
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid rgba(232,201,122,0.22);
  background:
    linear-gradient(135deg, rgba(8,8,16,0.9), rgba(10,18,20,0.76)),
    rgba(8,8,16,0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255,247,223,0.06),
    0 28px 76px rgba(0,0,0,0.48);
}

.question-card h2 {
  margin-top: 0.65rem;
  color: #fff7df;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.55rem, 3.35vw, 2.95rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.14;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: clamp(1.4rem, 3vw, 2rem);
}

.answer-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  padding: 1.05rem 1.15rem;
  border: 1px solid rgba(255,247,223,0.14);
  background: rgba(255,255,255,0.035);
  color: #f4ead8;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.answer-option strong {
  display: block;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.answer-option span {
  display: block;
  max-width: 34rem;
  margin-top: 0.55rem;
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.38;
}

.answer-option:hover,
.answer-option:focus-visible {
  border-color: rgba(46,207,176,0.56);
  background: rgba(46,207,176,0.08);
  box-shadow: 0 0 22px rgba(46,207,176,0.12);
  transform: translateY(-2px);
  outline: none;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(232,201,122,0.24);
  background: rgba(8,8,16,0.82);
  box-shadow: 0 28px 76px rgba(0,0,0,0.5);
}

.result-media {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border: 1px solid rgba(255,247,223,0.16);
  background: #090910;
}

.result-media img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: block;
  object-fit: cover;
}

.result-copy h2 {
  margin-top: 0.65rem;
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(2.25rem, 5vw, 5rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.result-archetype {
  margin-top: 0.7rem;
  color: var(--wakfu-teal);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-copy > p:not(.personality-kicker):not(.result-archetype) {
  margin-top: 1rem;
  max-width: 720px;
  color: #f5ead8;
  font-size: clamp(1.12rem, 1.7vw, 1.34rem);
}

.result-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.result-traits span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.62rem;
  border: 1px solid rgba(232,201,122,0.28);
  background: rgba(8,8,16,0.58);
  color: #fff7df;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.share-window {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  margin-top: 1.1rem;
  padding: clamp(0.9rem, 2vw, 1.25rem);
  border: 1px solid rgba(46,207,176,0.28);
  background:
    radial-gradient(circle at 14% 20%, rgba(46,207,176,0.16), transparent 34%),
    linear-gradient(135deg, rgba(8,8,16,0.92), rgba(12,28,30,0.78));
  box-shadow:
    inset 0 0 0 1px rgba(255,247,223,0.05),
    0 24px 62px rgba(0,0,0,0.42);
}

.share-window::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(232,201,122,0.2), transparent 30%, rgba(46,207,176,0.16));
  opacity: 0.34;
}

.share-preview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 130px);
  gap: 1rem;
  align-items: center;
  min-height: 180px;
  padding: 1rem;
  border: 1px solid rgba(232,201,122,0.22);
  background:
    linear-gradient(135deg, rgba(255,247,223,0.07), transparent 42%),
    rgba(2,4,8,0.5);
}

.share-preview-copy span,
.share-preview-copy em {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.share-preview-copy span {
  color: var(--gold-light);
}

.share-preview-copy strong {
  display: block;
  margin-top: 0.35rem;
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 0.98;
  text-transform: uppercase;
  text-shadow: 0 12px 32px rgba(0,0,0,0.72);
}

.share-preview-copy em {
  margin-top: 0.45rem;
  color: var(--wakfu-teal);
}

.share-preview-copy p {
  max-width: 24rem;
  margin-top: 0.7rem;
  color: #f4ead8;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.34;
}

.share-preview img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255,247,223,0.16);
  box-shadow: 0 16px 42px rgba(0,0,0,0.48);
}

.share-tools {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.65rem;
  justify-items: stretch;
  min-width: min(100%, 250px);
}

.share-button,
.share-copy {
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(232,201,122,0.32);
  background: rgba(8,8,16,0.62);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.share-button {
  border-color: rgba(46,207,176,0.52);
  color: #dffdf7;
  box-shadow: 0 0 24px rgba(46,207,176,0.12);
}

.share-button:hover,
.share-button:focus-visible,
.share-copy:hover,
.share-copy:focus-visible {
  border-color: rgba(232,201,122,0.7);
  background: rgba(232,201,122,0.11);
  color: #fff7df;
  transform: translateY(-2px);
  outline: none;
}

.share-tools p {
  min-height: 1.2rem;
  color: rgba(245,234,216,0.78);
  font-size: 0.94rem;
  line-height: 1.3;
}

body.is-share-modal-open {
  overflow: hidden;
}

.share-modal[hidden] {
  display: none;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,4,8,0.78);
  backdrop-filter: blur(8px);
}

.share-modal-panel {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  max-height: min(92vh, 880px);
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid rgba(232,201,122,0.28);
  background:
    linear-gradient(135deg, rgba(8,8,16,0.98), rgba(10,28,30,0.95)),
    #080810;
  box-shadow: 0 34px 90px rgba(0,0,0,0.68);
}

.share-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,247,223,0.18);
  background: rgba(8,8,16,0.72);
  color: #fff7df;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.share-modal-close:hover,
.share-modal-close:focus-visible {
  border-color: rgba(232,201,122,0.72);
  color: var(--gold-light);
  outline: none;
}

.share-modal-panel h2 {
  margin: 0.45rem 3rem 1rem 0;
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(1.8rem, 5vw, 3.35rem);
  line-height: 1;
  text-transform: uppercase;
}

.share-card-frame {
  overflow: hidden;
  border: 1px solid rgba(232,201,122,0.24);
  background: rgba(2,4,8,0.58);
  box-shadow: inset 0 0 0 1px rgba(255,247,223,0.04);
}

.share-card-frame img {
  width: 100%;
  display: block;
  aspect-ratio: 1200 / 630;
  object-fit: contain;
}

.share-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.share-modal-actions button {
  min-height: 46px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(232,201,122,0.34);
  background: rgba(8,8,16,0.66);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.share-modal-actions button:hover,
.share-modal-actions button:focus-visible {
  border-color: rgba(46,207,176,0.72);
  background: rgba(46,207,176,0.1);
  color: #fff7df;
  outline: none;
  transform: translateY(-1px);
}

.share-modal-note {
  min-height: 1.35rem;
  margin-top: 0.8rem;
  color: rgba(245,234,216,0.82);
  font-size: 1rem;
  line-height: 1.35;
}

.near-results {
  margin-top: 1.45rem;
}

.near-results > div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  margin-top: 0.75rem;
}

.near-results h3 {
  color: var(--gold-light);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.near-card {
  display: block;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid rgba(232,201,122,0.46);
  border-radius: 50%;
  background: rgba(8,8,16,0.62);
  box-shadow: 0 10px 24px rgba(0,0,0,0.26);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.near-card:hover,
.near-card:focus-visible {
  border-color: rgba(232,201,122,0.82);
  box-shadow: 0 14px 30px rgba(0,0,0,0.34), 0 0 18px rgba(232,201,122,0.16);
  outline: none;
  transform: translateY(-2px);
}

.near-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
}

@media (max-width: 900px) {
  .site-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .top-nav > a[href$="contact.html"],
  .top-nav > a[href$="contact-html/contact.html"] { margin-left: 0; }

  .answer-grid,
  .result-card,
  .share-window {
    grid-template-columns: 1fr;
  }

  .share-tools {
    min-width: 0;
  }

  .share-modal-actions {
    grid-template-columns: 1fr;
  }

  .result-media,
  .result-media img {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .site-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
  }

  .brand {
    min-width: 0;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
  }

  .brand img {
    width: 24px;
    height: 24px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(232,201,122,0.3);
    background: rgba(8,8,16,0.72);
    color: #f6f2e7;
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .top-nav {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    padding-top: 0.5rem;
  }

  .site-topbar.is-mobile-nav-open .top-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.72rem 0.75rem;
  }

  .nav-menu {
    position: static;
    min-width: 0;
    margin-top: 0.25rem;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-dropdown:hover .nav-menu,
  .nav-dropdown:focus-within .nav-menu {
    display: block;
  }

  .personality-main {
    width: min(100% - 1.2rem, 1180px);
    padding: 2.4rem 0;
  }

  .personality-hero {
    min-height: 620px;
  }

  .personality-hero h1 {
    max-width: 100%;
    font-size: clamp(2.15rem, 10.5vw, 3.15rem);
    line-height: 0.98;
    overflow-wrap: break-word;
  }

  .question-card {
    padding: 1rem;
  }

  .answer-option {
    min-height: 0;
  }

  .result-media,
  .result-media img {
    min-height: 360px;
  }

  .share-preview {
    grid-template-columns: 1fr;
  }

  .share-preview img {
    max-width: 180px;
    margin: 0 auto;
  }
}
