/* 7X3 — Luxury crystal + gold visual language.
   Palette extracted from /graphical-interface{,-1,-2,-3}.jpg:
     deep cobalt blue, electric-cyan glow, warm rich gold filigree,
     translucent crystal surfaces, asymmetric flourishes.
   No red, no brown, no wood — every "structural" surface is glass-deep
   blue with a gold rim and an inner light source.
   IMPORTANT: every JS/3D-dice contract is preserved exactly:
     .die-stage 88x88, .die-face[data-side=N] translateZ(44px),
     rollSpin keyframes, .chip::before 6-segment conic rim, JS-set
     inline `background` on chips flows through .chip::after { background: inherit }. */

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

:root {
  /* Deep cobalt structure (from image 0 background, image 2 shadows). */
  --night:        #050b1c;
  --indigo:       #0c1a3c;
  --indigo-mid:   #142a64;
  --azure:        #1f4ea8;
  --azure-lt:     #3a78d8;

  /* Electric blue inner light (image 0 face glow, image 1 particle paths). */
  --cyan:         #5fb7ff;
  --cyan-soft:    #8fcdff;
  --cyan-pale:    #c8e6ff;

  /* Warm rich gold (filigree, pen rings, palace archways). */
  --gold-dk:      #8a5a13;
  --gold:         #c98f1f;
  --gold-lt:      #f0c252;
  --gold-glow:    #ffe39a;
  --cream:        #fff5d8;

  /* Used very sparingly — image 3 interior warm. */
  --amber:        #ffb24a;

  /* Text. */
  --txt:          #eaf2ff;
  --txt-dim:      rgba(234, 242, 255, 0.62);

  /* Legacy aliases — preserved so any JS/HTML referencing them still works. */
  --bg:           var(--night);
  --sf:           var(--indigo);
  --card:         var(--indigo-mid);
  --gold-dk-alias:var(--gold-dk);
  --blue:         var(--azure);
  --red:          #ef4444;     /* lose-glow only */
  --grn:          #22c55e;     /* win-glow only */
  --dim:          var(--txt-dim);
  --bd-blue:      var(--indigo-mid);
  --bd-blue-dk:   var(--indigo);
  --bd-blue-lt:   var(--azure);
  --bd-gold:      var(--gold);
  --bd-gold-lt:   var(--gold-lt);
  --bd-gold-dk:   var(--gold-dk);
  --bd-text:      var(--cream);
}

html, body {
  height: 100%; width: 100%; overflow: hidden;
  /* Ambient blue room (image 0 background). Two diffuse cool radials so
     the screen never feels black, with a deeper centre that pushes the
     stage forward. */
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%,    rgba(31, 78, 168, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 100% 60% at 50% 100%,  rgba(95, 183, 255, 0.10) 0%, transparent 70%),
    var(--night);
  color: var(--txt);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%; height: 100dvh; max-width: 500px; margin: 0 auto;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  background:
    radial-gradient(ellipse 120% 50% at 50% 38%, rgba(58, 120, 216, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, #060d22 0%, #04081a 100%);
}

/* ─────────────────────────────────────────────────────────────────
   TOP BAR — translucent cobalt glass with a gold pinstripe and an
   asymmetric corner bloom (filigree implied by glow, not stamped).
   ───────────────────────────────────────────────────────────────── */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; flex-shrink: 0; height: 50px;
  position: relative;
  background:
    /* asymmetric corner bloom — filigree-like glow only on the LEFT */
    radial-gradient(ellipse 35% 100% at 0% 50%, rgba(240, 194, 82, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.55) 0%, rgba(12, 26, 60, 0.85) 100%);
  border-bottom: 1px solid rgba(240, 194, 82, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.06),
    0 1px 0 rgba(255, 227, 154, 0.10),
    0 6px 18px -10px rgba(95, 183, 255, 0.30);
}
.bar::after {
  /* hairline gold pinstripe under the top bar — the "engraved" line */
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 227, 154, 0.45) 30%, rgba(240, 194, 82, 0.35) 70%, transparent 100%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  font-size: 22px; font-weight: 900; letter-spacing: 0.14em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 45%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(240, 194, 82, 0.35));
}
.brand .platform-link { font-size: 10.5px; color: var(--txt-dim); text-decoration: none; }
.brand .platform-link:hover { color: var(--cream); }
.user-tag { font-size: 11px; font-weight: 600; color: var(--txt-dim); }
.user-tag a { color: var(--gold-lt); text-decoration: none; }

