:root {
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --surface-alt: #F1F3F8;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;

  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-50: #EEF0FF;
  --primary-100: #E0E1FF;

  --gold: #B8802E;
  --gold-bg: #FBF3E7;

  --text-primary: #101322;
  --text-secondary: #5B6072;
  --text-tertiary: #9AA0B4;

  --success: #12B76A;
  --success-bg: #ECFDF3;
  --danger: #F04438;
  --danger-bg: #FEF3F2;
  /* Alias rétro-compatibles utilisés directement dans certains scripts */
  --red: #F04438;
  --green: #12B76A;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16, 19, 34, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 19, 34, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 19, 34, 0.12);

  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.ember-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(79,70,229,0.06), transparent),
    radial-gradient(50% 35% at 100% 20%, rgba(184,128,46,0.06), transparent);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: var(--font-body);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__mark {
  font-size: 18px; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.topbar__title strong {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 15px; letter-spacing: 0.2px; color: var(--text-primary);
}
.topbar__title small { color: var(--text-tertiary); font-size: 10px; letter-spacing: 1.2px; font-weight: 600; }

.topbar__nav { display: flex; gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: 999px; }
.nav-link {
  background: transparent; border: none; color: var(--text-secondary);
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; transition: all 0.15s ease;
}
.nav-link.active, .nav-link:hover { color: var(--primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-link--admin { color: var(--gold); }
.nav-logo {
    height: 46px;
    width: 46px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    padding: 0px;
}

.topbar__account { display: flex; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; letter-spacing: 0.1px; font-size: 14px;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: scale(0.98); }
.btn--gold { background: linear-gradient(135deg, var(--gold), #D6A24E); color: #fff; font-weight: 700; box-shadow: var(--shadow-sm); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text-primary); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-alt); }
.btn--discord { background: #5865F2; color: #fff; box-shadow: var(--shadow-sm); }
.btn--red { background: var(--danger); color: #fff; }
.btn--dark { background: #1c1f2b; color: #fff; }
.btn--green { background: var(--success); color: #fff; }
.btn--block { width: 100%; justify-content: center; }
.btn-icon { background: transparent; border: none; color: var(--text-tertiary); font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.btn-icon:hover { background: var(--surface-alt); color: var(--danger); }

.account-chip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); padding: 6px 14px 6px 6px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.account-chip img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }
.account-chip__info { display: flex; flex-direction: column; line-height: 1.25; }
.account-chip__info span:first-child { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.balance { color: var(--gold); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }

/* ---------- SECTIONS ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 48px 24px 90px; }
.section { display: none; animation: fadeIn 0.25s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 48px; padding: 20px 0 56px; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  background: var(--primary-50); padding: 6px 14px; border-radius: 999px;
}
.hero__text h1 { font-family: var(--font-display); font-weight: 700; font-size: 46px; line-height: 1.12; margin: 20px 0; letter-spacing: -0.5px; }
.hero__text h1 em { font-style: normal; color: var(--primary); }
.hero__text p { color: var(--text-secondary); max-width: 460px; margin-bottom: 30px; font-size: 15.5px; line-height: 1.6; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__chipstack { position: relative; width: 260px; height: 240px; flex-shrink: 0; }
.chip {
  position: absolute; width: 128px; height: 128px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.4);
}
.chip--1 { background: linear-gradient(135deg, #EEF0FF, #DCE0FF); color: var(--primary-dark); top: 60px; left: 0; transform: rotate(-6deg); }
.chip--2 { background: linear-gradient(135deg, #FBF3E7, #F3E0BC); color: var(--gold); top: 20px; left: 66px; z-index: 2; transform: rotate(4deg); }
.chip--3 { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; top: 92px; left: 132px; z-index: 3; transform: rotate(-3deg); }

.rules-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 4px 0 48px; }
.rule {
  color: var(--text-secondary); font-size: 13.5px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.rule span { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--primary); font-family: var(--font-mono); font-weight: 700; font-size: 11px; background: var(--primary-50); border-radius: 50%; margin-bottom: 10px; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.game-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; box-shadow: var(--shadow-sm); }
.game-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.game-card__head { display: flex; justify-content: space-between; align-items: center; }
.game-card h3 { font-family: var(--font-display); font-weight: 700; margin: 0; font-size: 17px; }
.badge { font-family: var(--font-mono); font-weight: 700; font-size: 11px; background: var(--gold-bg); color: var(--gold); padding: 4px 10px; border-radius: 999px; }
.game-card p { color: var(--text-secondary); font-size: 13.5px; margin: 12px 0 20px; line-height: 1.5; }

.muted { color: var(--text-secondary); font-size: 13px; }

/* ---------- REVIEWS ---------- */
.reviews-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.review-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-card__head img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }
.review-card__head strong { font-size: 13.5px; }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 14px; }
.review-card p { color: var(--text-secondary); font-size: 13.5px; margin: 8px 0 0; line-height: 1.5; }

.reviews-layout { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
.review-form-card { background: var(--surface); border: 1px solid var(--border); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.review-form-card h3 { font-family: var(--font-display); margin-top: 0; }
.star-picker { display: flex; gap: 6px; font-size: 26px; margin: 16px 0; }
.star-picker button { background: none; border: none; color: var(--border-strong); }
.star-picker button.selected { color: var(--gold); }
#reviewComment { width: 100%; min-height: 90px; margin-bottom: 14px; resize: vertical; }
.reviews-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; align-content: start; }
.form-msg { font-size: 12.5px; margin-top: 10px; min-height: 14px; font-weight: 500; }

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

/* ---------- MODALES DE JEU ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,19,34,0.45); backdrop-filter: blur(3px); display: none; z-index: 100; }
.modal-backdrop.active { display: block; }
.game-modal {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(420px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; z-index: 101; box-shadow: var(--shadow-lg);
}
.game-modal--wide { width: min(520px, 92vw); }
.game-modal.active { display: block; }
.game-modal h2 { font-family: var(--font-display); font-weight: 700; margin-top: 0; }
.modal-close { position: absolute; top: 16px; right: 18px; background: var(--surface-alt); border: none; color: var(--text-secondary); font-size: 18px; width: 30px; height: 30px; border-radius: 50%; line-height: 1; }
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.bet-row { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.bet-row input[type="number"], .bet-row input[type="text"] { flex: 1; min-width: 120px; }

.choice-toggle { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.choice { padding: 11px 16px; background: var(--surface); color: var(--text-secondary); border: none; font-weight: 600; font-size: 13.5px; }
.choice.active { background: var(--primary); color: #fff; }

.coin {
  font-size: 56px; text-align: center; margin: 8px auto 22px; transition: transform 0.4s ease;
  width: 100px; height: 100px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); border-radius: 50%; border: 1px solid var(--border);
}
.coin.flipping { animation: flip 0.6s ease; }
@keyframes flip { 0% { transform: rotateY(0);} 100% { transform: rotateY(1080deg);} }

.result-line { text-align: center; margin-top: 18px; font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; min-height: 18px; }
.result-line.win { color: var(--success); }
.result-line.lose { color: var(--danger); }

.roulette-wheel {
  width: 140px; height: 140px; margin: 0 auto 18px; border-radius: 50%;
  background: conic-gradient(#DC3B3B 0 10%, #1c1f2b 10% 20%, #DC3B3B 20% 30%, #1c1f2b 30% 40%, #DC3B3B 40% 50%, #1c1f2b 50% 60%, #DC3B3B 60% 70%, #1c1f2b 70% 80%, #DC3B3B 80% 90%, #1c1f2b 90% 97%, var(--success) 97% 100%);
  display: flex; align-items: center; justify-content: center;
  border: 5px solid var(--surface); box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  transition: transform 2.4s cubic-bezier(0.15,0.85,0.3,1);
}
.roulette-wheel span { background: var(--surface); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }
.roulette-bets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.number-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-bottom: 8px; }
.number-grid button { padding: 7px 0; font-size: 11px; font-weight: 600; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 6px; }
.number-grid button.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

.slot-machine { display: flex; gap: 10px; justify-content: center; margin: 12px 0 22px; }
.reel { width: 72px; height: 72px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.reel.spinning { animation: spin 0.15s linear infinite; }
@keyframes spin { 0% { transform: translateY(0);} 50% { transform: translateY(-6px);} 100% { transform: translateY(0);} }

.bj-table { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.bj-hand { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.bj-label { font-family: var(--font-display); color: var(--primary); font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px; }
.bj-cards { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.bj-card { width: 42px; height: 58px; background: #fff; color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px; box-shadow: var(--shadow-sm); }
.bj-card.red { color: var(--danger); }
.bj-actions { display: flex; gap: 10px; }

.crash-display { text-align: center; margin: 12px 0 22px; }
.crash-multiplier { font-family: var(--font-display); font-weight: 700; font-size: 52px; color: var(--primary); }
.crash-multiplier.crashed { color: var(--danger); }
.crash-status { color: var(--text-secondary); font-family: var(--font-mono); font-size: 12.5px; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text-primary); border: 1px solid var(--text-primary); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- ADMIN ---------- */
.admin-body { background: var(--bg); }
.admin-main { max-width: 1000px; margin: 0 auto; padding: 44px 24px 90px; display: flex; flex-direction: column; gap: 24px; }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.admin-panel h2 { font-family: var(--font-display); font-weight: 700; margin-top: 0; font-size: 17px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-tertiary); font-weight: 600; font-family: var(--font-body); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.admin-table tbody tr:hover { background: var(--surface-alt); }

@media (max-width: 720px) {
  .hero__chipstack { display: none; }
  .hero__text h1 { font-size: 34px; }
  .rules-strip { grid-template-columns: 1fr; }
}
