/* ============================================================
   RED ACE CASINO — Luxury Gambling House Design System
   Palette: deep black, rich crimson, gold filigree
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg-deep:      #08050a;
  --bg-base:      #0d0810;
  --bg-soft:      #181019;
  --bg-elev:      #221520;
  --bg-table:     #0b3a26;
  --bg-table-2:   #0a3322;

  /* Reds */
  --red-dark:     #5a0a14;
  --red:          #8b0a1f;
  --red-rich:     #b8122e;
  --red-bright:   #e41b3a;
  --red-glow:     rgba(228, 27, 58, 0.45);

  /* Gold */
  --gold-dark:    #8a6b22;
  --gold:         #c9a046;
  --gold-bright:  #f3d173;
  --gold-glow:    rgba(243, 209, 115, 0.55);

  /* Text */
  --text:         #f5ecd9;
  --text-muted:   #b9a98f;
  --text-dim:     #7a6b56;
  --text-onred:   #fff4e3;

  /* Suits */
  --suit-red:     #d61f3a;
  --suit-black:   #1a0a0e;

  /* Effects */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg:    0 20px 50px rgba(0, 0, 0, 0.75);
  --shadow-glow:  0 0 40px var(--red-glow);
  --shadow-gold:  0 0 30px var(--gold-glow);

  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    18px;
  --radius-xl:    28px;

  --border:       1px solid rgba(201, 160, 70, 0.25);
  --border-bold:  1px solid rgba(201, 160, 70, 0.5);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(139, 10, 31, 0.25), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(90, 10, 20, 0.2), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Subtle damask pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0, transparent 40px, rgba(201, 160, 70, 0.018) 40px, rgba(201, 160, 70, 0.018) 41px),
    repeating-linear-gradient(-45deg, transparent 0, transparent 40px, rgba(201, 160, 70, 0.018) 40px, rgba(201, 160, 70, 0.018) 41px);
  opacity: 0.7;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, .serif {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
  margin: 18px 0;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

/* ---------- Top Bar ---------- */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  background: linear-gradient(180deg, rgba(8, 5, 10, 0.95), rgba(8, 5, 10, 0.6));
  border-bottom: 1px solid rgba(201, 160, 70, 0.15);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--red-bright), var(--red-dark) 70%);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px var(--gold),
    inset 0 4px 10px rgba(255, 255, 255, 0.15),
    0 0 20px var(--red-glow);
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--gold-bright);
  position: relative;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 160, 70, 0.35);
  pointer-events: none;
}

.brand-text {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 60%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-sub {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--text-muted);
  text-transform: uppercase;
  -webkit-text-fill-color: var(--text-muted);
  margin-top: 2px;
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(34, 21, 32, 0.9), rgba(13, 8, 16, 0.9));
  border: 1px solid rgba(201, 160, 70, 0.35);
  border-radius: 100px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wallet-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold-dark) 70%);
  box-shadow: inset 0 0 0 2px var(--red-dark), inset 0 0 0 3px var(--gold-dark), 0 2px 4px rgba(0,0,0,.4);
  position: relative;
}
.wallet-chip::after {
  content: '♦';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--red-dark);
  font-weight: 700;
}

.wallet-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wallet-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid rgba(201, 160, 70, 0.2);
  color: var(--text);
  transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--red-dark); border-color: var(--gold); color: var(--gold-bright); transform: translateY(-1px); }
.icon-btn.muted { color: var(--text-dim); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Daily Reward (in topbar) ---------- */
/* Pill récompense quotidienne : dorée pulsante quand dispo (le joueur
   ne reste jamais coincé à 0 crédit), grisée avec compte à rebours
   quand déjà réclamée. */
.daily-reward {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  background: linear-gradient(180deg, rgba(34, 21, 32, 0.9), rgba(13, 8, 16, 0.9));
  border: 1px solid rgba(201, 160, 70, 0.35);
  color: var(--gold-bright);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.daily-reward .daily-glyph { width: 16px; height: 16px; flex: 0 0 auto; }
.daily-reward.available {
  border-color: var(--gold-bright);
  animation: daily-pulse 2s ease-in-out infinite;
}
.daily-reward.available:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(201, 160, 70, 0.22), rgba(13, 8, 16, 0.95));
}
.daily-reward.claimed {
  color: #9a8b6f;
  border-color: rgba(201, 160, 70, 0.2);
}
@keyframes daily-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 209, 115, 0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(243, 209, 115, 0); }
}