/* Wallet — crystal capsule with cyan inner light + gold rim. */
.wallet-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  font-size: 15px; font-weight: 800;
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 100% at 30% 30%, rgba(95, 183, 255, 0.45) 0%, transparent 70%),
    linear-gradient(180deg, rgba(31, 78, 168, 0.65) 0%, rgba(12, 26, 60, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.55);
  border-radius: 100px;
  cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.20),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 0 10px rgba(95, 183, 255, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.wallet-btn .walletIcon { font-size: 14px; filter: drop-shadow(0 0 4px rgba(255, 227, 154, 0.6)); }
.wallet-btn .label { font-size: 9.5px; color: var(--txt-dim); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* ─────────────────────────────────────────────────────────────────
   DICE STAGE — premium recessed crystal trough.
   Replaces the wood-rail. Cobalt glass interior, electric-cyan ground
   glow under the dice, gold rim along the upper inner lip with an
   asymmetric flourish on the LEFT only (image 0 reference).
   ───────────────────────────────────────────────────────────────── */
.dice-rail {
  flex: 4; min-height: 0;
  display: flex; flex-direction: column;
  margin: 8px 10px;
  border-radius: 22px;
  padding: 12px 12px 8px;
  position: relative;
  background:
    /* asymmetric gold bloom on the LEFT — like the crystal hand's gold filaments */
    radial-gradient(ellipse 55% 35% at 8% 12%, rgba(255, 227, 154, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 35% 25% at 92% 88%, rgba(240, 194, 82, 0.10) 0%, transparent 60%),
    /* deep cobalt body */
    linear-gradient(180deg, #0a1838 0%, #050d24 55%, #02070f 100%);
  border: 1px solid rgba(240, 194, 82, 0.55);
  box-shadow:
    /* outer cool rim glow (cyan from image 0) */
    0 0 18px -4px rgba(95, 183, 255, 0.25),
    /* outer warm pinstripe (gold from image 1 pen) */
    0 0 0 1px rgba(255, 227, 154, 0.10),
    /* inner highlights — top reflection + bottom seat */
    inset 0 1px 0 rgba(255, 245, 216, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    inset 0 0 36px -6px rgba(0, 0, 0, 0.60),
    /* drop shadow off the page */
    0 8px 22px rgba(0, 0, 0, 0.55);
}
.dice-rail::before {
  /* asymmetric ornamental flourish — top-left corner only.
     Implied gold filigree via a swept gradient + blurred curve. */
  content: ''; position: absolute; top: 0; left: 0; width: 60%; height: 18px;
  background:
    radial-gradient(ellipse 80% 100% at 0% 0%, rgba(255, 227, 154, 0.45) 0%, transparent 70%);
  border-top-left-radius: 22px;
  pointer-events: none;
}
.dice-rail::after {
  /* hairline gold inner border — the engraved frame */
  content: ''; position: absolute; inset: 4px; border-radius: 18px;
  border: 1px solid rgba(240, 194, 82, 0.18);
  pointer-events: none;
}

.dice-area {
  flex: 1; min-height: 220px; position: relative; overflow: hidden;
  border-radius: 14px;
  /* Deep crystal stage. Cool blue interior, bright cyan halo under
     where the dice sit (image 0 face glow), warm gold rim hint at the
     top-left (image 1 hand light). No wood, no brown. */
  background:
    radial-gradient(ellipse 60% 65% at 50% 62%, rgba(95, 183, 255, 0.42) 0%, rgba(31, 78, 168, 0.20) 35%, transparent 70%),
    radial-gradient(ellipse 55% 55% at 18% 18%, rgba(255, 227, 154, 0.22) 0%, rgba(240, 194, 82, 0.08) 40%, transparent 80%),
    radial-gradient(ellipse 120% 90% at 50% 55%, rgba(10, 24, 56, 0.55) 0%, rgba(2, 7, 15, 0.95) 95%);
  box-shadow:
    inset 0 0 0 1px rgba(240, 194, 82, 0.22),
    inset 12px 0 36px -14px rgba(255, 227, 154, 0.32),
    inset -8px 0 32px -10px rgba(95, 183, 255, 0.30),
    inset 0 -14px 32px -10px rgba(0, 0, 0, 0.70);
  display: flex; align-items: center; justify-content: center; gap: 24px;
  perspective: 800px;
}
/* The 3D dice canvas appended by dice-replay-player must fill the
   container so we never hit the FALLBACK_W/H 320×240 default that
   leaves the dice tiny in a corner on small screens. */
.dice-area canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ─────────────────────────────────────────────────────────────────
   CAMERA-VIEW BUTTONS — kept (so 3D presets still work) but reduced
   to subtle crystal pills inside the rail. Belong to the same family.
   ───────────────────────────────────────────────────────────────── */
.dice-cam-row {
  display: none;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(2, 7, 15, 0.45) 0%, rgba(2, 7, 15, 0.20) 100%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(240, 194, 82, 0.14);
  /* Sit above the dice canvas so iPhone touch events are not swallowed
     by the WebGL surface below. pointer-events:auto is the default but
     we set it explicitly because a couple of decorative ::before /
     ::after layers in this rail use pointer-events:none. */
  position: relative;
  z-index: 6;
  pointer-events: auto;
}
.dice-cam-row .dice-cam-btn { pointer-events: auto; touch-action: manipulation; }
.dice-cam-row.visible { display: flex; }
.dice-cam-btn {
  flex: 1; max-width: 80px;
  padding: 6px 0;
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  color: var(--cream);
  border: 1px solid rgba(240, 194, 82, 0.45);
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.dice-cam-btn:active { transform: translateY(1px); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.50); }
.dice-cam-btn.active {
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(255, 227, 154, 0.55) 0%, transparent 70%),
    linear-gradient(180deg, rgba(240, 194, 82, 0.60) 0%, rgba(138, 90, 19, 0.70) 100%);
  border-color: rgba(255, 227, 154, 0.85);
  color: #1a0f00;
  text-shadow: 0 1px 0 rgba(255, 245, 216, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 227, 154, 0.85),
    0 0 12px rgba(240, 194, 82, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ── Dice geometry — UNCHANGED. JS depends on these exact values. ── */
.die-stage { width: 88px; height: 88px; transform-style: preserve-3d; transform: rotateX(0) rotateY(0); transition: transform 1.1s cubic-bezier(.18,.9,.25,1); }
.die-stage.rolling { animation: rollSpin 1.1s linear; }
@keyframes rollSpin {
  0%   { transform: rotateX(0)     rotateY(0); }
  25%  { transform: rotateX(540deg) rotateY(180deg); }
  50%  { transform: rotateX(900deg) rotateY(540deg); }
  75%  { transform: rotateX(1260deg) rotateY(900deg); }
  100% { transform: rotateX(1440deg) rotateY(1080deg); }
}
.die-face {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, #fafdff, #c5d4ea);
  border: 1px solid rgba(20, 42, 100, 0.30);
  border-radius: 14px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr;
  padding: 10px;
  box-shadow:
    inset 0 -3px 6px rgba(20, 42, 100, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.7),
    0 0 18px -8px rgba(95, 183, 255, 0.55);
}
.die-face .pip {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1f4ea8, #050b1c);
  align-self: center; justify-self: center;
}
.die-face[data-side="1"] { transform: translateZ(44px); }
.die-face[data-side="2"] { transform: rotateY( 90deg) translateZ(44px); }
.die-face[data-side="3"] { transform: rotateY(180deg) translateZ(44px); }
.die-face[data-side="4"] { transform: rotateY(-90deg) translateZ(44px); }
.die-face[data-side="5"] { transform: rotateX( 90deg) translateZ(44px); }
.die-face[data-side="6"] { transform: rotateX(-90deg) translateZ(44px); }

/* ─────────────────────────────────────────────────────────────────
   RESULT line — engraved gold on a thin glass strip.
   ───────────────────────────────────────────────────────────────── */
.result {
  text-align: center; padding: 4px 0; flex-shrink: 0;
  height: 26px; font-size: 14px; font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 245, 216, 0.55);
  background:
    radial-gradient(ellipse 60% 100% at 50% 50%, rgba(95, 183, 255, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.40) 0%, rgba(12, 26, 60, 0.55) 100%);
  border-top: 1px solid rgba(240, 194, 82, 0.25);
  border-bottom: 1px solid rgba(240, 194, 82, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 8px rgba(95, 183, 255, 0.20);
}
.result.win  { color: #6dffa8; text-shadow: 0 0 10px rgba(34, 197, 94, 0.55); }
.result.lose { color: #ff9f9f; text-shadow: 0 0 10px rgba(239, 68, 68, 0.40); }

/* ─────────────────────────────────────────────────────────────────
   BOARD — three crystal panels with gold framing.
   The seven panel is the focal point: warmer interior, asymmetric
   corner flourish, halo ring.
   ───────────────────────────────────────────────────────────────── */
.board {
  flex: 2; min-height: 0;
  display: flex; gap: 10px;
  padding: 10px 12px; align-items: stretch;
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(31, 78, 168, 0.18) 0%, transparent 80%),
    linear-gradient(180deg, #03081a 0%, #02060f 100%);
  border-top: 1px solid rgba(240, 194, 82, 0.18);
}
.field {
  flex: 1;
  display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; min-height: 0;
  background:
    /* deep cobalt crystal */
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(95, 183, 255, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, #14306e 0%, #0a1a44 50%, #050d24 100%);
  border-radius: 14px; cursor: pointer;
  position: relative;
  border: 1px solid rgba(240, 194, 82, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.20),
    inset 0 0 0 1px rgba(255, 227, 154, 0.10),
    inset 0 -10px 22px rgba(0, 0, 0, 0.50),
    0 0 12px -4px rgba(95, 183, 255, 0.20),
    0 4px 10px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.20s, transform 0.06s, border-color 0.20s;
  padding: 6px 5px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.field::before {
  /* asymmetric gold flourish — top-LEFT corner of every field */
  content: ''; position: absolute; top: 0; left: 0; width: 70%; height: 36%;
  background: radial-gradient(ellipse 70% 100% at 0% 0%, rgba(255, 227, 154, 0.16) 0%, transparent 70%);
  border-top-left-radius: 14px;
  pointer-events: none;
}
.field::after {
  /* engraved gold inner border */
  content: ''; position: absolute; inset: 3px; border-radius: 11px;
  border: 1px solid rgba(240, 194, 82, 0.16);
  pointer-events: none;
}
.field:active { transform: scale(0.97); }

.field[data-f="seven"] {
  flex: 1.18;
  background:
    /* warmer, more luminous interior — the lucky-7 focal point */
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 227, 154, 0.30) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(31, 78, 168, 0.45) 0%, transparent 70%),
    linear-gradient(180deg, #1c3e8e 0%, #0e1f4a 60%, #050d24 100%);
  border-color: rgba(255, 227, 154, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.32),
    inset 0 0 0 1px rgba(255, 227, 154, 0.22),
    inset 0 -10px 22px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(255, 227, 154, 0.32),
    0 4px 10px rgba(0, 0, 0, 0.55);
}
.field[data-f="seven"]::before {
  /* heavier asymmetric flourish on seven — top-LEFT bloom */
  background:
    radial-gradient(ellipse 80% 100% at 0% 0%, rgba(255, 227, 154, 0.30) 0%, transparent 75%),
    radial-gradient(ellipse 30% 100% at 100% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 80%);
}

.field.active-bet {
  border-color: var(--gold-glow);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 0 0 1px rgba(255, 245, 216, 0.35),
    inset 0 -10px 22px rgba(0, 0, 0, 0.40),
    0 0 18px rgba(255, 227, 154, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.55);
}
.field.win-glow {
  border-color: #4ade80 !important;
  box-shadow:
    0 0 28px rgba(34, 197, 94, 0.70),
    inset 0 0 30px rgba(34, 197, 94, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.30) !important;
}
.field.lose-glow {
  border-color: #fca5a5 !important;
  box-shadow:
    0 0 18px rgba(239, 68, 68, 0.40),
    inset 0 0 18px rgba(239, 68, 68, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
}

.field-top {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  flex-shrink: 0; text-align: center; padding: 4px 2px 2px;
  position: relative; z-index: 1;
}
.field-range {
  font-size: clamp(15px, 4vw, 20px); font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  filter: drop-shadow(0 0 4px rgba(95, 183, 255, 0.20));
}
.field[data-f="seven"] .field-range {
  font-size: clamp(17px, 4.6vw, 22px);
  background: linear-gradient(180deg, #fff8e0 0%, var(--gold-glow) 60%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(240, 194, 82, 0.55));
}
.field-mult {
  font-size: clamp(13px, 3.4vw, 16px); font-weight: 800; line-height: 1.1; letter-spacing: 0.5px;
  color: var(--cyan-pale);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 8px rgba(95, 183, 255, 0.30);
}
.field[data-f="seven"] .field-mult {
  color: var(--gold-glow);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 10px rgba(255, 227, 154, 0.50);
}
.field-tag {
  font-size: clamp(7.5px, 1.7vw, 9.5px); font-weight: 800; letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--gold-lt); opacity: 0.95;
  line-height: 1; margin-top: 1px; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.field-chips { flex: 1 1 auto; min-height: 36px; position: relative; width: 100%; overflow: hidden; }
.field-amt {
  flex-shrink: 0; align-self: center; width: calc(100% - 6px);
  min-height: 22px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  padding: 3px 8px; border-radius: 9px;
  font-size: clamp(10.5px, 2.8vw, 12px); font-weight: 900; letter-spacing: 0.04em;
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(95, 183, 255, 0.22) 0%, transparent 70%),
    linear-gradient(180deg, rgba(2, 7, 15, 0.65), rgba(2, 7, 15, 0.45));
  border: 1px solid rgba(240, 194, 82, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  box-shadow: inset 0 1px 0 rgba(200, 230, 255, 0.10);
}
.field-amt:empty { visibility: hidden; }

/* ─────────────────────────────────────────────────────────────────
   CASINO CHIPS — rim painted by ::before (kept JS-compatible),
   body color set inline by chipColor() and inherited by ::after,
   gold OUTER ring added via box-shadow so it never fights the rim.
   Edge inserts changed to a soft cream-gold so the chip reads as
   premium gold-trimmed crystal rather than plain plastic.
   ───────────────────────────────────────────────────────────────── */
.chip {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 4px rgba(0, 0, 0, 0.5);
  position: relative;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
  /* Outer gold halo + crisp dark seat — gives every chip a polished
     metal trim without depending on JS. */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(240, 194, 82, 0.65),
    0 0 8px rgba(255, 227, 154, 0.20);
}
.chip::before {
  /* 6 cream-gold edge inserts (image 1 pen-ring metaphor). */
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    var(--gold-glow) 0deg     22deg,
    transparent      22deg     60deg,
    var(--gold-glow) 60deg     82deg,
    transparent      82deg    120deg,
    var(--gold-glow) 120deg   142deg,
    transparent     142deg    180deg,
    var(--gold-glow) 180deg   202deg,
    transparent     202deg    240deg,
    var(--gold-glow) 240deg   262deg,
    transparent     262deg    300deg,
    var(--gold-glow) 300deg   322deg,
    transparent     322deg    360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 60%, #000 90%, transparent 91%);
          mask: radial-gradient(circle, transparent 60%, #000 60%, #000 90%, transparent 91%);
  pointer-events: none;
}
.chip::after {
  /* Inner disc carries the JS-set body color via background:inherit.
     A cyan-soft inner ring + warm sheen sells the crystal feel. */
  content: '';
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: inherit;
  border: 1px dashed rgba(255, 245, 216, 0.40);
  box-shadow:
    inset 0 2px 3px rgba(255, 245, 216, 0.30),
    inset 0 -3px 4px rgba(0, 0, 0, 0.35),
    inset 0 0 8px rgba(95, 183, 255, 0.15);
  pointer-events: none;
}
.chip > .chip-val { position: relative; z-index: 2; pointer-events: none; }

.chip-on-board {
  width: 38px; height: 38px;
  position: absolute;
  border: 1.5px solid rgba(0, 0, 0, 0.40);
  font-size: 12px;
  pointer-events: none;
}
.drag-chip {
  width: 50px; height: 50px;
  position: fixed;
  border: 1.5px solid rgba(0, 0, 0, 0.45);
  font-size: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(240, 194, 82, 0.65),
    0 8px 16px rgba(0, 0, 0, 0.70);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
  user-select: none; -webkit-user-select: none;
}

/* ─────────────────────────────────────────────────────────────────
   CONTROLS — denom selector + ROLL + mute. ROLL is the headline.
   Gold-rimmed crystal pill, deep cobalt fill, cyan inner glow that
   intensifies on press.
   ───────────────────────────────────────────────────────────────── */
.ctrls {
  flex-shrink: 0;
  padding: 8px 12px 12px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background:
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(31, 78, 168, 0.25) 0%, transparent 80%),
    linear-gradient(0deg, rgba(2, 6, 15, 0.85) 0%, rgba(12, 26, 60, 0.40) 100%);
  border-top: 1px solid rgba(240, 194, 82, 0.18);
}
.denom { display: flex; align-items: center; gap: 0; }
.darr {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--cyan-soft); cursor: pointer;
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.40);
  border-radius: 11px; outline: none;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.55);
}
.darr:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55); }
.chip-sel {
  width: 56px; height: 56px;
  font-size: 18px;
  cursor: pointer;
  border: 1.5px solid rgba(0, 0, 0, 0.45);
  margin: 0 4px;
  /* extra outer glow for the active chip-selector */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(240, 194, 82, 0.85),
    0 0 14px rgba(255, 227, 154, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.65);
}
.chip-sel:active { transform: scale(0.93); }

.roll-btn {
  flex: 1; max-width: 200px; padding: 13px 0;
  font-size: 16px; font-weight: 900; letter-spacing: 0.18em;
  color: var(--cream);
  background:
    /* layered cyan-gold light: cyan inner glow + gold rim sheen + cobalt body */
    radial-gradient(ellipse 80% 100% at 50% 100%, rgba(95, 183, 255, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(255, 227, 154, 0.30) 0%, transparent 70%),
    linear-gradient(180deg, #1f4ea8 0%, #0e1f4a 60%, #050d24 100%);
  border: 1px solid rgba(255, 227, 154, 0.85);
  border-radius: 100px; cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  box-shadow:
    /* outer warm/cool double-ring */
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(255, 227, 154, 0.40),
    0 0 26px -4px rgba(95, 183, 255, 0.45),
    inset 0 1px 0 rgba(255, 245, 216, 0.40),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 10px rgba(255, 227, 154, 0.45);
  font-family: inherit;
  transition: transform 0.08s, box-shadow 0.20s;
}
.roll-btn::before {
  /* asymmetric glint along the top-LEFT — like the pen barrel highlight */
  content: ''; position: absolute; top: 1px; left: 12%; width: 30%; height: 35%;
  border-radius: 100px;
  background: linear-gradient(180deg, rgba(255, 245, 216, 0.55) 0%, transparent 100%);
  pointer-events: none;
}
.roll-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(255, 227, 154, 0.65),
    0 0 36px -4px rgba(95, 183, 255, 0.65),
    inset 0 1px 0 rgba(255, 245, 216, 0.50),
    inset 0 -1px 2px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.55);
}
.roll-btn:disabled {
  opacity: 0.35; cursor: default; transform: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 6px rgba(240, 194, 82, 0.18),
    inset 0 1px 0 rgba(255, 245, 216, 0.20),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55);
}
.mute-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.40);
  border-radius: 11px; cursor: pointer;
  color: var(--cyan-soft); outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.55);
}

/* ─────────────────────────────────────────────────────────────────
   PLATFORM FOOTER — engraved gold links on a thin glass strip.
   ───────────────────────────────────────────────────────────────── */
.platform-footer {
  flex-shrink: 0; padding: 6px 12px; height: 28px;
  background: linear-gradient(0deg, rgba(2, 6, 15, 0.9), rgba(12, 26, 60, 0.55));
  display: flex; align-items: center; justify-content: center; gap: 14px;
  border-top: 1px solid rgba(240, 194, 82, 0.30);
  font-size: 10.5px;
  box-shadow: inset 0 1px 0 rgba(255, 227, 154, 0.10);
}
.platform-footer a {
  color: var(--gold-lt); text-decoration: none;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  opacity: 0.85;
}
.platform-footer a:hover { opacity: 1; color: var(--cream); text-shadow: 0 0 8px rgba(255, 227, 154, 0.45); }

/* ─────────────────────────────────────────────────────────────────
   START OVERLAY — black-glass with cyan-gold logo.
   ───────────────────────────────────────────────────────────────── */
.start-ov {
  position: absolute; inset: 0; z-index: 50;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(31, 78, 168, 0.30) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 50% 80%, rgba(95, 183, 255, 0.15) 0%, transparent 70%),
    rgba(2, 6, 15, 0.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; cursor: pointer; transition: opacity 0.4s;
}
.start-ov.hidden { opacity: 0; pointer-events: none; }
.start-ov .icon  { font-size: 56px; filter: drop-shadow(0 0 18px rgba(255, 227, 154, 0.55)); }
.start-ov .title {
  font-size: 38px; font-weight: 900; letter-spacing: 0.18em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(240, 194, 82, 0.45));
}
.start-ov .sub {
  font-size: 13px; color: var(--cyan-soft);
  letter-spacing: 0.20em; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(95, 183, 255, 0.35);
}

/* ─────────────────────────────────────────────────────────────────
   WIN OVERLAY — gold burst.
   ───────────────────────────────────────────────────────────────── */
.win-ov {
  position: absolute; inset: 0; z-index: 55;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 227, 154, 0.45) 0%, rgba(31, 78, 168, 0.30) 35%, rgba(2, 6, 15, 0.96) 75%);
  pointer-events: none;
}
.win-ov.show  { display: flex; animation: fadeIn 0.3s ease; }
.win-ov .lbl  {
  font-size: 18px; font-weight: 700;
  color: var(--cyan-pale); letter-spacing: 0.20em; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(95, 183, 255, 0.35);
}
.win-ov .amt  {
  font-size: 60px; font-weight: 900;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-glow) 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 227, 154, 0.55));
}
.win-ov .dice { font-size: 14px; color: var(--cyan-soft); margin-top: 4px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─────────────────────────────────────────────────────────────────
   HELP "?" + REAL MONEY pill — small crystal medallions.
   Both belong to the same gold-rim cobalt-glass family.
   ───────────────────────────────────────────────────────────────── */
.help-btn {
  position: absolute;
  top: 56px; left: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(95, 183, 255, 0.45) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.85) 0%, rgba(5, 13, 36, 0.95) 100%);
  color: var(--gold-glow);
  border: 1px solid rgba(240, 194, 82, 0.65);
  font-family: inherit;
  font-size: 14px; font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 6px rgba(255, 227, 154, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.20),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 0 10px rgba(95, 183, 255, 0.20),
    0 2px 4px rgba(0, 0, 0, 0.65);
  -webkit-tap-highlight-color: transparent;
  z-index: 20;
}
.help-btn:active { transform: translateY(1px); }
.help-btn:hover  { color: var(--cream); border-color: var(--gold-glow); }

