/* =========================================================
   Casa Nove — foglio di stile unico
   Palette: notte, feltro, ottone. Tipografia: Bodoni + Archivo.
   ========================================================= */

:root {
  --bg: #07080a;
  --bg-soft: #0c0e10;
  --panel: #101316;
  --panel-2: #14181c;
  --line: rgba(233, 219, 189, 0.14);
  --line-strong: rgba(233, 219, 189, 0.3);
  --ink: #f1ebdd;
  --muted: #9a958a;
  --dim: #6d6a62;
  --brass: #c9a24b;
  --brass-hi: #f0d79a;
  --brass-deep: #8a6a2a;
  --felt: #0b3b2a;
  --felt-deep: #07271c;
  --red: #a8203a;
  --red-hi: #d2415a;
  --green: #15734f;
  --danger: #d45050;
  --good: #6fce9b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --font-display: "Bodoni Moda", "Didot", "Playfair Display", Georgia, serif;
  --font-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 66px;
  --cell-h: 46px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(201, 162, 75, 0.09), transparent 60%),
    radial-gradient(800px 520px at 92% 4%, rgba(21, 115, 79, 0.12), transparent 62%),
    linear-gradient(180deg, #0a0b0d 0%, #07080a 55%, #060708 100%);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
::selection { background: rgba(201, 162, 75, 0.35); }

/* ─────────────── Topbar ─────────────── */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.86);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--brass-deep);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1f2a22, #0c1410 70%);
  color: var(--brass-hi);
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
  padding-top: 2px;
  box-shadow: inset 0 0 0 3px rgba(201, 162, 75, 0.08), 0 0 22px rgba(201, 162, 75, 0.12);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.brand-text small {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

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

.wallet-amount {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.2));
}

.wallet-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.wallet-amount strong {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brass-hi);
  transition: color 0.3s ease;
}
.wallet-amount strong.flash-up { color: var(--good); }
.wallet-amount strong.flash-down { color: var(--danger); }

.wallet-unit { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

.refill {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}
.refill:hover { color: var(--brass-hi); border-color: var(--brass); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--brass-hi); border-color: var(--brass); }
.icon-btn .mute-slash { display: none; }
.icon-btn[aria-pressed="false"] .mute-slash { display: block; }
.icon-btn[aria-pressed="false"] .wave { display: none; }

/* ─────────────── Tabs ─────────────── */
.tabs {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 6px;
  padding: 10px clamp(16px, 4vw, 40px) 0;
  max-width: 1360px;
  margin: 0 auto;
}

.tab {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--brass);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.07), transparent);
}
.tab-num {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--brass);
  opacity: 0.8;
}
.tab-name { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }

/* ─────────────── Layout ─────────────── */
main {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 40px) 60px;
}

.view[hidden] { display: none; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1;
  letter-spacing: 0.01em;
}

.view-note {
  margin: 0;
  text-align: right;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}

/* ─────────────── Roulette: disposizione ─────────────── */
.roulette-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 34px);
  align-items: start;
}

.wheel-panel {
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 18%, rgba(21, 115, 79, 0.2), transparent 62%),
    linear-gradient(180deg, #12161a, #0b0e10);
  box-shadow: var(--shadow);
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px 0 4px;
}

.wheel-pointer {
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid var(--brass-hi);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.wheel-wrap {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 1;
  margin-top: 10px;
}

#wheel {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}

#wheel .sector { transition: filter 0.2s ease; }
#wheel .sector.is-hit { filter: brightness(1.55); }
#wheel .num-label {
  font-family: var(--font-ui);
  font-size: 7.2px;
  font-weight: 600;
  fill: #f6f1e4;
  letter-spacing: 0.02em;
  user-select: none;
}
.hub-mono {
  font-family: var(--font-display);
  font-size: 25px;
  fill: var(--brass-hi);
  letter-spacing: 0.06em;
}
.hub-sub {
  font-family: var(--font-ui);
  font-size: 5px;
  fill: rgba(240, 215, 154, 0.55);
  letter-spacing: 0.3em;
}

.ball-orbit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  will-change: transform;
}
.ball-arm {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: start;
  padding-top: 7.5%;
  will-change: transform;
}
.ball {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf6, #cfc6b1 55%, #8d8674);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 250, 230, 0.35);
}