/* ---------- Mood Badge (in topbar) ---------- */
.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 0 8px 0 0;
  background: linear-gradient(180deg, rgba(34, 21, 32, 0.85), rgba(13, 8, 16, 0.85));
  border: 1px solid rgba(201, 160, 70, 0.35);
  border-radius: 100px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-transform: uppercase;
  position: relative;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
}
.mood-badge[hidden] { display: none; }
.mood-badge {
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.mood-badge:hover {
  transform: translateY(-1px);
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(201, 160, 70, 0.18), rgba(13, 8, 16, 0.9));
}
.mood-badge:active { transform: translateY(0); }
.mood-badge:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.mood-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-glow);
  position: relative;
}
.mood-badge::after {
  content: '';
  position: absolute;
  left: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-glow);
  animation: moodPulse 1.6s ease-in-out infinite;
}
.mood-badge .mood-glyph { display: none; }
.mood-badge .mood-label {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(201, 160, 70, 0.3);
}
.mood-badge[data-family="event"] { border-color: var(--red-bright); }
.mood-badge[data-family="event"]::after { background: var(--red-bright); box-shadow: 0 0 10px var(--red-glow); }
.mood-badge[data-family="poker"]::after,
.mood-badge[data-family="dice"]::after,
.mood-badge[data-family="slots"]::after { background: var(--gold-bright); }
.mood-badge[data-playing=""] { opacity: 0.55; }
.mood-badge[data-playing=""]::before,
.mood-badge[data-playing=""]::after {
  background: var(--text-dim);
  box-shadow: none;
  animation: none;
}
.mood-badge[data-music-muted="1"] {
  border-color: rgba(201, 160, 70, 0.45);
  background: linear-gradient(180deg, rgba(122, 107, 86, 0.16), rgba(13, 8, 16, 0.85));
}
.mood-badge[data-music-muted="1"]::before,
.mood-badge[data-music-muted="1"]::after {
  background: var(--text-dim);
  box-shadow: none;
  animation: none;
}
/* Soft amber hint when the on-disk folder is genuinely missing —
   file:// access itself no longer triggers this, since the audio
   element loads local files natively. */
.mood-badge[data-warning="kakegurui-unreachable"] {
  border-color: rgba(201, 160, 70, 0.6);
  background: linear-gradient(180deg, rgba(201, 160, 70, 0.10), rgba(13, 8, 16, 0.85));
}
.mood-badge[data-warning="kakegurui-unreachable"]::after {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
  animation: none;
  opacity: 0.7;
}

@keyframes moodPulse {
  0%, 100% { transform: scale(1);   opacity:   1; }
  50%      { transform: scale(1.5); opacity: 0.5; }
}