/* Stab 102: .real-money pill rules removed — PLATFORM-FLOW v4 header
   model collapses pill + wallet into a single always-visible wallet
   element. The wallet's two visual states are driven by data-state
   on #walletBtn (set by lobby.js renderHeader). */
#walletBtn[data-state="empty"]    .wallet-bal-text { display: none; }
#walletBtn[data-state="positive"] .wallet-bal-text { display: inline; }

/* ─────────────────────────────────────────────────────────────────
   GUEST "login" link inside the user-tag.
   ───────────────────────────────────────────────────────────────── */
/* .login-link is a <button> that visually inherits from the user-tag
   text — no native button chrome (background, border, padding) so it
   reads as part of the "Guest login" phrase. */
.user-tag .login-link {
  margin-left: 4px; padding: 0;
  background: transparent; border: 0;
  font: inherit;
  color: var(--gold-glow);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(255, 227, 154, 0.20);
  cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
  /* Make sure pointer events reach the button even if a parent
     element has a CSS rule that opted out of clicks. */
  pointer-events: auto;
  touch-action: manipulation;
}
.user-tag .login-link:hover {
  color: var(--cream);
  text-shadow: 0 0 10px rgba(255, 227, 154, 0.45);
}
.user-tag .login-link:active { opacity: 0.8; }
.user-tag .login-link:focus-visible {
  outline: 1px solid var(--gold-glow); outline-offset: 2px; border-radius: 3px;
}

