.online-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.online-modal.active {
  display: flex;
}

.online-box {
  width: min(430px, 92vw);
  padding: 28px;
  background: linear-gradient(180deg, rgba(24, 28, 16, .96), rgba(8, 9, 5, .96));
  border: 1px solid rgba(201, 155, 74, .45);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .75);
}

.online-box input {
  width: 100%;
  margin: 16px 0;
  padding: 16px;
  background: #090b06;
  border: 1px solid rgba(201, 155, 74, .4);
  color: var(--text);
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.close-btn {
  background: transparent;
}

:root {
  --bg: #070805;
  --panel: #11140d;
  --green: #8fbf4d;
  --gold: #c99b4a;
  --red: #9b2f24;
  --muted: #c9c2a9;
  --text: #f4ead2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, #1f2a18, transparent 35%),
    radial-gradient(circle at 85% 25%, #3b1110, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 18px 34px;
  background: rgba(7, 8, 5, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 155, 74, .35);
}

.brand {
  font-family: Cinzel, serif;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .08em;
}

.mark {
  color: var(--green);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
}

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

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding-top: clamp(24px, 5vw, 80px);
  padding-right: clamp(24px, 5vw, 80px);
  padding-bottom: clamp(20px, 2.5vw, 36px);
  padding-left: clamp(28px, 2.8vw, 42px);
  background: #070805;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(7, 8, 5, .35),
      rgba(7, 8, 5, .10));
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  padding: clamp(18px, 2.5vw, 32px);
  background: rgba(5, 7, 4, .45);
  border: 1px solid rgba(201, 155, 74, .28);
  border-radius: 18px;
  backdrop-filter: blur(6px);
}

.hero h1 {
  font-size: 30px !important;
  line-height: .95;
  max-width: 100%;
}

.hero .lead {
  font-size: clamp(.95rem, 1.25vw, 1.15rem);
  line-height: 1.6;
  max-width: 100%;
}

@media (max-width: 900px) {
  .hero {
    aspect-ratio: auto;
    min-height: 70vh;
    padding: clamp(20px, 4vw, 40px);
  }

  .hero-bg {
    object-position: center;
  }

  .hero__content {
    width: 100%;
  }
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: Cinzel, serif;
  margin: .2em 0;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
}

.actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  padding: 14px 20px;
  border: 1px solid var(--gold);
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.primary {
  background: linear-gradient(135deg, var(--red), #3e1710);
  box-shadow: 0 0 30px rgba(155, 47, 36, .35);
}

.ghost {
  background: rgba(143, 191, 77, .08);
}

.hero__card img,
.board-preview img {
  width: 100%;
  border: 1px solid rgba(201, 155, 74, .45);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
  border-radius: 12px;
}

.section {
  padding: 80px 7vw;
}

.split {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 40px;
  align-items: start;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-grid article,
.news-list article {
  background: rgba(17, 20, 13, .78);
  border: 1px solid rgba(201, 155, 74, .25);
  padding: 24px;
  border-radius: 14px;
}

.feature-grid strong {
  display: block;
  color: var(--green);
  font-family: Cinzel, serif;
  font-size: 1.25rem;
}

.feature-grid span,
.news-list p,
.contact p,
.how li {
  color: var(--muted);
  line-height: 1.6;
}

.dark {
  background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(143, 191, 77, .06));
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.mock-card {
  min-height: 330px;
  border: 1px solid rgba(201, 155, 74, .45);
  border-radius: 16px;
  background: #12150d;
  overflow: hidden;
  position: relative;
}

.mock-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mock-card span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  padding: 10px;
  background: rgba(0, 0, 0, .65);
  border: 1px solid rgba(201, 155, 74, .35);
  font-family: Cinzel, serif;
}

.mock-card.empty {
  display: flex;
  align-items: end;
  background: linear-gradient(135deg, #1a2412, #361411);
}

.news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.news-list time {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
}

.how {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 34px;
  align-items: center;
}

.how ol {
  padding-left: 22px;
}

.how li {
  margin: 12px 0;
}

.contact {
  text-align: center;
  background: radial-gradient(circle, rgba(155, 47, 36, .22), transparent 55%);
}

footer {
  text-align: center;
  color: #8f886f;
  padding: 28px;
  border-top: 1px solid rgba(201, 155, 74, .25);
}

@media (max-width: 900px) {

  .split,
  .how {
    grid-template-columns: 1fr;
  }

  .gallery,
  .news-list,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============================================
   FLOW PLAY
   ============================================ */
.play-section {
  position: relative;
  min-height: 60vh;
}

.play-step {
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
  margin-top: 28px;
}

.play-step-hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px);
}

.play-step.entering {
  opacity: 0;
  transform: translateY(20px);
}

.btn-large {
  padding: 20px 48px !important;
  font-size: 1.1rem !important;
  letter-spacing: .12em;
}

.btn-icon {
  margin-right: 10px;
  font-size: .85em;
}

.step-title {
  margin: 0 0 24px;
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  color: #f4ead2;
  letter-spacing: .04em;
}

.play-step-back {
  margin-top: 28px;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  color: #c99b4a;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 8px 16px;
  text-transform: uppercase;
  transition: color .2s ease;
}

.btn-link:hover {
  color: #f4ead2;
}

/* ============================================
   GRILLE DE DECKS
   ============================================ */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 12px;
}

.deck-card {
  position: relative;
  padding: 24px 18px;
  border: 1px solid rgba(201, 155, 74, .35);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 28, 16, .92), rgba(8, 9, 5, .92));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  overflow: hidden;
}

