/*
 * Burning Hells — theme 2026.
 *
 * Remplace Bootstrap 4.0 et les anciennes feuilles du site. Aucune dependance : un seul
 * fichier, des variables en tete, puis les composants dans l'ordre de la page.
 * Le contenu saisi dans l'admin (accueil, reglement) arrive en HTML brut avec
 * quelques classes historiques (.tiny-text, .button) : elles sont stylees ici.
 */

:root {
  --bg: #0c0806;
  --bg-2: #120c09;
  --surface: #19110d;
  --surface-2: #221812;
  --surface-3: #2f2219;
  --line: rgba(255, 196, 150, 0.1);
  --line-strong: rgba(255, 196, 150, 0.2);

  --text: #f4ebe3;
  --muted: #bba99b;
  --faint: #8a7669;

  --ember: #ff6b2c;
  --ember-2: #ff8f4d;
  --gold: #f3b75e;
  --blood: #e0443a;
  --ok: #7fd39a;
  --err: #ff8a7a;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --max: 1180px;

  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Alegreya Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

a:hover {
  color: var(--ember-2);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: rgba(255, 107, 44, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 200;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #1a0b04;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--ember-2);
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}

.muted {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.75rem;
}

.section-head .eyebrow {
  margin-bottom: 0.4rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.text-link {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.text-link:hover {
  color: var(--gold);
}

.empty {
  margin: 0;
  padding: 2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.gradient-text {
  background: linear-gradient(180deg, #fff7e8 0%, #ffd49a 45%, #ff8a3d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Boutons ------------------------------------------------------------- */

.btn,
.feature__text .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 700 0.95rem/1 var(--font-body);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn--primary,
.feature__text .button {
  background: linear-gradient(180deg, var(--ember-2), var(--ember) 55%, #e2531b);
  color: #1d0c04;
  box-shadow: 0 10px 26px -10px rgba(255, 107, 44, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:hover,
.feature__text a:hover .button {
  color: #1d0c04;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(255, 107, 44, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn--secondary {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--gold);
  background: #3a2a1f;
}

.btn--sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
}

.btn--lg {
  padding: 0.95rem 1.7rem;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

/* ---- En-tete ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 8, 6, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max);
  min-height: 4rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font: 800 1.12rem/1 var(--font-display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: #fff;
}

.brand__mark {
  width: 1.45rem;
  height: 1.45rem;
  flex: none;
  color: var(--ember);
  filter: drop-shadow(0 0 8px rgba(255, 107, 44, 0.65));
}

.site-nav {
  display: flex;
  gap: 0.2rem;
  margin-left: auto;
}

.site-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.site-nav a[aria-current='page'] {
  background: rgba(255, 107, 44, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 44, 0.35);
  color: var(--text);
}

.tag {
  margin-left: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(243, 183, 94, 0.15);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* Sur l'accueil, l'en-tete se pose sur l'illustration. */
.is-home .site-header {
  position: absolute;
  inset-inline: 0;
  border-bottom-color: transparent;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.is-home .site-nav a {
  color: rgba(255, 244, 232, 0.88);
}

@media (max-width: 760px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 0.75rem;
  }

  .site-nav {
    width: 100%;
    margin-left: 0;
    padding-block: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav {
    gap: 0;
    margin-inline: -0.55rem;
    width: calc(100% + 1.1rem);
  }

  .site-nav a {
    padding-inline: 0.55rem;
    font-size: 0.97rem;
  }
}

/* ---- Pied de page -------------------------------------------------------- */

.site-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 107, 44, 0.035), transparent), var(--bg-2);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  padding-block: 2rem;
}

.site-footer__brand p {
  margin: 0.45rem 0 0;
  color: var(--faint);
  font-size: 0.92rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--gold);
}

/* ---- En-tete des pages interieures --------------------------------------- */

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('/img/slide.jpg') center 30% / cover;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, var(--bg) 0%, transparent 70%),
    linear-gradient(90deg, rgba(12, 8, 6, 0.96) 0%, rgba(12, 8, 6, 0.78) 45%, rgba(12, 8, 6, 0.45) 100%);
}

.page-title {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
}

.page-hero .lead {
  max-width: 60ch;
  margin: 0.8rem 0 0;
}

.breadcrumb {
  margin: 0 0 1.5rem;
  color: var(--faint);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--gold);
}

/* ---- Accueil ------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: min(92vh, 860px);
  overflow: hidden;
}

.hero__art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  animation: hero-in 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 8, 6, 0.3) 0%, rgba(12, 8, 6, 0) 30%, rgba(12, 8, 6, 0.7) 72%, var(--bg) 100%),
    radial-gradient(ellipse 60% 45% at 50% 85%, rgba(12, 8, 6, 0.65), transparent);
}

.hero__content {
  padding-bottom: clamp(6rem, 14vh, 9rem);
  text-align: center;
}

.hero__title {
  margin: 0 0 0.2em;
  font-size: clamp(2.7rem, 9vw, 6.5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  filter: drop-shadow(0 4px 28px rgba(0, 0, 0, 0.8));
}

.hero .eyebrow {
  color: var(--gold);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.hero__lead {
  max-width: 44ch;
  margin: 0 auto 2rem;
  color: #f3e4d5;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.hero__actions .btn--ghost {
  background: rgba(12, 8, 6, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@keyframes hero-in {
  from {
    opacity: 0.3;
    transform: scale(1.07);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-intro {
  position: relative;
  z-index: 2;
  margin-top: -4rem;
}

.home-intro__card {
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(38, 27, 20, 0.92), rgba(25, 17, 13, 0.96));
  box-shadow: var(--shadow);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-align: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.home-intro__card p {
  margin: 0;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
}

.feature + .feature {
  margin-top: clamp(3rem, 7vw, 5.5rem);
}

.feature--reverse .feature__media {
  order: 2;
}

.feature__media {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__text h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.feature__text p {
  color: var(--muted);
  font-size: 1.12rem;
}

.feature__text .tiny-text {
  margin-bottom: 0.75rem;
  color: var(--ember-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.feature__text a:has(.button) {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
}

.home-keywords {
  color: var(--faint);
  font-size: 0.92rem;
  text-align: center;
}

.home-keywords p {
  margin: 0;
}

@media (max-width: 820px) {
  .feature {
    grid-template-columns: 1fr;
  }

  .feature--reverse .feature__media {
    order: 0;
  }
}

/* ---- Cartes (boss, raids) ------------------------------------------------ */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 1.5rem;
}

.entity-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.entity-card:hover {
  border-color: rgba(255, 107, 44, 0.4);
  box-shadow: 0 26px 50px -26px rgba(255, 107, 44, 0.45);
  transform: translateY(-4px);
}

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}

.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.entity-card:hover .card__media img {
  transform: scale(1.05);
}

.card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(25, 17, 13, 0.9));
}

