/* ============================
   MINI CASINO – STYLE GLOBAL
   ============================ */

:root {
  color-scheme: dark;

  --bg-deep: #071b16;
  --bg-mid: #0b2f26;

  --panel: rgba(10, 30, 24, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);

  --text: #f7f2e9;
  --muted: rgba(247, 242, 233, 0.7);

  --accent: #46d98b;
  --accent-2: #f3c969;
  --danger: #ef5b5b;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

/* ============================
   GLOBAL
   ============================ */

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

body {
  margin: 0;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;   /* centre verticalement */
  align-items: center;       /* centre horizontalement */

  background:
    radial-gradient(900px 500px at 85% 10%, rgba(255, 200, 87, 0.15), transparent 60%),
    radial-gradient(700px 420px at 12% 15%, rgba(70, 217, 139, 0.2), transparent 55%),
    linear-gradient(160deg, #071b16, #0b2f26);

  font-family: "DM Sans", sans-serif;
  color: #f7f2e9;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================
   LAYOUT
   ============================ */

.container {
  width: 100%;
  max-width: 900px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* ============================
   BRAND
   ============================ */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd166, #f3c969);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.05em;
}

.brand .sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ============================
   CARDS / PANELS
   ============================ */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ============================
   GRID
   ============================ */

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

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

/* ============================
   HERO
   ============================ */

.hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--accent-2);
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================
   FORM
   ============================ */

.form h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.field {
  margin-bottom: 14px;
}

.label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(14, 38, 31, 0.95);
  color: var(--text);
  text-align: center;

  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 8px 24px rgba(0, 0, 0, 0.35);

  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: rgba(247, 242, 233, 0.5);
}

.input:focus {
  outline: none;
  border: 1px solid rgba(243, 201, 105, 0.6);
  box-shadow: inset 0 0 0 1px rgba(243, 201, 105, 0.25);
}

/* ============================
   BUTTONS
   ============================ */

.btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  color: #0b1f19;
  background: linear-gradient(135deg, #57f4a0, #38b975);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  filter: brightness(1.05);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, #ffd166, #f3c969);
  color: #3f1f00;
}

/* ============================
   BADGES
   ============================ */

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.badge {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  font-size: 14px;
}

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

/* ============================
   TILES / JEUX
   ============================ */

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

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

.tile {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: 0.15s ease;
}

.tile:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.tile h4 {
  margin: 0 0 6px;
  color: var(--accent-2);
}

.tile p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ============================
   ALERT
   ============================ */

.alert {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(239, 91, 91, 0.18);
  border: 1px solid rgba(239, 91, 91, 0.3);
  font-size: 14px;
  display: none;
}

.alert.show {
  display: block;
}

/* ============================
   FOOTER
   ============================ */

.footer {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ============================
   PRE / RESULTATS
   ============================ */

pre {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  font-size: 14px;
}

/* ============================
   BLACKJACK UI
   ============================ */

.bj-table {
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px;
}

.bj-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bj-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  color: var(--accent-2);
}

.bj-score {
  color: var(--muted);
  font-weight: 600;
}

.bj-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 0;
}

.bj-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 54px;
}

.bj-card {
  width: 52px;
  height: 70px;
  border-radius: 12px;
  background: rgba(247, 242, 233, 0.92);
  color: #0b1f19;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.bj-card.back {
  background: rgba(14, 38, 31, 0.95);
  color: rgba(247, 242, 233, 0.85);
  border: 1px solid rgba(255,255,255,0.12);
}

.bj-bets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

@media (max-width: 520px) {
  .bj-bets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bj-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px) {
  .bj-actions { grid-template-columns: 1fr; }
}

/* ===== FOOTER MINI CASINO ===== */

.casino-footer {
  margin-top: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 0 30px;
}

.footer-btn {
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3c969, #e2b44f);
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.footer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.45);
  filter: brightness(1.05);
}

.footer-btn:active {
  transform: scale(0.97);
}

/* ===== BLACKJACK UI ===== */

.bj-table {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(10, 30, 24, 0.5);
  padding: 14px;
}

.bj-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bj-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  letter-spacing: .02em;
}

.bj-score {
  font-weight: 600;
  opacity: .8;
}

.bj-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 14px 0;
}

.bj-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 64px;
}

.bj-card {
  width: 54px;
  height: 72px;
  border-radius: 12px;
  background: rgba(247, 242, 233, 0.95);
  color: #0b1f19;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 10px 20px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 9px;
  user-select: none;
}

.bj-card.back {
  background: rgba(14, 38, 31, 0.92);
  color: rgba(247, 242, 233, 0.85);
  border: 1px solid rgba(255,255,255,.14);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.bj-rank {
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.bj-suit {
  font-size: 18px;
  line-height: 1;
  align-self: flex-end;
}

.bj-suit.red {
  color: #b51e1e;
}

.bj-bets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.bj-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 520px) {
  .bj-bets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bj-actions { grid-template-columns: 1fr; }
}

.casino-footer {
  position: fixed;
  bottom: 20px;
}

/* ============================
   LAYOUT PROPRE (CENTRAGE / APP)
   ============================ */

/* Par défaut: pages APP (menu, blackjack, etc.) */
body.page-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;       /* centre horizontal */
  justify-content: flex-start; /* PAS centré vertical */
  padding: 28px 16px 110px;  /* bas = place pour footer */
}

/* Page d'entrée (choix du nom) centrée */
body.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centré vertical */
  padding: 28px 16px 110px;  /* place footer */
}

/* Container: largeur lisible + stable */
.container {
  width: min(1100px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Topbar: alignements plus propres */
.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
}

.brand .sub {
  margin: 2px 0 0;
}

/* Footer fixé en bas (ne recouvre pas grâce au padding-bottom du body) */
.casino-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  pointer-events: none; /* évite de bloquer scroll/clics autour */
  z-index: 9999;
}

.casino-footer .footer-btn {
  pointer-events: auto;
}

/* ============================
   BLACKJACK: meilleure mise en page
   ============================ */

/* Les deux cartes (hero + panel) avec bonne largeur */
.grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 16px;
  align-items: start;
}

/* Sur écran moyen/petit: colonne unique */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Table blackjack : respire + limites */
.bj-table {
  width: 100%;
}

.bj-bets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .bj-bets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Boutons actions : ne débordent pas */
.bj-actions {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 520px) {
  .bj-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================
   ROULETTE
   ============================ */

.roulette-wheel {
  display: grid;
  place-items: center;
  gap: 10px;
}

.roulette-ring {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  border: 3px solid rgba(243, 201, 105, .7);
  background: rgba(10, 30, 24, 0.55);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.roulette-number {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 40px;
  letter-spacing: .02em;
  border: 2px solid rgba(255,255,255,.12);
}

.roulette-number.is-red { background: rgba(197, 55, 55, .85); }
.roulette-number.is-black { background: rgba(20, 20, 20, .85); }
.roulette-number.is-green { background: rgba(20, 120, 70, .85); }

.roulette-meta {
  opacity: .75;
  font-size: 13px;
  text-align: center;
}

/* ============================
   SLOTS
   ============================ */

.slots-reels {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.slot-reel {
  height: 96px;
  border-radius: 16px;
  background: rgba(10, 30, 24, 0.55);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  font-size: 44px;
}

.slots-meta {
  margin-top: 10px;
  opacity: .8;
  font-size: 14px;
  text-align: center;
}