/* gamble.zlef.fr — play-money casino. Built on da.zlef.fr tokens (olive + grape). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.zl-body { margin: 0; min-height: 100vh; }

#bg-particles { position: fixed; inset: 0; z-index: 0; }
.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 var(--zl-space-5) var(--zl-space-8); }

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--zl-space-4);
  padding: var(--zl-space-3) var(--zl-space-5);
  background: rgba(6,6,10,.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.topbar .brand svg { height: 26px; width: auto; }
.topbar .brand .tag {
  font-size: var(--zl-text-xs, 13px); letter-spacing: .16em; text-transform: uppercase;
  color: var(--zl-olive-soft); font-weight: 700; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.13);
}
.topbar .spacer { flex: 1; }
.chip-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--zl-surface-2); border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--zl-radius-md); padding: 8px 14px; min-height: 44px;
  font-weight: 700; font-size: var(--zl-text-lg, 19px);
}
.chip-pill .coin { width: 18px; height: 18px; border-radius: 50%; background: var(--zl-warning); border: 2px solid #e9c46a55; box-shadow: inset 0 0 0 3px rgba(6,6,10,.45); flex: none; }
.chip-pill .amt { font-variant-numeric: tabular-nums; }
.who { font-size: var(--zl-text-sm, 14.5px); color: var(--zl-text-soft); }
.who a { color: var(--zl-olive-soft); text-decoration: none; }
.who a:hover { text-decoration: underline; }

/* ── hero / lobby ── */
.hero { padding: var(--zl-space-7) 0 var(--zl-space-5); }
.hero h1 { font-size: var(--zl-text-4xl, clamp(40px,6vw,56px)); margin: 0 0 var(--zl-space-3); letter-spacing: -.02em; line-height: 1.04; }
.hero h1 .accent { color: var(--zl-olive-soft); }
.hero p.lede { font-size: var(--zl-text-lg, 19px); color: var(--zl-text-soft); max-width: 60ch; margin: 0; }

.warnbar {
  display: flex; gap: var(--zl-space-3); align-items: flex-start;
  margin: var(--zl-space-5) 0 0; padding: var(--zl-space-4);
  background: rgba(199,154,62,.08); border: 1px solid rgba(199,154,62,.32);
  border-radius: var(--zl-radius-lg); color: var(--zl-text-soft); font-size: var(--zl-text-sm, 14.5px); line-height: 1.55;
}
.warnbar .ic { font-size: 22px; line-height: 1; flex: none; }
.warnbar strong { color: var(--zl-warning); }
.warnbar a, .faq-sec a { color: var(--zl-olive-soft); }
.warnbar a:hover, .faq-sec a:hover { color: var(--zl-olive-bright); }

/* ── game grid ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--zl-space-4); margin-top: var(--zl-space-6); }
.gcard {
  display: flex; flex-direction: column;
  background: var(--zl-surface-1); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--zl-radius-lg); overflow: hidden; transition: border-color .16s, transform .16s;
}
.gcard:hover { border-color: rgba(157,174,80,.45); }
.gcard .art { height: 132px; display: grid; place-items: center; position: relative; background: var(--zl-surface-2); border-bottom: 1px solid rgba(255,255,255,.07); }
.gcard .art .glyph { font-size: 56px; filter: saturate(.9); }
.gcard .edge { position: absolute; top: 10px; right: 10px; }
.gcard .meta { padding: var(--zl-space-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gcard .meta h3 { margin: 0; font-size: var(--zl-text-xl, 22px); }
.gcard .meta p { margin: 0; font-size: var(--zl-text-sm, 14.5px); color: var(--zl-text-muted); line-height: 1.5; flex: 1; }
.gcard .acts { display: flex; gap: 8px; margin-top: var(--zl-space-3); }
.gcard .acts .zl-btn { flex: 1; }

/* leaderboard mini */
.lb-strip { margin-top: var(--zl-space-6); }
.lb-strip h2, .lobby-sec h2 { font-size: var(--zl-text-2xl, 28px); margin: 0 0 var(--zl-space-3); }
.lb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb-table th, .lb-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.lb-table th { font-size: var(--zl-text-xs,13px); text-transform: uppercase; letter-spacing: .12em; color: var(--zl-text-muted); font-weight: 700; }
.lb-table td:last-child, .lb-table th:last-child { text-align: right; }
.lb-table .rank { color: var(--zl-olive-soft); font-weight: 700; width: 48px; }

