/* public/games/roulette/roulette.css */
body { min-height:100vh; display:flex; flex-direction:column; }
.rl-layout { min-height:100vh; display:flex; flex-direction:column; position:relative; z-index:1; }

/* Timer pill */
.timer-pill { display:flex; flex-direction:column; align-items:center; background:var(--gold-faint); border:1px solid var(--gold-dim); padding:.22rem .75rem; }
.timer-lbl  { font-size:7.5px; letter-spacing:.28em; color:var(--text-dim); font-family:var(--font-display); }
.timer-val  { font-family:var(--font-display); font-size:1.1rem; color:var(--gold); line-height:1.1; }

/* Main */
.rl-main { flex:1; display:flex; flex-direction:column; gap:1rem; padding:1rem 1.25rem 1.25rem;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, #0F1F18 0%, transparent 65%), var(--bg-deep);
  overflow-y: auto;
}

/* Top row */
.rl-top-row { display:flex; gap:1.25rem; flex-shrink:0; }

.wheel-section { display:flex; flex-direction:column; align-items:center; gap:.65rem; flex-shrink:0; }
.wheel-wrap { position:relative; width:240px; height:240px; flex-shrink:0; }
#wheelCanvas {
  border-radius:50%;
  box-shadow: 0 0 0 6px var(--rail), 0 0 0 8px rgba(195,155,90,.18), 0 14px 38px rgba(0,0,0,.7);
}
.wheel-pointer { position:absolute; top:-8px; left:50%; transform:translateX(-50%); color:var(--gold); font-size:1.1rem; text-shadow:0 0 8px rgba(195,155,90,.7); z-index:5; }
.wheel-center  { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:30px; height:30px; border-radius:50%; background:radial-gradient(circle,#3D1F0A,#1a0a02); display:flex; align-items:center; justify-content:center; color:var(--gold); font-size:.75rem; box-shadow:0 0 8px rgba(0,0,0,.8); z-index:5; }

.result-area { text-align:center; min-height:40px; display:flex; align-items:center; gap:.6rem; }
.result-num  { font-family:var(--font-display); font-size:1.7rem; font-weight:600; line-height:1; min-width:2.5rem; }
.result-col  { font-size:.62rem; letter-spacing:.28em; color:var(--text-dim); font-family:var(--font-display); }

.recent-section { flex:1; display:flex; flex-direction:column; min-width:0; }
.recent-bubbles { display:flex; gap:.4rem; flex-wrap:wrap; align-content:flex-start; }
.r-bubble {
  width:30px; height:30px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:.7rem; font-weight:600;
  animation:bubbleIn .3s ease;
}
@keyframes bubbleIn { from{opacity:0;transform:scale(0)} to{opacity:1;transform:scale(1)} }
.rb-red   { background:#C0392B; color:#fff; }
.rb-black { background:#1a1a2e; color:#fff; border:1px solid #444; }
.rb-green { background:var(--felt); color:var(--gold); border:1px solid var(--gold-dim); }

/* Bottom row: table on left, players panel on right */
.rl-bottom-row { display:flex; gap:1rem; flex:1; min-height:0; }

/* ── Betting table wrapper ───────────────────────────────── */
/* KEY FIX: min-width:0 lets flex child shrink below its content size.
   The table itself must also not overflow — overflow:hidden clips it cleanly. */
.rl-table-wrap {
  flex:1;
  min-width:0;          /* ← allows flex shrink past content width */
  background:rgba(0,0,0,.25);
  border:1px solid rgba(195,155,90,.12);
  padding:.85rem;
  border-radius:4px;
  display:flex;
  flex-direction:column;
}

.chip-selector { display:flex; align-items:center; gap:.65rem; margin-bottom:.85rem; flex-wrap:wrap; }
.chip-selector .chip { width:36px; height:36px; font-size:.75rem; }
.chip-opts { display:flex; gap:.45rem; }
.chip-opt.active { outline:2px solid var(--gold); outline-offset:2px; }

/* ── Main betting layout ─────────────────────────────────── */
/* overflow:hidden prevents the table from blowing out the wrapper;
   width:100% ensures it fills but never exceeds the wrapper. */
.rl-table {
  display:flex;
  gap:0;
  align-items:stretch;
  width:100%;
  overflow:hidden;      /* ← clips overflow rather than scrolling */
  flex:1;
}

.bet-cell {
  cursor:pointer; user-select:none; position:relative;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:600;
  border:1px solid rgba(0,0,0,.5);
  background:#143524; color:#fff;
  transition:transform .12s, filter .15s;
  overflow:hidden;
}
.bet-cell:hover { filter:brightness(1.4); transform:translateY(-1px); }
.bet-cell.red   { background:#9B2A1F; }
.bet-cell.black { background:#1a1a2e; }
.bet-cell.green { background:var(--felt); }

.bet-cell.outside {
  background:rgba(20,53,36,.5); color:rgba(237,224,196,.8); font-size:.7rem;
  letter-spacing:.06em;
}
.bet-cell.outside.red   { background:rgba(155,42,31,.6); color:#fff; }
.bet-cell.outside.black { background:rgba(26,26,46,.7); color:#fff; }

.bet-num { font-size:1rem; }

/* Stacked bet chip indicator on cells */
.bet-chip-stack {
  position:absolute; bottom:2px; right:2px;
  display:flex; align-items:center; gap:1px;
}
.bet-chip-mark {
  width:14px; height:14px; border-radius:50%;
  border:1.5px solid #fff;
  font-size:8px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  color:#fff;
}
.bet-chip-mark.mine { box-shadow:0 0 0 2px var(--gold); }

/* Zero column — fixed narrow width, full height of numbers grid */
.rl-zero {
  width:38px;           /* slightly narrower than before but enough for "0" */
  flex-shrink:0;
  display:flex;
}
.rl-zero .bet-cell {
  flex:1; height:auto;
  font-size:1.1rem;
}

/* ── Numbers + "2 TO 1" column grid ─────────────────────── */
/* 12 number columns + 1 column-bet column.
   minmax(0,1fr) on every column means they ALL shrink equally
   when the container is narrower than their natural size.
   Fixed row heights replaced with a minimum — cells grow if needed. */
.rl-numbers-and-cols {
  flex:1;
  min-width:0;          /* ← critical: allows grid to shrink */
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)) minmax(0, 42px);
  grid-template-rows: repeat(3, minmax(30px, 38px));
}

/* Inner table — numbers grid + outside rows stacked vertically */
.rl-inner-table {
  flex:1;
  min-width:0;          /* ← must propagate down */
  display:flex;
  flex-direction:column;
}

/* Outside dozens row — 3 equal cells */
.rl-outside-row {
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height:30px;
}
.rl-outside-row .bet-cell { font-size:.68rem; letter-spacing:.05em; }

/* Outside binary row — 6 equal cells */
.rl-outside-row-2 {
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height:30px;
}

/* ── Totals strip ────────────────────────────────────────── */
/* flex-shrink:0 ensures this never gets squished out of view.
   margin-top:auto was removed — it's now just a normal flow element
   at the bottom of the column flex container. */
.rl-totals {
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.65rem .25rem 0;
  font-family:var(--font-display);
  flex-wrap:wrap;
  flex-shrink:0;        /* ← never compress this row */
  margin-top:auto;      /* pushes to bottom if table is shorter than wrapper */
}
.total-label    { font-size:.65rem; letter-spacing:.2em; color:var(--text-dim); }
.total-amount   { font-size:.95rem; color:var(--gold); }
.total-divider  { color:var(--text-dim); }

/* ── Players panel — right side column ──────────────── */
.players-panel {
  width: 260px; flex-shrink: 0;
  background:rgba(0,0,0,.25); border:1px solid rgba(195,155,90,.1);
  padding:.85rem; border-radius:4px;
  display:flex; flex-direction:column;
  overflow-y: auto;
  max-height: 100%;
}
.players-grid { display:flex; flex-direction:column; gap:.5rem; }
.pl-player-card {
  display:flex; align-items:center; gap:.6rem;
  background:rgba(255,255,255,.03); border:1px solid rgba(195,155,90,.12);
  padding:.5rem .65rem; border-radius:3px;
  min-width:0;
}
.pl-av {
  width:28px; height:28px; border-radius:50%;
  background:rgba(255,255,255,.06); border:1px solid rgba(195,155,90,.22);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:10px; color:rgba(237,224,196,.6);
  overflow:hidden; flex-shrink:0;
}
.pl-av img { width:100%; height:100%; object-fit:cover; }
.pl-info { display:flex; flex-direction:column; gap:1px; min-width:0; }
.pl-name  { font-family:var(--font-serif); font-size:.85rem; color:var(--text); white-space:nowrap; }
.pl-meta  { display:flex; align-items:center; gap:.4rem; font-size:.7rem; }
.pl-chips { font-family:var(--font-display); color:var(--gold); }
.pl-bet-amount { font-family:var(--font-display); color:var(--green-live); }
.pl-bet-amount.zero { color:var(--text-dim); }