.deck-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(201, 155, 74, .12), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}

.deck-card.deck-available {
  cursor: pointer;
}

.deck-card.deck-available:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 155, 74, .8);
  box-shadow: 0 25px 50px rgba(0, 0, 0, .6), 0 0 30px rgba(201, 155, 74, .25);
}

.deck-card.deck-available:hover::before {
  opacity: 1;
}

.deck-card.deck-locked {
  opacity: .45;
  filter: grayscale(.5);
  cursor: not-allowed;
}

.deck-card-icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
}

.deck-card-name {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  color: #f4ead2;
  letter-spacing: .06em;
}

.deck-card-style {
  margin: 0;
  color: #c99b4a;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 600;
}

.deck-card-desc {
  margin: 8px 0 12px;
  color: #b9b09b;
  font-size: .82rem;
  line-height: 1.4;
  min-height: 56px;
}

.deck-card-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(143, 191, 77, .18);
  border: 1px solid rgba(143, 191, 77, .6);
  border-radius: 999px;
  color: #aee8a5;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.deck-card-badge.locked {
  background: rgba(201, 155, 74, .12);
  border-color: rgba(201, 155, 74, .35);
  color: #c99b4a;
}

/* ============================================
   BOUTON CRÉATION DE DECK
   ============================================ */
.deck-extra {
  margin-top: 28px;
  text-align: center;
}

.deck-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: transparent;
  border: 1px dashed rgba(201, 155, 74, .35);
  border-radius: 14px;
  color: #c99b4a;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: not-allowed;
  opacity: .55;
}

.plus-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.coming-soon {
  margin-left: 12px;
  padding: 3px 10px;
  background: rgba(201, 155, 74, .15);
  border-radius: 999px;
  font-size: .7rem;
  letter-spacing: .12em;
}

/* ============================================
   LOBBY
   ============================================ */
.lobby-header {
  text-align: center;
  margin-bottom: 36px;
}

.selected-deck-badge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(24, 28, 16, .92), rgba(8, 9, 5, .92));
  border: 1px solid rgba(201, 155, 74, .55);
  border-radius: 999px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, .55);
}

.selected-deck-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.selected-deck-name {
  font-family: "Cinzel", serif;
  font-size: 1.15rem;
  color: #f4ead2;
  letter-spacing: .06em;
}

.change-deck-btn {
  padding: 6px 14px;
  background: rgba(201, 155, 74, .15);
  border: 1px solid rgba(201, 155, 74, .4);
  border-radius: 999px;
  color: #c99b4a;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease;
}

.change-deck-btn:hover {
  background: rgba(201, 155, 74, .25);
}

.lobby-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 960px;
  margin: 0 auto;
}

.lobby-action-btn {
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(24, 28, 16, .92), rgba(8, 9, 5, .92));
  border: 1px solid rgba(201, 155, 74, .35);
  border-radius: 18px;
  color: #f4ead2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  font-family: inherit;
}

.lobby-action-btn:hover:not(.locked):not(:disabled) {
  transform: translateY(-4px);
  border-color: rgba(201, 155, 74, .8);
  box-shadow: 0 25px 50px rgba(0, 0, 0, .6);
}

.lobby-action-btn.primary {
  border-color: rgba(155, 47, 36, .75);
  background: linear-gradient(180deg, rgba(72, 22, 16, .92), rgba(28, 8, 6, .92));
}

.lobby-action-btn.primary:hover:not(.locked):not(:disabled) {
  border-color: rgba(232, 90, 79, 1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, .6), 0 0 30px rgba(232, 90, 79, .25);
}

.lobby-action-btn.locked {
  opacity: .45;
  filter: grayscale(.5);
  cursor: not-allowed;
}

.lobby-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
}

.lobby-action-title {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  letter-spacing: .04em;
}

.lobby-action-desc {
  color: #b9b09b;
  font-size: .82rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .deck-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .deck-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* ── Auth topbar ── */
.topbar-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-connexion {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #b5903a, #8a6c28);
  color: #1a1008;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-connexion:hover {
  background: linear-gradient(135deg, #e8c06a, #a07a30);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.15s;
  position: relative;
}

.user-badge:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #e8dcc8;
}

.user-badge .user-name {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
}

#auth-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

#auth-popup.active {
  display: flex;
}

.auth-popup-box {
  background: #0f0d09;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
}

.auth-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.auth-popup-close:hover {
  color: #e8dcc8;
}

.auth-popup-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b5903a;
  margin-bottom: 0.75rem;
}

.auth-popup-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8dcc8;
  margin-bottom: 0.5rem;
}

.auth-popup-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.auth-popup-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
}

.auth-popup-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  text-align: center;
}

.auth-popup-btn.primary {
  background: linear-gradient(135deg, #b5903a, #8a6c28);
  color: #1a1008;
  border: none;
}

.auth-popup-btn.primary:hover {
  background: linear-gradient(135deg, #e8c06a, #a07a30);
}

.auth-popup-btn.ghost {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.auth-popup-btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #e8dcc8;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0f0d09;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.5rem;
  min-width: 160px;
  z-index: 100;
}

.user-badge:hover .user-dropdown,
.user-badge.open .user-dropdown {
  display: block;
}

.user-dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.13s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8dcc8;
}

.user-dropdown-item.danger:hover {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.topbar-auth {
  display: flex;
  align-items: center;
  margin-left: auto;
}