.card__badge {
  position: absolute;
  z-index: 1;
  top: 0.8rem;
  left: 0.8rem;
  margin: 0;
  background: rgba(12, 8, 6, 0.75);
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem 1.4rem 1.4rem;
}

.card__title {
  margin: 0;
  font-size: 1.45rem;
}

.card__title a {
  color: var(--text);
  text-decoration: none;
}

.card__title a:hover {
  color: var(--ember-2);
}

.card__desc {
  color: var(--muted);
}

.card__meta {
  color: var(--faint);
  font-size: 0.93rem;
  font-style: italic;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.3rem;
}

.ability {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--ember);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 107, 44, 0.07);
  font-size: 0.98rem;
}

.ability__label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ember-2);
  font: 700 0.7rem/1.2 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---- Fiche d'un boss ----------------------------------------------------- */

.profile {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.art-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 34px 70px -34px #000, 0 0 80px -40px rgba(255, 107, 44, 0.35);
}

.art-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 5;
  object-fit: cover;
}

.profile__info {
  display: grid;
  gap: 1.1rem;
}

.profile__info .page-title {
  margin-top: -0.4rem;
}

.profile__info p {
  margin: 0;
}

.profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

@media (max-width: 860px) {
  .profile {
    grid-template-columns: 1fr;
  }
}

.phase {
  margin-top: 2.75rem;
}

.phase__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.phase__title {
  margin: 0;
  font-size: 1.55rem;
}

.spell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

