/* ============================================================
   Design tokens and primitives.

   Crypto casino house style: flat dark navy surfaces, one loud
   green for anything you can act on, dense type, small radii.
   No bevels, no gloss, no ornament. Depth comes from a handful
   of discrete surface levels, not from shadows.
   ============================================================ */

:root {
  /* Neutral near black, not navy. Five surface steps carry the whole
     depth system; there are no shadows doing structural work. */
  --bg:      #0B0B0D;
  --panel:   #121214;
  --panel-2: #1A1A1D;
  --panel-3: #232327;
  --panel-4: #2C2C31;

  --line:    #202024;
  --line-2:  #2E2E34;

  --green:    #00E77F;
  --green-dk: #00C86D;
  --green-dim:rgba(0, 231, 127, .13);

  --red:     #F0475F;
  --red-dim: rgba(240, 71, 95, .13);
  --gold:    #FFB800;
  --blue:    #3B82F6;
  --purple:  #A855F7;

  --text:  #FFFFFF;
  --muted: #9B9BA5;
  --faint: #6B6B76;

  --display: 'Inter', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;

  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 6px 20px rgba(0, 0, 0, .45);

  --rail: 250px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--text);
}

.num { font-variant-numeric: tabular-nums; }

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

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  min-height: 42px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s var(--ease), transform .1s var(--ease),
              opacity .15s var(--ease), color .15s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn-primary {
  background: var(--green);
  color: #052314;
  font-weight: 700;
}
.btn-primary:hover { background: #1AFF92; }

.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel-3); }

.btn-lg { padding: 14px 24px; min-height: 50px; font-size: 15px; }

/* kept as aliases so the game screens keep working during the switch */
.btn-gold, .btn-green { background: var(--green); color: #052314; font-weight: 700; }
.btn-gold:hover, .btn-green:hover { background: #1AFF92; }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border-radius: var(--r-lg);
}

/* ---------- labels ---------- */

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- coin chip ---------- */

.coin { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.coin svg { flex: none; }

/* ---------- stake input ---------- */

.stake {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px;
  transition: border-color .15s var(--ease);
}
.stake:focus-within { border-color: var(--line-2); }
.stake button {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.stake button:hover { background: var(--line-2); color: var(--text); }
.stake input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stake input::-webkit-outer-spin-button,
.stake input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stake input[type=number] { -moz-appearance: textfield; }
.stake .suffix { padding-right: 10px; color: var(--faint); font-weight: 600; font-size: 13px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: var(--r);
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.win  { border-color: var(--green); color: var(--green); }
.toast.lose { border-color: var(--red); color: var(--red); }

/* ---------- win celebration ---------- */

.celebrate { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.celebrate .fall { position: absolute; top: -40px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(var(--spin, 540deg)); } }

.bigwin {
  position: fixed;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%) scale(.8);
  z-index: 96;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  padding: 22px 40px;
  border-radius: var(--r-lg);
  background: var(--panel-2);
  border: 1px solid var(--green);
}
.bigwin.show { animation: bigwin 2.2s var(--ease) forwards; }
.bigwin i {
  display: block;
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.bigwin b {
  display: block;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 700;
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
@keyframes bigwin {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.8); }
  12%  { opacity: 1; transform: translate(-50%,-50%) scale(1.03); }
  20%  { transform: translate(-50%,-50%) scale(1); }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-54%) scale(.98); }
}

/* the old gold gradient text hook, now just the accent colour */
.leaf { color: var(--green); }

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