/* ============================================================================
   WellDoneBets — core system
   A private back-room lounge. Warm blacks, ember gold, real felt.
   Type: Big Shoulders Display (signage) / Outfit (body) / Space Mono (money)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Outfit:wght@400;500;600;700&family=Space+Mono:wght@700&display=swap');

:root {
  /* --- surfaces: warm-shifted blacks, like a dim room --- */
  --ink:        #0a0a0c;
  --char:       #15121a;
  --char-2:     #1e1a24;
  --smoke:      #2a2532;
  --line:       #332d3d;

  /* --- text --- */
  --text:       #f5f2ef;
  --text-dim:   #a49caf;
  --text-faint: #6f677c;

  /* --- accents --- */
  --ember:      #e5a00d;   /* brand gold — wins, primary actions */
  --ember-lo:   #b87d05;
  --ember-glow: rgba(229, 160, 13, .32);
  --sear:       #d1481f;   /* losses, danger — used sparingly */
  --mint:       #35c47f;   /* confirmations */

  /* --- felt --- */
  --felt:       #10502f;
  --felt-deep:  #062616;
  --felt-rail:  #4a2c14;

  /* --- type --- */
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body:    'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --money:   'Space Mono', ui-monospace, 'SF Mono', monospace;

  /* --- rhythm --- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow-lift: 0 2px 6px rgba(0,0,0,.4);
  --shadow-pop:  0 10px 28px rgba(0,0,0,.55);
  --ease: cubic-bezier(.2,.7,.2,1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  /* faint ambient warmth from above, like a hanging lamp */
  background-image: radial-gradient(ellipse 900px 520px at 50% -10%, rgba(229,160,13,.07), transparent 70%);
  background-repeat: no-repeat;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.05;
  text-transform: uppercase;
}
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h3 { font-size: 1.15rem; letter-spacing: .04em; }

/* money always reads mechanical + tabular */
.money, .balance-badge, .bjx-score, .bjx-betchip, .rl-chip, .bjx-chip, .rl-placed {
  font-family: var(--money);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 22px;
  background: linear-gradient(180deg, var(--char) 0%, rgba(21,18,26,.92) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display);
  font-size: 1.75rem; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; line-height: 1;
}
.brand span { color: var(--ember); }
.brand img {
  width: 36px; height: 36px; border-radius: 50%;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}

.controls { display: flex; align-items: center; gap: 10px; }

.balance-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--char-2), #12101a);
  border: 1px solid rgba(229,160,13,.55);
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 18px rgba(229,160,13,.12);
  white-space: nowrap;
}
/* balance pulses gold when it changes */
.balance-badge.bump { animation: badgeBump .5s var(--ease); }
@keyframes badgeBump {
  0%   { transform: scale(1);    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 18px rgba(229,160,13,.12); }
  40%  { transform: scale(1.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.1),  0 0 28px var(--ember-glow); }
  100% { transform: scale(1);    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 18px rgba(229,160,13,.12); }
}

/* ---------------------------------------------------------------- buttons */
.pill {
  font-family: var(--body);
  background: linear-gradient(180deg, var(--ember) 0%, var(--ember-lo) 100%);
  color: #17130a; border: none;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-weight: 700; font-size: .93rem; letter-spacing: .01em;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 3px 0 var(--ember-lo), 0 6px 16px var(--ember-glow);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .12s;
}
.pill:hover  { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 4px 0 var(--ember-lo), 0 9px 22px var(--ember-glow); }
.pill:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ember-lo), 0 2px 8px rgba(0,0,0,.4); }
.pill:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.4); }