/* Chaque type de sort a sa couleur, reprise par l'icone et le badge. */
[data-icon] {
  --accent: var(--faint);
}
[data-icon='creature.png'] {
  --accent: #72c47a;
}
[data-icon='sorcery.png'] {
  --accent: #ea6a5c;
}
[data-icon='attack.png'] {
  --accent: #ff9a52;
}
[data-icon='enchant.png'] {
  --accent: #86a9ff;
}
[data-icon='artefact.png'] {
  --accent: #c4bbb0;
}
[data-icon='secret.png'] {
  --accent: #f3b75e;
}

.spell {
  position: relative;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.spell__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.spell__icon {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0.35rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, var(--faint)) 22%, transparent);
}

.spell__name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.08rem;
}

.type-badge {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent, var(--faint)) 13%, transparent);
  color: var(--accent, var(--muted));
  font: 700 0.68rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.spell__text {
  color: #e7dacd;
  font-size: 0.99rem;
}

/* ---- Raids --------------------------------------------------------------- */

.lineup {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lineup__item {
  display: grid;
  grid-template-columns: auto minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem 1rem 1rem;
}

.lineup__step {
  width: 2.6rem;
  color: var(--ember);
  font: 800 1.7rem/1 var(--font-display);
  text-align: center;
}

.lineup__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
}

.lineup__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lineup__body {
  display: grid;
  gap: 0.6rem;
}

.lineup__body .card__title {
  font-size: 1.3rem;
}

@media (max-width: 700px) {
  .lineup__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .lineup__media {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

/* ---- Combat -------------------------------------------------------------- */

/* Fond flou derriere le combat. Le PHP d'origine regenerait une image floutee
   a chaque requete via GD ; le navigateur fait le meme rendu. */
.boss-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  filter: blur(30px) brightness(0.38) saturate(1.2);
  transform: scale(1.15);
}

.fight-page {
  padding-block: clamp(1.5rem, 4vw, 2.75rem) 0;
}

.fight-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fight-toolbar[hidden] {
  display: none;
}

.audio-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.9rem 0.25rem 0.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(22, 15, 11, 0.75);
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.audio-toggle svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.audio-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
}

.audio-toggle[aria-pressed='false'] {
  color: var(--faint);
}

.audio-toggle[aria-pressed='false'] span {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

/* Curseur de volume : la partie remplie suit --fill, pose par fight-audio.js. */
.audio-volume {
  --fill: 70%;
  width: 6.5rem;
  height: 1.5rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.audio-volume:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.audio-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) var(--fill), rgba(255, 255, 255, 0.14) var(--fill));
}

.audio-volume::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #1d0c04;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 183, 94, 0.18);
  -webkit-appearance: none;
}

.audio-volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.audio-volume::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
}

.audio-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #1d0c04;
  border-radius: 50%;
  background: var(--gold);
}

.audio-control:has(.audio-toggle[aria-pressed='false']) .audio-volume {
  opacity: 0.4;
}

@media (max-width: 520px) {
  .audio-control {
    flex: 1 1 0;
    min-width: 0;
  }

  .audio-volume {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  /* Icone seule sur mobile ; le libelle reste lu par les lecteurs d'ecran. */
  .audio-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

#fight-form[aria-busy='true'] .turn-button {
  opacity: 0.75;
  cursor: progress;
}

.trophy-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.trophy-strip__label {
  margin-right: 0.3rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.trophy-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem 0.4rem 0.45rem;
  border: 1px solid rgba(243, 183, 94, 0.3);
  border-radius: 999px;
  background: rgba(30, 20, 12, 0.8);
  font-size: 0.85rem;
  line-height: 1.3;
}

.trophy-chip img {
  width: 1.9rem;
  height: 1.9rem;
}

.trophy-chip strong {
  display: block;
  color: var(--gold);
  font-size: 0.93rem;
}

.trophy-chip span {
  color: var(--muted);
}

.fight-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.fight-boss {
  position: sticky;
  top: 5.5rem;
  overflow: hidden;
  background: rgba(25, 17, 13, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.fight-boss__art {
  position: relative;
  margin: 0;
}

/* Canvases WebGL des effets (public/js/fight-fx.js). Ils ne captent aucun
   clic : le jeu reste entierement pilote par les formulaires. */
.fx-boss {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}

.fight-boss__art img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 5;
  object-fit: cover;
}

.fight-boss__body {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.4rem 1.5rem;
}

.fight-boss__body .eyebrow {
  margin: 0 0 -0.6rem;
}

.fight-boss__name {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 800;
}

.howto {
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.96rem;
}

.fight-console {
  display: grid;
  gap: 1.4rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(22, 15, 11, 0.86);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  scroll-margin-top: 5.5rem;
}

#panel {
  display: grid;
  gap: 1.4rem;
}

.console-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.life-counter__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.life-counter__label svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--blood);
}