/* ---------- Layout ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 36px 80px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 70px 24px 60px;
  margin-bottom: 40px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 100%, rgba(228, 27, 58, 0.18), transparent 65%);
  pointer-events: none;
}

.hero-eyebrow { margin-bottom: 18px; }

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 900;
  background: linear-gradient(180deg, var(--text) 0%, var(--gold-bright) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  text-shadow: 0 2px 30px rgba(243, 209, 115, 0.1);
}

.hero h1 em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  display: block;
  font-size: 0.4em;
  color: var(--red-bright);
  -webkit-text-fill-color: var(--red-bright);
  margin-top: 8px;
  letter-spacing: 0.15em;
}

.hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  font-style: italic;
}

/* ---------- Game Grid ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 60px 0 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(201, 160, 70, 0.15);
}

.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--text);
}

.section-head h2 .accent {
  color: var(--gold);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
}

.section-head .meta { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg-base) 100%);
  border: 1px solid rgba(201, 160, 70, 0.18);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg), 0 0 32px rgba(228, 27, 58, 0.15);
}
.card { cursor: pointer; }
.card.locked { cursor: not-allowed; }

.card-banner {
  position: relative;
  height: 180px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, var(--red-dark), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg-elev));
  display: grid;
  place-items: center;
}

.card-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(228, 27, 58, 0.4), transparent 60%);
  opacity: 0.5;
}

.banner-deco {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 160, 70, 0.4);
  border-radius: 8px;
  pointer-events: none;
}
.banner-deco::before, .banner-deco::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid var(--gold);
}
.banner-deco::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.banner-deco::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.card-banner .glyph {
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  color: var(--gold-bright);
  text-shadow: 0 4px 30px rgba(243, 209, 115, 0.3), 0 0 80px var(--red-glow);
  position: relative;
  z-index: 2;
}

.card-body {
  padding: 22px 24px 26px;
  position: relative;
}

.card-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 1.6rem;
  color: var(--text);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  min-height: 42px;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(201, 160, 70, 0.3);
  color: var(--text-muted);
}
.tag.hot { color: var(--red-bright); border-color: var(--red-bright); background: rgba(228, 27, 58, 0.08); }
.tag.new { color: var(--gold-bright); border-color: var(--gold); background: rgba(201, 160, 70, 0.08); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, var(--red-bright) 0%, var(--red-rich) 60%, var(--red) 100%);
  color: var(--text-onred);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(201, 160, 70, 0.4);
}
.btn-ghost:hover { background: rgba(201, 160, 70, 0.08); border-color: var(--gold); color: var(--gold-bright); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: var(--red-dark);
  border: 1px solid var(--gold-dark);
  box-shadow: 0 6px 18px var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-2px); filter: brightness(1.05); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.4);
}

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Locked / Coming Soon ---------- */
.card.locked { opacity: 0.6; cursor: not-allowed; }
.card.locked:hover { transform: none; box-shadow: var(--shadow-md); border-color: rgba(201, 160, 70, 0.18); }

.card.locked .card-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,0.25) 12px 13px);
  z-index: 1;
}

.card.locked .glyph { color: var(--text-dim); text-shadow: none; }

.badge-soon {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 100px;
  font-weight: 600;
  z-index: 3;
}

/* ---------- Status / Toast ---------- */
.toast-area {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-soft));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 0.92rem;
  animation: slideIn 0.4s ease forwards;
  pointer-events: auto;
}
.toast.win { border-color: var(--gold-bright); box-shadow: var(--shadow-md), var(--shadow-gold); }
.toast.win .toast-title { color: var(--gold-bright); }
.toast.lose { border-color: var(--red-bright); }
.toast.lose .toast-title { color: var(--red-bright); }
.toast-title { font-family: 'Playfair Display', serif; font-weight: 700; margin-bottom: 4px; font-size: 1rem; }
.toast-body { color: var(--text-muted); font-size: 0.85rem; }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Game Page Common ---------- */
.game-page {
  min-height: calc(100vh - 81px);
  display: flex;
  flex-direction: column;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.game-title { display: flex; align-items: baseline; gap: 16px; }

.game-title h1 {
  font-size: 2.4rem;
  background: linear-gradient(180deg, var(--text), var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-title small {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--red-bright);
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.game-stats {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 18px;
  background: rgba(34, 21, 32, 0.5);
  border: 1px solid rgba(201, 160, 70, 0.2);
  border-radius: 10px;
}
.stat-label { font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--text-muted); }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold-bright);
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.back-link:hover { color: var(--gold-bright); }

/* ---------- Table / Board ---------- */
.table-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  background:
    radial-gradient(ellipse at center, var(--bg-table-2) 0%, var(--bg-table) 50%, #062a1c 100%);
  border: 6px solid transparent;
  background-clip: padding-box;
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.table-wrap::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  z-index: -1;
}

.table-wrap::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-xl) - 6px);
  border: 1px solid rgba(201, 160, 70, 0.4);
  pointer-events: none;
}