/* DEMO badge on the wallet pill — premium gold pinstripe label after
   the chip count. Kept tiny so it never covers the layout. */
.wallet-btn.demo::after {
  content: 'DEMO';
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #1a0f00;
  background: linear-gradient(180deg, var(--gold-glow) 0%, var(--gold-lt) 60%, var(--gold) 100%);
  border-radius: 100px;
  box-shadow: 0 0 8px rgba(255, 227, 154, 0.35);
  text-shadow: 0 1px 0 rgba(255, 245, 216, 0.45);
}

/* ─────────────────────────────────────────────────────────────────
   AUTH OVERLAY — slide-in glass dialog. Sits over the game; the
   game underneath stays visible (dimmed + blurred) so the player
   feels they are still inside the game.
   ───────────────────────────────────────────────────────────────── */
.auth-ov {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.auth-ov.open { opacity: 1; pointer-events: auto; }

.auth-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 30%, rgba(95, 183, 255, 0.18) 0%, transparent 70%),
    rgba(2, 6, 15, 0.55);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
          backdrop-filter: blur(8px) saturate(1.1);
}

.auth-card {
  position: relative;
  width: 100%; max-width: 460px;
  margin: 0 auto;
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 18px 22px;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  background:
    /* asymmetric gold flourish — top-LEFT bloom */
    radial-gradient(ellipse 55% 35% at 8% 8%, rgba(255, 227, 154, 0.25) 0%, transparent 65%),
    radial-gradient(ellipse 35% 25% at 92% 92%, rgba(95, 183, 255, 0.22) 0%, transparent 65%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.85) 0%, rgba(5, 13, 36, 0.95) 100%);
  border: 1px solid rgba(240, 194, 82, 0.65);
  border-bottom: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.22),
    inset 0 0 0 1px rgba(255, 227, 154, 0.10),
    0 0 30px -4px rgba(95, 183, 255, 0.30),
    0 -10px 28px rgba(0, 0, 0, 0.55);
  transform: translateY(60px);
  transition: transform 0.28s cubic-bezier(.18,.9,.25,1);
}
.auth-ov.open .auth-card { transform: translateY(0); }
@media (min-width: 600px) {
  .auth-ov { align-items: center; }
  .auth-card {
    border-radius: 22px;
    border-bottom: 1px solid rgba(240, 194, 82, 0.65);
  }
}