.result-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.result-circle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #1a1d20;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.result-circle[data-color="red"] { background: var(--red); border-color: var(--red-hi); }
.result-circle[data-color="black"] { background: #16181b; border-color: #3a3f45; }
.result-circle[data-color="green"] { background: var(--green); border-color: #2c9a71; }
.result-circle.pop { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }

.result-text { display: flex; flex-direction: column; line-height: 1.3; }
.result-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.result-text strong { font-size: 15px; font-weight: 500; letter-spacing: 0.04em; }

.history-block { margin-top: 16px; }
.history-label {
  display: block;
  margin-bottom: 7px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.history {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 24px;
}
.history li {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #f4efe2;
}
.history li[data-color="red"] { background: rgba(168, 32, 58, 0.85); }
.history li[data-color="black"] { background: #202328; border: 1px solid #33373d; }
.history li[data-color="green"] { background: var(--green); }
.history .history-empty {
  width: auto;
  height: auto;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.facts dd {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ─────────────── Puntate ─────────────── */
.betting-panel { min-width: 0; }

.chips {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chips-label {
  margin-right: 4px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #6d5622;
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.16) 0deg 9deg, transparent 9deg 45deg),
    radial-gradient(circle at 35% 28%, #f4dda5, #d9b163 45%, #a5813a 100%);
  color: #2a1f08;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.chip span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(20, 28, 22, 0.92);
  color: var(--brass-hi);
  border: 1px solid rgba(201, 162, 75, 0.5);
}
.chip:hover { transform: translateY(-2px); }
.chip.is-active {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px var(--brass-hi), 0 8px 18px rgba(0, 0, 0, 0.5);
}

.table-wrap {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05), transparent 70%),
    linear-gradient(180deg, #0e4531, #0a3426 60%, #082a1f);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), var(--shadow);
}

.roulette-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.numbers-grid {
  display: grid;
  grid-template-columns: 38px repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--cell-h);
  gap: 3px;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  background: #1b1e22;
  color: #f3eee1;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.cell:hover { filter: brightness(1.18); }
.cell:active { filter: brightness(0.92); }
.cell.num-red { background: linear-gradient(180deg, #b12540, #961c33); }
.cell.num-black { background: linear-gradient(180deg, #24272c, #171a1e); }
.cell.num-zero {
  grid-column: 1;
  grid-row: 1 / span 12;
  background: linear-gradient(180deg, #147a55, #0d5c3f);
  font-size: 17px;
}
.cell.is-win {
  box-shadow: 0 0 0 2px var(--brass-hi), 0 0 16px rgba(240, 215, 154, 0.55);
  z-index: 2;
}
.cell.is-bet { box-shadow: inset 0 0 0 1px rgba(240, 215, 154, 0.55); }

.bet-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #f4dda5, #c9a24b);
  color: #231a06;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.35);
  line-height: 1;
}
.cell.num-zero .bet-badge { top: 6px; right: 50%; transform: translateX(50%); }

.outside { display: grid; gap: 3px; margin-top: 3px; }
.outside-row { display: grid; gap: 3px; }
.outside-row.dozens { grid-template-columns: repeat(3, 1fr); }
.outside-row.columns { grid-template-columns: repeat(3, 1fr); }
.outside-row.evens { grid-template-columns: repeat(6, 1fr); }

.cell.outside-cell {
  min-height: var(--cell-h);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(240, 215, 154, 0.18);
}
.cell.outside-cell small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(240, 215, 154, 0.6);
}
.cell.swatch-red {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.25)),
    linear-gradient(180deg, #a8203a, #8b1a30);
}
.cell.swatch-black {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.25)),
    linear-gradient(180deg, #26292e, #15181b);
}
.cell.dimmed { opacity: 0.42; }

.bet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  position: sticky;
  bottom: calc(var(--tabbar-h) + 10px);
  z-index: 3;
}
.bet-summary { display: flex; flex-direction: column; line-height: 1.2; }
.bet-summary-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.bet-summary strong {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brass-hi);
}
.bet-summary-sub { font-size: 10.5px; color: var(--muted); }
.bet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─────────────── Bottoni ─────────────── */
.btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.12s ease, background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.btn:hover:not(:disabled) { border-color: var(--brass); color: var(--brass-hi); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-primary {
  border-color: #d8b566;
  background: linear-gradient(180deg, #f0d79a, #c9a24b 55%, #a9832f);
  color: #201704;
  box-shadow: 0 8px 20px rgba(201, 162, 75, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover:not(:disabled) { color: #150f02; filter: brightness(1.06); }

.btn-ghost { background: transparent; color: var(--muted); }

/* ─────────────── Blackjack ─────────────── */
.bj-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: clamp(18px, 2.6vw, 32px);
  align-items: start;
}

.bj-table {
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid rgba(201, 162, 75, 0.22);
  border-radius: 40px 40px var(--radius) var(--radius);
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 255, 255, 0.08), transparent 58%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.3), transparent 60%),
    linear-gradient(180deg, #0f4a34, #0a3527 55%, #072a1f);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4), var(--shadow);
  min-height: 520px;
}

.table-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}
.table-line-label {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(240, 215, 154, 0.65);
}
.hand-score {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: rgba(240, 236, 224, 0.9);
  padding: 2px 9px;
  border: 1px solid rgba(240, 215, 154, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}
.hand-score.bust { color: #ffb3b3; border-color: rgba(212, 80, 80, 0.6); }
.hand-score.blackjack { color: #201704; background: var(--brass-hi); border-color: var(--brass-hi); }

.hand-row {
  display: flex;
  gap: 6px;
  min-height: calc(96px + 8px);
  padding: 8px 4px;
  flex-wrap: wrap;
}

.table-banner {
  margin: 8px auto 14px;
  padding: 9px 16px;
  max-width: 560px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(240, 236, 224, 0.92);
  border: 1px solid rgba(240, 215, 154, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}
.table-banner.win { color: #10281c; background: var(--brass-hi); border-color: var(--brass-hi); }
.table-banner.lose { color: #ffd9d9; border-color: rgba(212, 80, 80, 0.55); background: rgba(120, 26, 26, 0.35); }

.player-area {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hand-block {
  padding: 8px 10px 6px;
  border: 1px solid rgba(240, 215, 154, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
  transition: border-color 0.25s, background 0.25s, opacity 0.25s;
  min-width: 0;
}
.hand-block.is-active {
  border-color: rgba(240, 215, 154, 0.6);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 0 1px rgba(240, 215, 154, 0.2);
}
.hand-block.is-done { opacity: 0.72; }
.hand-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 2px;
}
.hand-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240, 215, 154, 0.7);
}
.hand-tag {
  min-height: 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--brass-hi);
  padding: 0 2px;
}
.hand-tag.lose { color: #ffb0b0; }

/* carte */
.card {
  position: relative;
  width: var(--card-w, 64px);
  aspect-ratio: 5 / 7;
  border-radius: 6px;
  background: linear-gradient(160deg, #fbf7ec, #ece4d1);
  color: #1a1a1a;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.25);
  animation: dealIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  flex: 0 0 auto;
  overflow: hidden;
}
.card.no-anim { animation: none; }
.card .corner {
  position: absolute;
  top: 3px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  font-weight: 700;
  font-size: calc(var(--card-w, 64px) * 0.24);
}
.card .corner.bottom {
  top: auto;
  left: auto;
  right: 5px;
  bottom: 3px;
  transform: rotate(180deg);
}
.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--card-w, 64px) * 0.5);
  opacity: 0.9;
}
.card.red { color: #a8203a; }
.card.facedown {
  background:
    repeating-linear-gradient(45deg, rgba(240, 215, 154, 0.14) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #14251d, #0b1611);
  border-color: rgba(201, 162, 75, 0.5);
}
.card.facedown::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(240, 215, 154, 0.35);
  border-radius: 3px;
}

.bj-controls {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(240, 215, 154, 0.16);
}
.bj-bet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.bj-bet .chips { margin-bottom: 0; }
.bj-stake {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240, 236, 224, 0.75);
}
.bj-stake strong { color: var(--brass-hi); font-size: 14px; }
.bj-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bj-actions .btn { flex: 1 1 auto; }

.bj-side { display: grid; gap: 12px; }
.stat-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.stat-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.stat-block strong {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
[data-tone="up"] { color: var(--good); }
[data-tone="down"] { color: var(--danger); }
[data-tone="flat"] { color: var(--muted); }

.rules {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.rules h2, .paytable h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.04em;
}
.rules ul { margin: 0; padding-left: 16px; }
.rules li {
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.rules li::marker { color: var(--brass); }

/* ─────────────── Slot ─────────────── */
.slots-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(18px, 2.6vw, 32px);
  align-items: start;
}

.slot-cabinet {
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(201, 162, 75, 0.4);
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240, 215, 154, 0.12), transparent 60%),
    linear-gradient(180deg, #17120a, #0d0b07 60%, #080705);
  box-shadow: inset 0 0 0 4px rgba(240, 215, 154, 0.05), 0 26px 60px rgba(0, 0, 0, 0.6);
}

.cabinet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 14px;
}
.cabinet-name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass-hi);
}
.cabinet-lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #c9a24b 60%, #6d5420);
  box-shadow: 0 0 12px rgba(240, 215, 154, 0.7);
  animation: lamp 3.4s ease-in-out infinite;
}

.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #050505, #0b0a08);
  border: 1px solid rgba(240, 215, 154, 0.2);
  box-shadow: inset 0 12px 30px rgba(0, 0, 0, 0.9);
}

.reel {
  position: relative;
  height: clamp(120px, 30vw, 190px);
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.85)),
    radial-gradient(ellipse at 50% 50%, #1c241f, #0a0d0b 75%);
  border: 1px solid rgba(240, 215, 154, 0.12);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  height: max-content;
  will-change: transform;
  transition: transform 0s;
}
.sym {
  display: grid;
  place-items: center;
  height: clamp(120px, 30vw, 190px);
  font-size: clamp(46px, 12vw, 74px);
  line-height: 1;
  color: var(--brass-hi);
  text-shadow: 0 0 22px rgba(240, 215, 154, 0.35);
  font-family: var(--font-display);
}
.sym[data-sym="seven"] { color: #f3e2b0; font-style: italic; }
.sym[data-sym="diamond"] { color: #8fd7c4; }
.sym[data-sym="bell"] { color: #e8c976; }
.sym[data-sym="cherry"] { color: #e05a6e; }
.sym[data-sym="lemon"] { color: #d9a94f; }
.sym[data-sym="bar"] {
  font-family: var(--font-ui);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #cfd6cd;
}
.sym.is-win { animation: symWin 0.6s ease-out; }

.payline {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 90, 110, 0.7), transparent);
  pointer-events: none;
}

.slot-msg {
  min-height: 22px;
  margin: 14px 0 4px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.slot-msg.win { color: var(--brass-hi); }

.slot-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.slot-controls .chips { margin-bottom: 0; }
.slot-controls .chip {
  border-color: #6d5622;
}

.slot-side { display: grid; gap: 12px; }
.paytable {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.paytable ul { margin: 0 0 10px; padding: 0; list-style: none; }
.paytable li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(233, 219, 189, 0.1);
  font-size: 12.5px;
}
.paytable li:last-child { border-bottom: none; }
.paytable .sym-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}
.paytable .sym-mini {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 215, 154, 0.2);
  font-size: 14px;
  color: var(--brass-hi);
}
.paytable .mult {
  font-variant-numeric: tabular-nums;
  color: var(--brass-hi);
  font-weight: 600;
}
.paytable-note { margin: 0; font-size: 11px; line-height: 1.6; color: var(--dim); }

/* ─────────────── Footer / toast / utilità ─────────────── */
.footer {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.7;
}
.footer p { margin: 0 0 6px; }
.footer strong { color: var(--muted); font-weight: 500; }
.footer-meta { font-size: 10.5px; letter-spacing: 0.04em; }
.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--brass-hi); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 22px);
  z-index: 30;
  transform: translate(-50%, 16px);
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 17, 15, 0.97);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.03em;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(90vw, 460px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(111, 206, 155, 0.55); color: #c8f5db; }
.toast.bad { border-color: rgba(212, 80, 80, 0.55); color: #ffc9c9; }

/* ─────────────── Animazioni ─────────────── */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-18px) rotate(-4deg) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes lamp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes symWin {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); text-shadow: 0 0 34px rgba(240, 215, 154, 0.8); }
  100% { transform: scale(1); }
}
@keyframes flash {
  0% { background-color: rgba(240, 215, 154, 0.25); }
  100% { background-color: transparent; }
}

