/* ============================================================================
   CRAPS xEGLD — theme

   Masa e 3D (craps3d.js); aici stă tot ce e DEASUPRA ei: butonul de lobby, pastila,
   bara de jos, jetoanele de pe pâslă (HTML proiectat pe zona lor) și bannerul.
   ⚠️ Butonul de lobby și pastila sunt IDENTICE la toate mesele (regula 1ter).
   ⚠️ Culorile jetoanelor sunt cele de la blackjack / ruletă / poker — nu le lăsa să diverjeze.
   ============================================================================ */

:root {
  --gold: #FFD700;
  --gold-light: #FFE55C;
  --gold-dark: #B8860B;
  --c: #FF6B9D;
  --green: #3DDC84;
  --red: #FF6B6B;
  --blue: #6f9bf2;
  --dark: #07060d;
  --text: #e6e6f0;
  --text-dim: #9a9cb0;
}

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

/* ⚠️⚠️ `visibility:visible` E AICI, NU ÎN JS — aceeași regulă la toate mesele. [DECISIONS §10.123] */
body.booting .scene { visibility: hidden; }
body.booting .hud { visibility: hidden; }
html, body { height: 100%; overflow: hidden; background: var(--dark); }
body {
  visibility: visible;
  font-family: 'Roboto', sans-serif;
  color: var(--text);
}

/* ---- lobby link + identity pill — IDENTICE la toate mesele (regula 1ter). ---- */
.lobby-back {
  position: fixed;
  left: 16px;
  top: 14px;
  z-index: 500;
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255,215,0,0.3);
  background: linear-gradient(145deg, rgba(26,26,46,0.95) 0%, rgba(22,33,62,0.95) 100%);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  transition: .15s;
}
.lobby-back:hover { color: var(--gold); border-color: rgba(255,215,0,0.6); }

.top-right-identity {
  position: fixed; right: 16px; top: 14px; z-index: 500;
  display: flex; align-items: center;
}
.player-id {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255,215,0,0.3);
  background: linear-gradient(145deg, rgba(26,26,46,0.95) 0%, rgba(22,33,62,0.95) 100%);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}
.player-id .badge {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim); margin-right: 6px; vertical-align: middle;
}