.auth-close {
  position: absolute; top: 8px; right: 12px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(95, 183, 255, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.85) 0%, rgba(5, 13, 36, 0.95) 100%);
  border: 1px solid rgba(240, 194, 82, 0.55);
  color: var(--cream);
  font-size: 22px; line-height: 1;
  cursor: pointer; outline: none;
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.auth-close:active { transform: translateY(1px); }

.auth-header { text-align: left; padding: 4px 4px 12px; }
.auth-title {
  font-size: 22px; font-weight: 900; letter-spacing: 0.06em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 60%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(240, 194, 82, 0.35));
}
.auth-banner {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(255, 227, 154, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(31, 78, 168, 0.20) 0%, rgba(12, 26, 60, 0.45) 100%);
  border: 1px solid rgba(240, 194, 82, 0.45);
  color: var(--cream);
  font-size: 13px; line-height: 1.4;
}

.auth-tabs {
  display: flex; gap: 8px;
  padding: 4px; margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(2, 6, 15, 0.45);
  border: 1px solid rgba(240, 194, 82, 0.30);
}
.auth-tab {
  flex: 1; padding: 9px 0;
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cyan-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer; outline: none;
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.auth-tab.active {
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 100% at 50% 100%, rgba(95, 183, 255, 0.30) 0%, transparent 70%),
    linear-gradient(180deg, rgba(31, 78, 168, 0.55) 0%, rgba(12, 26, 60, 0.75) 100%);
  border-color: rgba(255, 227, 154, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.22),
    0 0 10px rgba(255, 227, 154, 0.25);
}