/* ─────────────── Responsive ─────────────── */
@media (max-width: 1080px) {
  .roulette-layout { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
  .bj-layout, .slots-layout { grid-template-columns: minmax(0, 1fr); }
  .bj-side, .slot-side { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .rules, .paytable { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .roulette-layout { grid-template-columns: minmax(0, 1fr); }
  .wheel-panel { order: 1; }
  .betting-panel { order: 2; }
  .wheel-wrap { width: min(100%, 300px); }
  .view-note { display: none; }
  .view-head { align-items: center; }
  .bet-bar {
    position: sticky;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
    padding: 10px 12px;
  }
  .bet-actions { flex: 1 1 100%; }
  .bet-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  :root { --cell-h: 50px; --card-w: 56px; }

  .topbar { padding: 10px 14px; gap: 8px; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-text strong { font-size: 16px; }
  .brand-text small { font-size: 8.5px; letter-spacing: 0.18em; }
  .wallet { gap: 7px; }
  .wallet-amount { padding: 5px 10px; gap: 5px; }
  .wallet-label, .wallet-unit { display: none; }
  .wallet-amount strong { font-size: 17px; }
  .refill { min-height: 34px; padding: 0 10px; font-size: 11px; }
  .icon-btn { width: 34px; height: 34px; }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin: 0;
    padding: 0 8px env(safe-area-inset-bottom);
    background: rgba(8, 9, 11, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    gap: 0;
  }
  .tab {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: var(--tabbar-h);
    padding: 8px 4px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
  }
  .tab.is-active { border-bottom-color: var(--brass); background: linear-gradient(180deg, rgba(201, 162, 75, 0.09), transparent); }
  .tab-num { font-size: 9px; }
  .tab-name { font-size: 10px; letter-spacing: 0.12em; }

  main { padding: 18px 14px 44px; }
  h1 { font-size: 36px; }
  .view-head { margin-bottom: 16px; }

  .numbers-grid { grid-template-columns: 30px repeat(3, minmax(0, 1fr)); }
  .cell { font-size: 13px; border-radius: 3px; }
  .cell.num-zero { font-size: 14px; }
  .outside-row.evens { grid-template-columns: repeat(3, 1fr); }
  .outside-row.evens .cell { min-height: 44px; }
  .outside-row.evens .cell:nth-child(n + 4) { font-size: 11px; }
  .cell.outside-cell { font-size: 10.5px; letter-spacing: 0.04em; min-height: 44px; }

  .wheel-panel { padding: 14px 14px 16px; }
  .facts { gap: 6px; }
  .facts dt { font-size: 8px; }
  .facts dd { font-size: 12px; }

  .chips { gap: 7px; }
  .chip { width: 44px; height: 44px; }
  .chip span { width: 31px; height: 31px; font-size: 12px; }

  .bet-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px); }
  .bet-summary strong { font-size: 19px; }

  .bj-table {
    padding: 14px 10px;
    border-radius: 22px;
    min-height: 0;
  }
  .hand-row { min-height: calc(78px + 6px); gap: 5px; }
  .player-area { grid-template-columns: 1fr; gap: 8px; }
  .hand-block { padding: 6px 8px; }
  .table-banner { font-size: 11.5px; padding: 8px 12px; margin: 6px auto 10px; }
  .bj-actions .btn { flex: 1 1 46%; min-height: 48px; }
  .bj-actions #bj-next { flex: 1 1 100%; }
  .bj-bet { gap: 10px; }
  .bj-bet .chips { flex: 1 1 auto; }
  .bj-bet .chip { width: 46px; height: 46px; }
  .bj-bet #bj-deal { flex: 1 1 100%; }
  .bj-stake { display: none; }

  .slot-cabinet { border-radius: 18px; }
  .reels { gap: 6px; padding: 8px; }
  .reel, .sym { height: clamp(104px, 32vw, 150px); }
  .slot-controls #slot-spin { flex: 1 1 100%; }
  .slot-controls .chips { justify-content: center; flex: 1 1 auto; }

  .footer { padding-bottom: calc(var(--tabbar-h) + 26px); }
  .toast { bottom: calc(var(--tabbar-h) + 16px); font-size: 12px; }
}

@media (max-width: 380px) {
  .brand-text small { display: none; }
  .refill { font-size: 10px; padding: 0 8px; }
  :root { --cell-h: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