.felt-texture {
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-xl) - 6px);
  overflow: hidden;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(45deg, transparent 0 2px, rgba(255,255,255,0.04) 2px 3px);
  mix-blend-mode: overlay;
}

/* ---------- Controls Bar ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  background: rgba(8, 5, 10, 0.65);
  border: 1px solid rgba(201, 160, 70, 0.25);
  border-radius: 100px;
  padding: 6px 8px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.control-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
}

.chip-btn {
  position: relative;
  min-width: 46px;
  height: 38px;
  padding: 0 14px;
  border-radius: 100px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-soft));
  color: var(--gold-bright);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid rgba(201, 160, 70, 0.3);
  transition: all 0.2s;
}
.chip-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.chip-btn.active {
  background: linear-gradient(180deg, var(--red-bright), var(--red-rich));
  color: var(--text-onred);
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .topbar { padding: 14px 16px; }
  .shell { padding: 24px 16px 60px; }
  .brand-sub { display: none; }
  .hero { padding: 40px 16px 30px; }
  .grid { grid-template-columns: 1fr; }
  .table-wrap { padding: 20px 14px; }
  .game-title h1 { font-size: 1.7rem; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.center { display: grid; place-items: center; }
.muted-text { color: var(--text-muted); }
.gold-text { color: var(--gold-bright); }
.red-text  { color: var(--red-bright); }

/* Animations */
@keyframes chipPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
  /* Opacity-only — leaves the transform channel free for `.card:hover`. */
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--gold-glow); }
  50%      { box-shadow: 0 0 40px var(--gold-glow), 0 0 60px var(--red-glow); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-2deg); }
  75% { transform: translateX(6px) rotate(2deg); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-in { animation: fadeIn 0.6s ease forwards; }
.slide-up { animation: slideUp 0.5s ease forwards; }
.pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }

/* ============================================================
   MOBILE INTERFACE — Refonte mobile (août 2026)
   ----------------------------------------------------------
   Cible : 360–720 px de large (et en dessous via breakpoints
   emboîtés). Préserve 100% du visuel desktop et n'altère
   aucune des animations / keyframes ci-dessus.

   Hiérarchie d'adaptations :
     1.  shell padding resserré + safe-area pour le bas
     2.  game-head passe en colonne : titre d'abord, stats en dessous
     3.  controls flex-column : chip-rail en haut, CTA pleine largeur
     4.  cards lobby : banner + paddings rétrécis, hover tactile
     5.  toast : repositionné bas-centre, au-dessus du CTA sticky
   ============================================================ */