/* ---------------------------------------------------------------- scene -- */
.scene { position: fixed; inset: 0; z-index: 1; }
.scene canvas { display: block; cursor: default; }
.scene.can-bet canvas { cursor: pointer; }
.felt-layer { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

/* un pariu pe pâslă: disc cu SUMA REALĂ în xEGLD (ca la Rocket Moon: numărul de pe jeton
   trebuie să fie pariul, altfel minte). Culoarea = denominarea cea mai mare din el. */
.felt-chip {
  position: absolute; transform: translate(-50%, -50%);
  width: 42px; height: 42px; padding: 0;   /* ⚠️ mărimea o pune craps.js, după perspectivă */
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font: 700 11px/1 'Roboto', sans-serif; letter-spacing: .02em; color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.8);
  border: 2px dashed rgba(255,255,255,.75);
  box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 0 0 3px rgba(0,0,0,.25);
  pointer-events: auto; cursor: default; user-select: none;
  transition: transform .12s ease;
}
.felt-chip small { font-size: 8px; font-weight: 500; opacity: .85; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.felt-chip.small small { display: none; }   /* pe un jeton mic rămâne doar suma */
.felt-chip.locked { outline: 2px solid rgba(255,215,0,.8); outline-offset: 2px; }
.felt-chip.clickable { cursor: pointer; }
.felt-chip.clickable:hover { transform: translate(-50%, -50%) scale(1.08); }
.felt-chip.c1   { background: radial-gradient(circle at 35% 30%, #9a9aa6, #5d5d68); }
.felt-chip.c5   { background: radial-gradient(circle at 35% 30%, #e0413f, #8f1a1a); }
.felt-chip.c10  { background: radial-gradient(circle at 35% 30%, #3f7fe0, #1a3f8f); }
.felt-chip.c25  { background: radial-gradient(circle at 35% 30%, #3fbf66, #1a6f33); }
.felt-chip.c50  { background: radial-gradient(circle at 35% 30%, #3a3a44, #0e0e12); }
.felt-chip.c100 { background: radial-gradient(circle at 35% 30%, #9a5fe0, #4f228f); }

/* puck-ul: ON pe numărul point-ului, OFF la Don't Come */
.puck {
  position: absolute; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 900 11px/1 'Roboto', sans-serif; letter-spacing: .06em;
  box-shadow: 0 3px 8px rgba(0,0,0,.7);
}
.puck.on  { background: #fff; color: #111; border: 3px solid #111; }
.puck.off { background: #111; color: #fff; border: 3px solid #eee; }

/* zona peste care e cursorul — o spune în cuvinte, lângă cursor */
.hover-tip {
  position: fixed; z-index: 6; pointer-events: none;
  font: 600 12px/1.3 'Roboto', sans-serif; color: #fff;
  background: rgba(10,8,20,.88); border: 1px solid rgba(255,215,0,.35);
  border-radius: 8px; padding: 5px 9px; white-space: nowrap;
}
.hover-tip .muted { color: var(--text-dim); font-weight: 400; }

/* ------------------------------------------------------------ the banner -- */
.roll-banner {
  position: fixed; left: 50%; top: 16%; z-index: 5;
  transform: translate(-50%,-50%) scale(.9);
  font: 800 clamp(26px,4.6vw,52px)/1.1 'Roboto', sans-serif; text-align: center;
  color: #fff; text-shadow: 0 0 18px var(--c), 0 0 40px rgba(255,107,157,.5);
  opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none;
}
.roll-banner small { display: block; font-size: .38em; letter-spacing: .14em; color: var(--gold); text-shadow: none; margin-top: 6px; }
.roll-banner .net { display: block; font-size: .42em; margin-top: 8px; text-shadow: none; }
.roll-banner .net.win { color: var(--green); }
.roll-banner .net.loss { color: var(--red); }
.roll-banner.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.toast {
  position: fixed; left: 50%; bottom: 128px; z-index: 6; transform: translateX(-50%);
  font: 500 13px/1.3 'Roboto', sans-serif; color: #fff;
  background: rgba(140,20,40,.92); border-radius: 10px; padding: 8px 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,.5); max-width: 90vw; text-align: center;
}

/* ------------------------------------------------------------------ HUD -- */
.hud {
  position: fixed; left: 50%; bottom: 22px; z-index: 4; transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: rgba(10,8,20,.72); border: 1px solid rgba(255,215,0,.25);
  border-radius: 14px; padding: 10px 14px; backdrop-filter: blur(6px);
  max-width: calc(100vw - 32px);
}
.hud-box { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.hud-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.hud-val { font: 700 16px/1.2 'Cinzel', serif; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.hud-toggles { display: flex; flex-direction: column; gap: 2px; }
.hud-toggles label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #bbb; }
.status-line {
  position: fixed; left: 50%; bottom: 4px; z-index: 4; transform: translateX(-50%);
  font-size: 11px; color: var(--text-dim); letter-spacing: .03em; white-space: nowrap;
}

/* pastilele de miză: suma reală în xEGLD (ca la Rocket Moon) */
.chip-ladder { display: flex; gap: 6px; }
.chip-pill {
  appearance: none; cursor: pointer; border: 0; font: inherit;
  --acc: var(--gold);
  min-width: 58px; padding: 8px 9px; border-radius: 999px;
  font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--acc) 70%, #fff);
  background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,.10), transparent 55%), linear-gradient(160deg,#1f2434,#0a0c12 70%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--acc) 45%,transparent), 0 5px 12px -3px rgba(0,0,0,.6);
  transition: .15s ease;
}
.chip-pill:hover:not(:disabled) { transform: translateY(-2px); }
.chip-pill.active {
  color: #1a1a2e;
  background: radial-gradient(ellipse at 50% 15%, rgba(255,255,255,.35), transparent 55%), linear-gradient(160deg, var(--gold-light), var(--gold) 45%, var(--gold-dark));
}
.chip-pill:disabled { opacity: .35; cursor: not-allowed; }

/* ROLL: bevel-ul `.rbtn` al meselor, pe o pastilă */
.roll-btn {
  appearance: none; cursor: pointer; border: 0;
  --acc: var(--gold);
  padding: 13px 30px; border-radius: 999px;
  font: 900 17px/1 'Cinzel', serif; letter-spacing: .14em;
  color: color-mix(in srgb, var(--acc) 78%, #fff);
  text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 0 14px color-mix(in srgb, var(--acc) 45%, transparent);
  background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,.12), transparent 55%),
              radial-gradient(ellipse at 50% 110%, color-mix(in srgb,var(--acc) 26%,transparent), transparent 65%),
              linear-gradient(160deg,#1f2434,#0a0c12 70%);
  box-shadow: inset 0 0 0 3px color-mix(in srgb,var(--acc) 65%,transparent), 0 8px 18px -2px rgba(0,0,0,.6);
  transition: .15s ease;
}
.roll-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 3px var(--acc), 0 0 20px color-mix(in srgb,var(--acc) 45%,transparent); }
.roll-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ⚠️ pe ecranele înguste bara se strânge — nu acoperă mai mult din masă */
@media (max-width: 640px) {
  .hud { gap: 8px; padding: 8px 10px; bottom: 18px; }
  .hud-toggles { display: none; }
  .chip-pill { min-width: 48px; font-size: 11px; padding: 7px 7px; }
  .roll-btn { padding: 11px 20px; font-size: 15px; }
}