.life-counter__control {
  display: flex;
  align-items: center;
  padding: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-2);
}

.life-counter__control:focus-within {
  border-color: rgba(224, 68, 58, 0.6);
  box-shadow: 0 0 0 3px rgba(224, 68, 58, 0.15);
}

.life-step {
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.15s;
}

.life-step:hover {
  background: #402e22;
}

.life-step:active {
  background: #4c372a;
}

.life-input {
  width: 5rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 800 1.9rem/1 var(--font-display);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.life-input:focus {
  outline: none;
}

.life-input::-webkit-outer-spin-button,
.life-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.turn-button {
  flex: 1 1 12rem;
  min-height: 3.45rem;
}

.turn__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.turn__stats li {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.turn__stats span {
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.turn__stats strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.turn__idle {
  margin: 0;
  padding: 1.6rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.spell--current {
  padding: 1.4rem 1.5rem;
  background:
    radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 65%),
    var(--surface);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 22px 44px -26px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: cast 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.spell__kicker {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.spell--current .spell__name {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
}

.spell--current .spell__icon {
  width: 2.9rem;
  height: 2.9rem;
  padding: 0.45rem;
}

.spell--current .spell__text {
  font-size: 1.1rem;
}

.spell__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@keyframes cast {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.board {
  display: grid;
  gap: 0.6rem;
}

.board__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  color: var(--muted);
  font: 700 0.76rem/1.2 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.board__hint {
  color: var(--faint);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.board__list {
  display: grid;
  gap: 0.5rem;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.board-item img {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
}

.board-item__label {
  flex: 1;
  min-width: 0;
}

.board-item__action {
  color: var(--faint);
  font-size: 1.3rem;
  line-height: 1;
}

.board-item:hover {
  border-color: rgba(134, 169, 255, 0.45);
  background: rgba(134, 169, 255, 0.08);
}

.board-item:hover .board-item__action {
  color: var(--err);
}

.board-item--secret {
  border-color: rgba(243, 183, 94, 0.3);
  background: rgba(243, 183, 94, 0.06);
}

.board-item--secret:hover {
  border-color: var(--gold);
  background: rgba(243, 183, 94, 0.14);
}

.count {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(243, 183, 94, 0.15);
  color: var(--gold);
  font: 800 0.85rem/1.2 var(--font-display);
}

.history {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.history .section-title {
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

/* L'historique arrive du plus recent au plus ancien. */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0 0 0 1.5rem;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0.3rem;
  width: 1px;
  background: var(--line-strong);
}

.history-entry {
  position: relative;
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 15, 11, 0.8);
}

.history-entry::before {
  content: '';
  position: absolute;
  top: 1.25rem;
  left: calc(-1.2rem - 5px);
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.16);
}

.history-entry__meta {
  margin-bottom: 0.35rem;
  color: var(--faint);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-entry__spell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
}

.history-entry__spell .spell__icon {
  width: 1.8rem;
  height: 1.8rem;
  padding: 0.3rem;
}

.history-entry__text {
  color: var(--muted);
  font-size: 0.96rem;
}

@media (max-width: 980px) {
  .fight-layout {
    grid-template-columns: 1fr;
  }

  .fight-boss {
    position: static;
  }
}

/* ---- Fenetres modales (rendues par le serveur) --------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(5, 3, 2, 0.72);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal.show-modal {
  display: grid;
  animation: fade 0.25s ease-out;
}

.modal-in {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 40px 80px -30px #000, 0 0 70px -24px rgba(255, 107, 44, 0.4);
  text-align: center;
  cursor: default;
  animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

#modal {
  cursor: default;
}

#modal .modal-in {
  max-width: 780px;
}

.modal__icon {
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.9rem;
}

.modal__title {
  margin: 0 0 0.3rem;
  font: 800 clamp(1.7rem, 4vw, 2.3rem)/1.15 var(--font-display);
}

.modal__text {
  margin: 0;
  font-size: 1.15rem;
}

.modal__hint {
  margin: 1.25rem 0 0;
  color: var(--faint);
  font-size: 0.85rem;
}

.modal__actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.trophy-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0.75rem;
  margin: 1.4rem 0 0;
}

.trophy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.93rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.trophy img {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.25rem;
}

.trophy__name {
  color: var(--text);
  font: 700 1.05rem/1.2 var(--font-display);
}

.trophy input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trophy:hover {
  border-color: rgba(243, 183, 94, 0.55);
}

.trophy:has(input:checked) {
  border-color: var(--gold);
  background: rgba(243, 183, 94, 0.12);
  box-shadow: 0 0 0 1px var(--gold), 0 12px 30px -14px rgba(243, 183, 94, 0.6);
}

.trophy:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

/* ---- Reglement ----------------------------------------------------------- */

.search {
  display: flex;
  gap: 0.5rem;
  max-width: 640px;
  margin: 0 auto 2.25rem;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 183, 94, 0.15);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 1rem;
  border: 0;
  background: transparent;
}

.search input:focus {
  outline: none;
}

.results {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.results__title {
  margin: 0;
  color: var(--muted);
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result {
  padding: 1.4rem 1.6rem;
  border-left: 3px solid var(--gold);
}

.result h2 {
  font-size: 1.3rem;
}

.prose {
  line-height: 1.75;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin-top: 1.4em;
  font-size: 1.3rem;
}

.rules-text {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.result h2 a {
  color: var(--text);
  text-decoration: none;
}

.result h2 a:hover {
  color: var(--gold);
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.rules-toc {
  position: sticky;
  top: 5.5rem;
  padding: 1.25rem 1.4rem;
}

.rules-toc ol {
  display: grid;
  gap: 0.15rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rules-toc li {
  counter-increment: rule;
}

.rules-toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
}

.rules-toc a::before {
  content: counter(rule);
  min-width: 1.1rem;
  color: var(--ember);
  font-family: var(--font-display);
  font-weight: 700;
}

.rules-toc a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.rules-main {
  display: grid;
  gap: 1rem;
}

.rule {
  scroll-margin-top: 5.5rem;
}

.rule:target {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

/* Les entrees sont saisies avec de simples retours a la ligne. */
.rule__text {
  white-space: pre-line;
}

@media (max-width: 860px) {
  .rules-layout {
    grid-template-columns: 1fr;
  }

  .rules-toc {
    position: static;
  }
}

/* Sur mobile, l'en-tete passe sur deux lignes. */
@media (max-width: 760px) {
  .rule {
    scroll-margin-top: 7rem;
  }
}

/* ---- Aide et contact ----------------------------------------------------- */

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.help-card {
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.help-card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: rgba(255, 107, 44, 0.12);
  color: var(--ember-2);
}

.help-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.help-card h2 {
  font-size: 1.4rem;
}

.help-card p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 2rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid rgba(255, 107, 44, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 107, 44, 0.18), rgba(201, 54, 31, 0.06) 60%, transparent), var(--surface);
}

.cta-band h2 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.cta-band p {
  margin: 0;
  color: var(--muted);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  gap: clamp(1.5rem, 5vw, 4rem);
}

.contact-aside .lead {
  color: var(--text);
}

.contact-form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(243, 183, 94, 0.15);
}

.notice {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.notice.ok {
  border: 1px solid rgba(127, 211, 154, 0.35);
  background: rgba(127, 211, 154, 0.1);
  color: var(--ok);
}

.notice.error {
  border: 1px solid rgba(255, 138, 122, 0.35);
  background: rgba(255, 138, 122, 0.1);
  color: var(--err);
}

/* Piege a robots : invisible pour un humain, present dans le formulaire. */
.tel {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 820px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* ---- Erreurs ------------------------------------------------------------- */

.error-page {
  display: grid;
  place-content: center;
  min-height: 62vh;
  padding-block: 4rem;
  text-align: center;
}

.error-page__code {
  margin: 0;
  font: 800 clamp(5rem, 18vw, 10rem)/1 var(--font-display);
  filter: drop-shadow(0 0 40px rgba(255, 107, 44, 0.35));
}

.error-page__message {
  margin: 0.5rem 0 2rem;
  color: var(--muted);
  font: 500 1.3rem/1.4 var(--font-body);
}

/* ---- Mouvement reduit ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