.pill.secondary {
  background: var(--char-2); color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 3px 0 #100e15, var(--shadow-lift);
}
.pill.secondary:hover  { background: var(--smoke); filter: none; }
.pill.secondary:active { box-shadow: 0 0 0 #100e15, 0 2px 6px rgba(0,0,0,.4); }

.pill.danger {
  background: linear-gradient(180deg, var(--sear), #96300f); color: #fff;
  box-shadow: 0 3px 0 #7d2709, 0 6px 16px rgba(209,72,31,.3);
}

/* ---------------------------------------------------------------- layout */
.casino-layout {
  display: flex; flex-direction: column;
  gap: 22px; padding: 24px 20px 60px;
  max-width: 1240px; margin: 0 auto;
}
@media (min-width: 900px) {
  .casino-layout { flex-direction: row; align-items: flex-start; }
  .sidebar { width: 210px; flex-shrink: 0; position: sticky; top: 92px; }
  .main-content { flex: 1; min-width: 0; }
}

/* --- game rail: vertical on desktop, a swipeable chip rail on mobile --- */
.game-nav { display: flex; flex-direction: column; gap: 9px; }

.nav-btn {
  font-family: var(--body);
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 13px 16px;
  background: var(--char); color: var(--text-dim);
  border: 1px solid var(--line); border-left: 3px solid transparent;
  border-radius: var(--r-sm);
  font-weight: 600; font-size: .97rem; text-align: left;
  cursor: pointer; white-space: nowrap;
  transition: all .16s var(--ease);
}
.nav-btn:hover { background: var(--char-2); color: var(--text); transform: translateX(2px); }
.nav-btn.active {
  background: linear-gradient(90deg, rgba(229,160,13,.18), rgba(229,160,13,.04));
  color: var(--ember); border-color: rgba(229,160,13,.4);
  border-left: 3px solid var(--ember);
  box-shadow: inset 0 0 22px rgba(229,160,13,.09);
}

/* ---------------------------------------------------------- the felt table
   The signature: woven texture + inner gold betting arc + vignette. */
.table-felt {
  position: relative;
  border-radius: var(--r-lg);
  padding: 30px 26px 34px;
  color: #fff; text-align: center;
  border: 11px solid var(--felt-rail);
  background-color: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% 8%, rgba(255,255,255,.10), transparent 62%),
    radial-gradient(ellipse at 50% 105%, rgba(0,0,0,.6), transparent 70%),
    repeating-linear-gradient(45deg,  rgba(0,0,0,.055) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.028) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--felt), var(--felt-deep));
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.55),
    inset 0 2px 0 rgba(255,255,255,.07),
    0 14px 40px rgba(0,0,0,.6);
  overflow: hidden;
}
/* the betting arc — a real table's inner rail line */
.table-felt::before {
  content: ''; position: absolute;
  top: 12px; left: 14px; right: 14px; bottom: 14px;
  border: 1px solid rgba(229,160,13,.18);
  border-radius: calc(var(--r-lg) - 6px);
  pointer-events: none;
}
.table-felt > * { position: relative; z-index: 1; }
.table-felt h2 { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); margin-bottom: 4px; }
.table-felt p  { color: rgba(255,255,255,.78); }

/* ---------------------------------------------------------------- inputs */
.bet-input, input[type="number"], input[type="text"] {
  font-family: var(--body); font-size: 1rem;
  background: rgba(0,0,0,.34); color: var(--text);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-sm); padding: 12px 15px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.bet-input:focus, input[type="number"]:focus, input[type="text"]:focus {
  border-color: var(--ember);
  background: rgba(0,0,0,.5);
  box-shadow: 0 0 0 3px rgba(229,160,13,.18);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------------------- utilities */
.win-text  { color: var(--ember); }
.lose-text { color: var(--sear); }
.muted     { color: var(--text-dim); }

/* visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 899px) {
  .topbar { flex-wrap: wrap; justify-content: center; padding: 12px 14px; row-gap: 10px; }
  .brand  { width: 100%; justify-content: center; font-size: 1.6rem; }
  .brand img { width: 30px; height: 30px; }
  .controls { width: 100%; justify-content: center; }

  /* nav becomes a horizontal swipeable rail */
  .game-nav {
    flex-direction: row; overflow-x: auto; gap: 8px;
    padding-bottom: 6px; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .game-nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    width: auto; flex: 0 0 auto; padding: 11px 17px;
    border-left: 1px solid var(--line); border-bottom: 3px solid transparent;
    border-radius: var(--r-pill); scroll-snap-align: start; font-size: .92rem;
  }
  .nav-btn:hover  { transform: none; }
  .nav-btn.active { border-left: 1px solid rgba(229,160,13,.4); border-bottom: 3px solid var(--ember); }

  .casino-layout { padding: 16px 12px 48px; }
  .table-felt { padding: 20px 12px 24px; border-width: 8px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