.auth-body { display: block; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }

.auth-row { display: flex; flex-direction: column; gap: 4px; }
.auth-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cyan-soft);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.auth-input {
  width: 100%; padding: 11px 12px;
  font-size: 15px; font-family: inherit;
  color: var(--cream);
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(95, 183, 255, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(2, 6, 15, 0.55) 0%, rgba(2, 6, 15, 0.75) 100%);
  border: 1px solid rgba(240, 194, 82, 0.45);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 1px 0 rgba(200, 230, 255, 0.10);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: rgba(200, 230, 255, 0.45); }
.auth-input:focus {
  border-color: var(--gold-glow);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.16),
    0 0 0 2px rgba(255, 227, 154, 0.18),
    0 0 12px rgba(95, 183, 255, 0.20);
}
.auth-input:disabled { opacity: 0.55; }

.auth-note {
  font-size: 13px; line-height: 1.45;
  color: rgba(234, 242, 255, 0.78);
  margin: 2px 0 6px;
}
.auth-note b { color: var(--gold-glow); }

.auth-msg { min-height: 16px; font-size: 12.5px; line-height: 1.4; padding: 0 2px; }
.auth-msg.ok  { color: #6dffa8; }
.auth-msg.err { color: #ff9f9f; }

.auth-submit {
  margin-top: 4px;
  padding: 13px 0;
  font-size: 14px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 100% at 50% 100%, rgba(95, 183, 255, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(255, 227, 154, 0.30) 0%, transparent 70%),
    linear-gradient(180deg, #1f4ea8 0%, #0e1f4a 60%, #050d24 100%);
  border: 1px solid rgba(255, 227, 154, 0.85);
  border-radius: 100px;
  cursor: pointer; outline: none;
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 8px rgba(255, 227, 154, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 14px rgba(255, 227, 154, 0.35),
    0 0 22px -4px rgba(95, 183, 255, 0.40),
    inset 0 1px 0 rgba(255, 245, 216, 0.40),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, box-shadow 0.20s;
}
.auth-submit:active { transform: translateY(2px); }
.auth-submit:disabled { opacity: 0.5; cursor: default; transform: none; }

.auth-links {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(240, 194, 82, 0.20);
}
.auth-link {
  background: none; border: none; padding: 4px 0;
  color: var(--gold-lt);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
  font-family: inherit;
  cursor: pointer; outline: none;
  text-decoration: underline;
  text-decoration-color: rgba(240, 194, 82, 0.45);
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}
.auth-link:hover { color: var(--cream); text-decoration-color: var(--gold-lt); }

/* Password input + eye toggle. The wrap is position:relative so the
   eye button can absolute-position over the right edge of the input
   without affecting the form's flex layout. The eye is a styled
   button (not a default browser control) and matches the gold/cyan
   palette. */
.auth-pw-wrap { position: relative; display: block; }
.auth-pw-wrap .auth-input { padding-right: 44px; }
.auth-pw-eye {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(95, 183, 255, 0.30) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.85) 0%, rgba(5, 13, 36, 0.95) 100%);
  border: 1px solid rgba(240, 194, 82, 0.55);
  border-radius: 8px;
  color: var(--gold-glow);
  cursor: pointer; outline: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  padding: 0;
}
.auth-pw-eye:active { transform: translateY(-50%) translateY(1px); }
.auth-pw-eye svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.auth-pw-eye .eye-off { display: none; }
.auth-pw-eye[aria-pressed="true"] .eye-on  { display: none; }
.auth-pw-eye[aria-pressed="true"] .eye-off { display: block; }

/* Google sign-in button. Hidden by default — auth-ui only adds the
   "shown" class when /me reports a real GOOGLE_CLIENT_ID. The button
   is the official Google Identity Services widget, so we just leave a
   neutral container that GIS renders into. */
.auth-google-row { display: none; margin-top: 6px; min-height: 44px; }
.auth-google-row.shown { display: flex; justify-content: center; }
.auth-google-divider {
  display: none;
  align-items: center; gap: 10px;
  margin: 14px 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-soft);
}
.auth-google-divider.shown { display: flex; }
.auth-google-divider::before,
.auth-google-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(240, 194, 82, 0.35) 50%, transparent 100%);
}