/* ── game view shell ── */
.gameview { padding-top: var(--zl-space-5); }
.gv-head { display: flex; align-items: center; gap: var(--zl-space-3); flex-wrap: wrap; margin-bottom: var(--zl-space-4); }
.gv-head h2 { margin: 0; font-size: var(--zl-text-2xl, 28px); }
.gv-head .spacer { flex: 1; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--zl-text-soft); text-decoration: none; font-size: var(--zl-text-sm,14.5px); cursor: pointer; }
.back-link:hover { color: var(--zl-text); }

.felt {
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(89,100,42,.18), transparent 60%),
    var(--zl-surface-1);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--zl-radius-xl);
  padding: var(--zl-space-5);
}
.felt--table {
  background:
    radial-gradient(130% 100% at 50% 0%, #38421b 0%, #283011 55%, #1e240d 100%);
  border: 1px solid rgba(157,174,80,.22);
}

/* generic control rows */
.ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--zl-space-3); margin-top: var(--zl-space-4); }
.bet-stepper { display: inline-flex; align-items: center; gap: 8px; background: var(--zl-surface-2); border: 1px solid rgba(255,255,255,.13); border-radius: var(--zl-radius-md); padding: 4px; }
.bet-stepper button { width: 38px; height: 38px; }
.bet-stepper .val { min-width: 90px; text-align: center; font-weight: 700; font-size: var(--zl-text-lg,19px); font-variant-numeric: tabular-nums; }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.chipbtn {
  width: 52px; height: 52px; border-radius: 50%; border: 3px dashed rgba(255,255,255,.4);
  display: grid; place-items: center; cursor: pointer; font-weight: 700; color: #06060a;
  font-size: 14px; font-variant-numeric: tabular-nums; user-select: none; transition: transform .1s;
}
.chipbtn:hover { transform: translateY(-2px); }
.chipbtn.sel { outline: 2px solid var(--zl-text); outline-offset: 2px; }
.chip-1 { background: #cfd3c4; } .chip-5 { background: #c2566a; } .chip-25 { background: #6f9a3a; }
.chip-100 { background: #1d1d25; color: #e9eae2; border-color: rgba(255,255,255,.5);} .chip-500 { background: #b095b3; }

.statline { font-size: var(--zl-text-lg,19px); min-height: 28px; font-weight: 550; }
.statline.win { color: var(--zl-success); }
.statline.lose { color: var(--zl-danger); }
.statline.push { color: var(--zl-warning); }

/* ── playing cards ── */
.cardrow { display: flex; gap: 10px; flex-wrap: wrap; min-height: 104px; align-items: center; }
.pcard {
  width: 70px; height: 98px; border-radius: 7px; background: #f4f3ec; color: #14140f;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px 8px;
  font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.4); position: relative; flex: none;
  font-family: var(--zl-font-sans, system-ui);
}
.pcard.red { color: #b3243a; }
.pcard .tr { transform: rotate(180deg); align-self: flex-end; }
.pcard .pip { font-size: 17px; line-height: 1; }
.pcard .mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; }
.pcard.back { background: repeating-linear-gradient(45deg,#2c3212,#2c3212 6px,#3e4618 6px,#3e4618 12px); border: 2px solid #59642a; }
.pcard.hold-on { outline: 3px solid var(--zl-warning); outline-offset: 2px; }
.pcard .holdtag { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .12em; color: var(--zl-warning); text-transform: uppercase; }
.handlabel { font-size: var(--zl-text-sm,14.5px); color: var(--zl-text-muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; font-weight: 700; }

/* ── roulette ── */
.roul-wrap { display: grid; grid-template-columns: 220px 1fr; gap: var(--zl-space-5); align-items: start; }
@media (max-width: 760px){ .roul-wrap { grid-template-columns: 1fr; } }
.wheel { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto; position: relative; }
.wheel .ball-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rbet-grid { display: grid; grid-template-columns: 34px repeat(12, minmax(30px, 1fr)) 46px; gap: 4px; min-width: 620px; }
.rbet-grid .zero { grid-column: 1; }
.rcell { min-height: 40px; border: 1px solid rgba(255,255,255,.13); border-radius: 4px; display: grid; place-items: center; cursor: pointer; font-weight: 700; position: relative; font-variant-numeric: tabular-nums; user-select: none; }
.rcell:hover { filter: brightness(1.25); }
.rcell.red { background: #7a2230; } .rcell.black { background: #15151c; } .rcell.green { background: #2c3a18; }
.rcell.zero { grid-row: span 3; }
.rout { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-top: 4px; }
.rout .rcell, .rbottom .rcell { background: var(--zl-surface-2); min-height: 38px; }
.rbottom { display: grid; grid-template-columns: repeat(6,1fr); gap: 4px; margin-top: 4px; }
.rchip { position: absolute; top: -6px; right: -6px; background: var(--zl-warning); color: #06060a; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; font-size: 11px; box-shadow: 0 0 0 2px #06060a; }

/* ── slots ── */
.reels { display: flex; gap: 10px; justify-content: center; padding: var(--zl-space-4); background: var(--zl-surface-2); border-radius: var(--zl-radius-lg); border: 1px solid rgba(255,255,255,.07); }
.reel { width: 92px; height: 200px; overflow: hidden; border-radius: 8px; background: #0a0a0e; border: 1px solid rgba(255,255,255,.1); position: relative; }
.reel .strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel .sym { height: 200px; display: grid; place-items: center; font-size: 62px; }
.reel .midline { position: absolute; top: 0; bottom: 0; left: 0; right: 0; pointer-events: none; box-shadow: inset 0 90px 0 -88px var(--zl-olive-soft), inset 0 -90px 0 -88px var(--zl-olive-soft); }
.slot-pay { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: var(--zl-space-3); }
.slot-pay td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: var(--zl-text-sm,14.5px); }
.slot-pay td:last-child { text-align: right; color: var(--zl-olive-soft); font-weight: 700; }

/* baccarat / generic bet spots */
.spots { display: flex; gap: var(--zl-space-3); flex-wrap: wrap; justify-content: center; margin: var(--zl-space-4) 0; }
.spot { flex: 1; min-width: 150px; border: 1px solid rgba(255,255,255,.13); border-radius: var(--zl-radius-lg); padding: var(--zl-space-4); text-align: center; cursor: pointer; background: var(--zl-surface-2); transition: border-color .15s; }
.spot:hover { border-color: var(--zl-olive-soft); }
.spot.sel { border-color: var(--zl-olive-soft); background: rgba(157,174,80,.1); }
.spot .nm { font-weight: 700; font-size: var(--zl-text-lg,19px); }
.spot .pay { font-size: var(--zl-text-sm,14.5px); color: var(--zl-text-muted); margin-top: 4px; }
.spot .staked { margin-top: 8px; color: var(--zl-warning); font-weight: 700; min-height: 20px; }

/* ── FAQ modal ── */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(6,6,10,.78); backdrop-filter: blur(4px); display: grid; place-items: center; padding: var(--zl-space-4); }
.modal { background: var(--zl-surface-1); border: 1px solid rgba(255,255,255,.13); border-radius: var(--zl-radius-xl); max-width: 720px; width: 100%; max-height: 88vh; overflow: auto; }
.modal__head { position: sticky; top: 0; background: var(--zl-surface-1); display: flex; align-items: center; gap: var(--zl-space-3); padding: var(--zl-space-5); border-bottom: 1px solid rgba(255,255,255,.07); }
.modal__head h2 { margin: 0; font-size: var(--zl-text-2xl,28px); }
.modal__head .x { margin-left: auto; cursor: pointer; font-size: 28px; line-height: 1; color: var(--zl-text-muted); background: none; border: none; }
.modal__head .x:hover { color: var(--zl-text); }
.modal__body { padding: var(--zl-space-5); }
.faq-sec { margin-bottom: var(--zl-space-5); }
.faq-sec > h3 { display: flex; align-items: center; gap: 8px; font-size: var(--zl-text-lg,19px); margin: 0 0 var(--zl-space-3); }
.faq-sec h3 .badge-ic { font-size: 18px; }
.faq-sec.warn > h3 { color: var(--zl-warning); }
.faq-sec.warn { background: rgba(199,154,62,.07); border: 1px solid rgba(199,154,62,.28); border-radius: var(--zl-radius-lg); padding: var(--zl-space-4); }
.faq-sec p, .faq-sec li { line-height: 1.6; color: var(--zl-text-soft); }
.faq-sec ul { margin: 0; padding-left: 20px; }
.faq-sec li { margin-bottom: 7px; }
.cheat { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: var(--zl-text-sm,14.5px); }
.cheat th, .cheat td { border: 1px solid rgba(255,255,255,.1); padding: 6px 9px; text-align: center; }
.cheat th { background: var(--zl-surface-2); color: var(--zl-text-soft); }
.cheat td.h { background: var(--zl-surface-2); font-weight: 700; }
.cheat .S { background: rgba(111,154,58,.30); }   /* stand / strong */
.cheat .H { background: rgba(194,86,106,.28); }    /* hit */
.cheat .D { background: rgba(199,154,62,.30); }     /* double */
.cheat .P { background: rgba(176,149,179,.30); }    /* split */
.cheat .legend { font-size: var(--zl-text-xs,13px); color: var(--zl-text-muted); margin-top: 8px; }
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: var(--zl-text-sm,14.5px); }
.kv td:last-child { text-align: right; color: var(--zl-olive-soft); font-weight: 700; font-variant-numeric: tabular-nums; }

/* toast */
#toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--zl-surface-3); border: 1px solid rgba(255,255,255,.13); border-radius: var(--zl-radius-md); padding: 10px 18px; font-weight: 550; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: tin .2s ease; }
.toast.win { border-color: rgba(111,154,58,.5); } .toast.lose { border-color: rgba(194,86,106,.5); }
@keyframes tin { from { opacity: 0; transform: translateY(8px);} }

.footer-note { margin-top: var(--zl-space-8); padding-top: var(--zl-space-5); border-top: 1px solid rgba(255,255,255,.07); color: var(--zl-text-muted); font-size: var(--zl-text-sm,14.5px); line-height: 1.6; }
.footer-note a { color: var(--zl-olive-soft); }

.hidden { display: none !important; }

/* ══════════ mobile-first / responsive ══════════ */
@media (max-width: 720px) {
  .shell { padding: 0 var(--zl-space-4) var(--zl-space-7); }
  .topbar { padding: 10px var(--zl-space-4); gap: 10px; }
  .topbar .brand svg { height: 22px; }
  .topbar .brand .tag { padding-left: 8px; font-size: 11px; }
  .chip-pill { font-size: var(--zl-text-base, 17px); padding: 7px 11px; min-height: 40px; }
  .hero { padding: var(--zl-space-5) 0 var(--zl-space-4); }
  .grid { grid-template-columns: 1fr; gap: var(--zl-space-3); }
  .gcard .art { height: 108px; }
  .gcard .art .glyph { font-size: 46px; }

  /* roulette: full layout, horizontal scroll for the number grid */
  .roul-wrap { grid-template-columns: 1fr; }
  .layout-scroll, .gameview [style*="overflow-x"] { -webkit-overflow-scrolling: touch; }
  .rbet-grid { grid-template-columns: 28px repeat(12, minmax(26px,1fr)) 38px; min-width: 560px; }
  .rcell { font-size: 12px; min-height: 32px; }
  .rout, .rbottom { min-width: 560px; }
  .felt { padding: var(--zl-space-4); }

  /* cards shrink to fit small screens */
  .pcard { width: 56px; height: 80px; padding: 5px 6px; }
  .pcard .pip { font-size: 14px; }
  .pcard .mid { font-size: 26px; }
  .cardrow { gap: 7px; min-height: 86px; }

  /* blackjack/baccarat two-up → stacked */
  .gameview [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* baccarat / generic bet spots stack */
  .spots { flex-direction: column; }
  .spot { min-width: 0; }

  /* slots — keep reel height 200px (JS translate math depends on it); only narrow */
  .reels { gap: 6px; padding: var(--zl-space-3); }
  .reel { width: 74px; }
  .reel .sym { font-size: 50px; }

  /* chips + steppers wrap nicely */
  .chiprow { justify-content: center; }
  .chipbtn { width: 46px; height: 46px; font-size: 13px; }
  .ctrls { gap: 10px; }
  .ctrls .zl-btn { flex: 1 1 auto; }
  .bet-stepper .val { min-width: 70px; }

  /* faq modal full-bleed-ish */
  .modal { max-height: 92vh; }
  .modal__head, .modal__body { padding: var(--zl-space-4); }
  .cheat th, .cheat td { padding: 4px 5px; font-size: 12px; }
  .hero h1 { font-size: clamp(32px, 8vw, 42px); }
}

@media (max-width: 380px) {
  .reel { width: 62px; }
  .reel .sym { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .reel .strip { transition: none !important; }
  .toast { animation: none; }
}