@media (max-width: 720px) {
  /* Safe area — iOS notch + bottom indicator ne coupent rien */
  html, body { overscroll-behavior-y: contain; }
  body {
    padding-left:  env(safe-area-inset-left,  0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* Shell — beaucoup plus d'air en bas pour absorber le CTA sticky */
  .shell,
  .shell.game-page {
    padding: 18px 14px 108px;
  }
  /* Sur la home (lobby), pas besoin d'autant de bottom padding
     (il n'y a pas de bottom action bar en sticky sur la grille). */
  .shell:not(.game-page) {
    padding: 18px 14px 60px;
  }

  /* ====== Hero / section heads ====== */
  .hero { padding: 32px 14px 22px; margin-bottom: 22px; }
  .hero h1 { font-size: 2.4rem; letter-spacing: 0.01em; }
  .hero h1 em { font-size: 0.42em; }
  .hero-sub { font-size: 1rem; padding: 0 4px; }

  .section-head { margin: 26px 0 18px; padding-bottom: 12px; }
  .section-head h2 { font-size: 1.55rem; }
  .section-head .meta { font-size: 0.7rem; }

  /* ====== Game-head (titre + stats) ======
     Desktop : titre | stats côte à côte.
     Mobile : titre plein-largeur, stats en dessous compressées en pill. */
  .game-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
  }
  .game-title {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .game-title h1 { font-size: 1.5rem; }
  .game-title small {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    margin-left: 4px;
  }
  .back-link { font-size: 0.72rem; letter-spacing: 0.16em; }
  .game-stats {
    display: flex;
    gap: 8px;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .game-stats .stat {
    flex: 1;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
  }
  .game-stats .stat-label {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }
  .game-stats .stat-value { font-size: 1.05rem; }

  /* ====== Lobby grid (cartes de jeu) ====== */
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card {
    border-radius: 14px;
    /* annule le lift / tilt qui ne sert à rien au tactile */
    animation: none !important;
  }
  .card:hover {
    transform: none;
    animation: none;
    box-shadow: var(--shadow-md);
    border-color: rgba(201, 160, 70, 0.18);
  }
  .card:active { transform: scale(0.99); }
  .card-banner { height: 132px; }
  .card-banner .glyph { font-size: 3.4rem; }
  .card-body { padding: 16px 16px 18px; }
  .card-eyebrow { font-size: 0.62rem; margin-bottom: 6px; }
  .card h3 { font-size: 1.25rem; }
  .card-desc {
    font-size: 0.83rem;
    min-height: 0;
    margin-bottom: 10px;
    line-height: 1.42;
  }
  .card-foot { margin-top: 10px; gap: 10px; }
  .tag { font-size: 0.62rem; padding: 3px 9px; letter-spacing: 0.12em; }
  .btn { padding: 9px 14px; font-size: 0.72rem; letter-spacing: 0.12em; gap: 6px; }

  /* ====== Table wrap (felt padded mais pas étouffé) ====== */
  .table-wrap {
    padding: 16px 10px;
    border-radius: 18px;
  }
  .table-wrap::before { inset: -7px; }
  .table-wrap::after { inset: 4px; border-radius: 14px; }

  /* ====== Controls bar (chips + boutons) ======
     Devient un sticky-bottom action bar sur mobile.
     On le rend vertical : chip-rail en haut, CTA en dessous.
     On applique la même règle à .bj-controls / .bac-controls
     (qui sont utilisés par blackjack et baccarat en interne). */
  .controls,
  .bj-controls,
  .bac-controls {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0) + 8px);
    z-index: 18;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 18px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(8, 5, 10, 0.55), rgba(8, 5, 10, 0.92));
    border: 1px solid rgba(201, 160, 70, 0.25);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.55);
  }
  .control-group {
    width: 100%;
    justify-content: stretch;
    padding: 5px;
    gap: 6px;
    border-radius: 14px;
  }
  .control-group .control-label {
    padding: 0 10px;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    flex: 0 0 auto;
  }
  .chip-btn {
    min-width: 0;
    flex: 1 1 0;
    height: 38px;
    padding: 0 4px;
    font-size: 0.88rem;
    border-radius: 100px;
  }
  .controls > .btn,
  .bj-controls > .btn,
  .bac-controls > .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    font-size: 0.94rem;
    letter-spacing: 0.16em;
  }
  .controls > .btn + .btn,
  .bj-controls > .btn + .btn,
  .bac-controls > .btn + .btn { width: 100%; justify-content: center; }

  /* ====== Toasts : bas-centre, au-dessus du CTA ====== */
  .toast-area {
    top: auto;
    right: 14px;
    left: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0) + 130px);
    align-items: center;
  }
  .toast {
    min-width: 0;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 12px 14px;
    font-size: 0.88rem;
  }
  .toast-title { font-size: 0.92rem; }
}

/* Très-petits écrans (≤ 380 px) — on serre encore */
@media (max-width: 380px) {
  .shell, .shell.game-page { padding: 14px 10px 118px; }
  .shell:not(.game-page) { padding: 14px 10px 60px; }
  .card-body { padding: 14px 14px 16px; }
  .card-banner { height: 110px; }
  .card h3 { font-size: 1.15rem; }
  .card-desc { font-size: 0.78rem; }
  .chip-btn { height: 36px; font-size: 0.84rem; }
  .table-wrap { padding: 12px 8px; }
  .last-win-banner { font-size: 1rem; }
}

/* Reduced motion — confirme qu'on n'invente pas de mouvement tactile */
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .controls { animation: none; }
  .card:active { transform: none; }
}