/* ─────────────────────────────────────────────────────────────────
   DEPOSIT OVERLAY — reuses .auth-ov chrome for the slide-in card,
   adds deposit-specific layouts for the 5 screens.
   ───────────────────────────────────────────────────────────────── */

.dep-ov .auth-card { padding-bottom: 14px; }

.dep-footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(240, 194, 82, 0.20);
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  justify-content: center;
  font-size: 11.5px;
}
.dep-footer a {
  color: var(--gold-lt); text-decoration: none; opacity: 0.85; letter-spacing: 0.04em;
}
.dep-footer a:hover { opacity: 1; color: var(--cream); text-shadow: 0 0 8px rgba(255, 227, 154, 0.45); }
.dep-footer .dot { color: var(--cyan-soft); opacity: 0.45; }

.dep-secondary {
  margin-top: 8px;
  padding: 11px 0;
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.55);
  border-radius: 100px;
  cursor: pointer; outline: none;
  font-family: inherit;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.dep-secondary:active   { transform: translateY(1px); }
.dep-secondary[disabled]{ opacity: 0.45; cursor: default; }

.dep-section-label {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan-soft);
  margin: 6px 0 8px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.dep-note {
  margin: 10px 0 0;
  font-size: 12.5px; line-height: 1.45;
  color: rgba(234, 242, 255, 0.70);
}
.dep-link-row {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 10px;
}

/* ── Welcome screen ────────────────────────────────────────────── */
.dep-welcome { text-align: center; padding: 8px 4px 4px; }
.dep-check   { display: flex; justify-content: center; margin-bottom: 12px; filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.45)); }
.dep-headline {
  font-size: 18px; font-weight: 900; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 10px rgba(95, 183, 255, 0.20);
  margin-bottom: 8px;
}
.dep-sub {
  font-size: 14px; line-height: 1.5;
  color: rgba(234, 242, 255, 0.78);
  margin-bottom: 20px;
}
.dep-primary { /* alias for .auth-submit; just keeps the welcome HTML readable */ }

/* ── Amount grid ──────────────────────────────────────────────── */
.dep-amount-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 6px;
}
.dep-amount {
  position: relative;
  padding: 14px 10px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer; outline: none;
  font-family: inherit;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(95, 183, 255, 0.20) 0%, transparent 70%),
    linear-gradient(180deg, #14306e 0%, #0a1a44 60%, #050d24 100%);
  border: 1px solid rgba(240, 194, 82, 0.45);
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.16),
    inset 0 -8px 16px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.dep-amount:active { transform: scale(0.98); }
.dep-amount.selected {
  border-color: var(--gold-glow);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.30),
    inset 0 -8px 16px rgba(0, 0, 0, 0.40),
    0 0 16px rgba(255, 227, 154, 0.45),
    0 0 24px -4px rgba(95, 183, 255, 0.35);
}
.dep-amount-usd {
  display: block;
  font-size: 22px; font-weight: 900; letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 60%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(240, 194, 82, 0.30));
}
.dep-amount-chips {
  display: block; margin-top: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--cyan-soft);
}

/* ── Method list ──────────────────────────────────────────────── */
.dep-method-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.dep-method {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border-radius: 12px;
  cursor: pointer; outline: none;
  font-family: inherit;
  background:
    radial-gradient(ellipse 60% 100% at 0% 50%, rgba(95, 183, 255, 0.16) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.45);
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(200, 230, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.dep-method:active { transform: scale(0.99); }
.dep-method.selected {
  border-color: var(--gold-glow);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.22),
    0 0 14px rgba(255, 227, 154, 0.40);
}
.dep-method[disabled] {
  cursor: default; opacity: 0.55;
}
.dep-method-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--cyan-soft);
}
.dep-method-name { flex: 1; font-weight: 800; letter-spacing: 0.04em; }
.dep-method-badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cyan-soft);
  background: rgba(95, 183, 255, 0.10);
  border: 1px solid rgba(95, 183, 255, 0.30);
  border-radius: 100px;
}

/* ── Confirm screen ───────────────────────────────────────────── */
.dep-confirm {
  text-align: center; padding: 14px 4px 6px;
  border: 1px solid rgba(240, 194, 82, 0.35);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 227, 154, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.45) 0%, rgba(5, 13, 36, 0.55) 100%);
}
.dep-confirm-amount {
  font-size: 38px; font-weight: 900; letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 60%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(240, 194, 82, 0.35));
}
.dep-confirm-chips  { font-size: 14px; color: var(--cyan-pale); letter-spacing: 0.06em; margin-top: 4px; }
.dep-confirm-method { font-size: 13px; color: rgba(234, 242, 255, 0.78); margin-top: 8px; }

/* ── Instructions screen ──────────────────────────────────────── */
.dep-stub-note {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 178, 74, 0.08);
  border: 1px solid rgba(255, 178, 74, 0.40);
  color: var(--amber);
  font-size: 12px; line-height: 1.4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.dep-pay-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  padding: 14px 8px;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 227, 154, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.45) 0%, rgba(5, 13, 36, 0.55) 100%);
  border: 1px solid rgba(240, 194, 82, 0.45);
  margin-bottom: 10px;
}
.dep-pay-amount-num {
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.dep-pay-amount-asset {
  font-size: 14px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-lt);
}
.dep-pay-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 12px;
}
.dep-pay-actions .dep-secondary { flex: 1; min-width: 130px; padding: 9px 0; font-size: 11.5px; }
.dep-qr {
  display: flex; justify-content: center;
  padding: 10px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(240, 194, 82, 0.45);
  margin: 8px 0 12px;
}
.dep-qr img { display: block; width: 100%; max-width: 220px; height: auto; }
.dep-address {
  word-break: break-all;
  padding: 10px 12px;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 12.5px;
  color: var(--cream);
  background: rgba(2, 6, 15, 0.55);
  border: 1px solid rgba(240, 194, 82, 0.35);
  border-radius: 10px;
  -webkit-user-select: all; user-select: all;
}
.dep-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 78, 168, 0.20);
  border: 1px solid rgba(95, 183, 255, 0.35);
  font-size: 13px; color: var(--cyan-pale);
  text-align: center;
}

/* Card screen — looks production-ready, but the form has no submit
   handler and the Pay button is disabled. */
.dep-card-summary { margin-bottom: 12px; }
.dep-card-brands {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 12px;
  flex-wrap: wrap;
}
.dep-card-brand {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.10em;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(220,225,235,0.85));
  color: #142a64;
  border: 1px solid rgba(20, 42, 100, 0.35);
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.dep-card-form { display: flex; flex-direction: column; gap: 10px; }
.dep-card-row3 { display: grid; grid-template-columns: 2fr 1.4fr 1.6fr; gap: 8px; }
.dep-card-secure {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-top: 4px;
  font-size: 11.5px; line-height: 1.4;
  color: var(--cyan-soft);
  background: rgba(95, 183, 255, 0.08);
  border: 1px solid rgba(95, 183, 255, 0.25);
  border-radius: 8px;
}
.dep-card-lock { font-size: 13px; }
.dep-card-pay { margin-top: 6px; }
.dep-card-note {
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 11.5px; line-height: 1.4;
  color: rgba(234, 242, 255, 0.70);
  background: rgba(255, 178, 74, 0.06);
  border: 1px solid rgba(255, 178, 74, 0.30);
  border-radius: 8px;
}

/* User-tag sign-out chevron for authenticated users. The display
   name is rendered as a styled link/button by game.js; this rule
   provides a small "Sign out" affordance next to it. */
.user-tag .signout-link {
  margin-left: 8px; padding: 0;
  background: transparent; border: 0;
  font: inherit;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan-soft); opacity: 0.80;
  cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  touch-action: manipulation;
}
.user-tag .signout-link:hover { opacity: 1; color: var(--cream); }
.user-tag .signout-link:focus-visible {
  outline: 1px solid var(--gold-glow); outline-offset: 2px; border-radius: 3px;
}

/* ─── Stab 101: header-right action cluster + iframe overlay chrome ─
   Right-side group hosts the mutually-exclusive REAL MONEY pill /
   Wallet button (visibility toggled by lobby.js) plus the always-on
   person icon. Existing .real-money + .wallet-btn rules above style
   the buttons themselves; this group sets their spacing. */
.lobby-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stab 134: .auth-iframe-overlay + .auth-iframe-overlay iframe +
   html.auth-overlay-open / body.auth-overlay-open rules removed
   from this file. The chassis lives in shared/iframe-overlay/
   iframe-overlay.css now, loaded via <link> in index.html. Class
   names renamed to .iframe-overlay / .iframe-overlay-open in the
   shared copy (forward-compatible with non-auth iframes). The
   shared module adds an animated fade-in + slide-in transition
   that the local copy lacked. */

/* Stab 105: portrait orientation lock on phones. The PWA manifest
   already declares orientation: portrait, but that only takes effect
   when the site is installed as a home-screen app. In a regular
   mobile browser tab the OS still rotates freely — so when the user
   tilts to landscape on a phone we cover the viewport with a "rotate
   to portrait" prompt. Scoped to max-device-width: 900px so tablets
   and laptops with wide landscape viewports stay usable. Apex's
   overlay z-index covers any /auth/ iframe sitting on top, too. */
@media screen and (orientation: landscape) and (max-device-width: 900px) {
  body::before {
    content: "↻";
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a1530;
    color: var(--gold-glow, #ffe39a);
    font-size: 96px;
    font-weight: 400;
    line-height: 1;
    pointer-events: auto;
  }
  body::after {
    content: "Please rotate to portrait";
    position: fixed;
    top: 64%;
    left: 0;
    right: 0;
    z-index: 100000;
    text-align: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    pointer-events: none;
  }
}
