:root {
  --bg: #1a2c38;
  --deep: #0f212e;
  --panel: #213743;
  --panel-2: #2f4553;
  --line: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --muted: #b1bad3;
  --blue: #1475e1;
  --green: #00e701;
  --danger: #ed4163;
  --gold: #e0b15a;
  --felt: #0c6a44;
  --hero: linear-gradient(105deg, #0c4cb8 0%, #1a74e8 48%, #123f9c 100%);
  --cta-bg: #fff;
  --cta-ink: #0d4eac;
  --hero-sub: rgba(255, 255, 255, 0.88);
  --pill: rgba(7, 24, 58, 0.28);
  --pill-line: rgba(255, 255, 255, 0.16);
  --header: 64px;
  --side: 248px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}
button, input { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: white; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 8px;
  z-index: 80;
  background: white;
  color: #10202c;
  padding: 8px 10px;
  border-radius: 6px;
}

.header {
  height: var(--header);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-left, .header-right { display: flex; align-items: center; gap: 8px; }
.header-right { justify-content: flex-end; }
.logo {
  font-family: var(--display);
  font-weight: 560;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--deep);
  padding: 4px;
  border-radius: 8px;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 700;
}
.tab.on { background: var(--panel-2); color: white; }
.icon-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  place-items: center;
}
.wallet, .btn-login, .btn-join {
  border: 0;
  border-radius: 6px;
  height: 40px;
  padding: 0 12px;
  font-weight: 700;
}
.wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--deep);
}
.inf {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #12364d;
  color: var(--gold);
  font-weight: 800;
}
.wallet .short { display: none; }
.btn-login { background: var(--panel-2); }
.btn-join { background: var(--blue); }
.wallet-wrap { position: relative; }
.wallet-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  z-index: 40;
}
.wallet-pop p { margin: 8px 0; }
.wallet-pop strong { font-size: 18px; }

.shell { display: flex; min-height: calc(100vh - var(--header)); }
.side {
  width: var(--side);
  flex: none;
  background: var(--deep);
  border-right: 1px solid var(--line);
  padding: 10px 8px 24px;
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
}
.side a, .side summary, .side .sub button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 6px;
}
.side a svg, .side summary svg { flex: none; }
.side a:hover, .side summary:hover, .side a.active { background: var(--panel-2); color: white; }
.side summary { list-style: none; cursor: pointer; }
.side summary::-webkit-details-marker { display: none; }
.side summary::after { content: "▾"; margin-left: auto; font-size: 11px; }
details[open] > summary::after { transform: rotate(180deg); }
.sub a, .sub button { padding-left: 40px; font-size: 13px; font-weight: 500; }
.main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  padding: 16px 18px 72px;
}
.backdrop { display: none; }
.side .phone-nav { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 292px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 70%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 88% 30%, rgba(0, 0, 0, 0.18), transparent 26%),
    var(--hero);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 42px 16px 36px;
}
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero h1 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--cta-bg);
  color: var(--cta-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  font-weight: 800;
}
.cta:hover { filter: brightness(1.08); }
.hero .sub { margin: 12px 0 0; color: var(--hero-sub); font-weight: 600; }
.pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.pills span {
  background: var(--pill);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}
.float { position: absolute; pointer-events: none; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.25)); }
.deco {
  width: 78px;
  height: 108px;
  border-radius: 8px;
  background: #f7f4ee;
  color: #1c1c1c;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  font-weight: 800;
}
.deco.red { color: #d01212; }
.deco b { font-size: 20px; line-height: 1; }
.deco i { font-style: normal; font-size: 28px; align-self: center; }
.f1 { left: 7%; top: 38px; transform: rotate(-14deg); }
.f2 { left: 16%; bottom: 28px; transform: rotate(8deg); }
.f3 { right: 15%; top: 34px; transform: rotate(12deg); }
.f4 { right: 6%; bottom: 36px; transform: rotate(-8deg); }
.die {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #f4efe6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px;
  gap: 6px;
}
.die i { width: 10px; height: 10px; border-radius: 50%; background: #123e9a; margin: auto; }
.die i.off { background: transparent; }
.chip-float {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd978, #c9962c 46%, #8a6418);
  border: 5px dashed rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 6px rgba(80, 48, 8, 0.35);
}

.stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 14px 2px;
  color: var(--muted);
  font-weight: 700;
}
.stat { display: flex; align-items: center; gap: 8px; }
.stat b, .stat strong { color: var(--text); font-variant-numeric: tabular-nums; }
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 231, 1, 0.6);
  animation: ping 1.8s infinite;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--deep);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}
kbd {
  border: 1px solid #3d5564;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 800;
}
.row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
}
.row::-webkit-scrollbar { height: 8px; }
.row::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 99px; }
.tile { width: 158px; flex: none; scroll-snap-align: start; color: white; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .art { transform: translateY(-4px); filter: brightness(1.06); }
}
.art {
  height: 210px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(160deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.art .mini {
  position: absolute;
  width: 58px;
  height: 80px;
  border-radius: 6px;
  background: #f7f4ee;
  color: #1c1c1c;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-weight: 800;
  line-height: 1;
}
.art .mini span { font-size: 16px; }
.art .mini em { font-style: normal; font-size: 20px; align-self: center; }
.art .c1 { left: 16px; top: 36px; transform: rotate(-12deg); }
.art .c2 { left: 58px; top: 48px; transform: rotate(8deg); }
.art .red { color: #d01212; }
.mini-chip {
  position: absolute;
  right: 16px;
  top: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d4a017 40%, #8a6418);
  border: 3px dashed rgba(255, 255, 255, 0.8);
}
.art-dealer {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
}
.art-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.limit { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.more { display: flex; justify-content: center; margin: 6px 0 8px; }
.empty { color: var(--muted); padding: 12px 0 4px; }

.page { max-width: 760px; }
.page h1 { margin: 4px 0 8px; font-size: 30px; letter-spacing: -0.03em; }
.lead { color: var(--muted); margin-top: 0; }
.block {
  background: var(--deep);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
}
.block h2 { margin: 0 0 6px; font-size: 16px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 12px; margin-top: 22px; }
.rise { animation: rise 0.45s ease both; }
.ladder { display: grid; gap: 8px; }
.level {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--deep);
  border-radius: 10px;
  padding: 12px;
}
.level.on { box-shadow: inset 0 0 0 1px var(--gold); }
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #fff1c9); }
.check { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.ok { color: var(--green); font-weight: 800; }

.chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { max-width: 80%; padding: 10px 12px; border-radius: 10px; background: var(--deep); }
.bubble.me { margin-left: auto; background: #164e78; }
.composer { display: flex; gap: 8px; }
.composer input, .sheet input {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--panel-2);
  background: var(--deep);
  padding: 0 12px;
}

.btn {
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--panel-2);
  color: white;
  font-weight: 800;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.btn.primary { background: var(--blue); }
.btn.good { background: #0e8f5b; }
.btn.bad { background: var(--danger); }
.btn.gold { background: var(--gold); color: #241a08; }
.btn.dim { opacity: 0.6; }
.btn.block { width: 100%; margin-top: 8px; }
.row-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.table-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.table-top h1 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.back { color: var(--muted); font-weight: 700; }
.pit {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 240px;
  gap: 14px;
  align-items: start;
}
.dealer-card, .side-panel {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.portrait-wrap { display: grid; place-items: center; }
.bust { width: 150px; height: auto; transform-origin: 50% 80%; animation: breathe 3.4s ease-in-out infinite; }
.dealer-card.busy .bust { animation-duration: 1.05s; }
.speech {
  background: var(--panel);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 72px;
  margin-top: 8px;
}
.speech strong { display: block; color: var(--gold); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.speech p { margin: 4px 0 0; }
.meter { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #8fd0ff); }
.rules { margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.rules li { padding: 4px 0; }

.felt-wrap { min-width: 0; }
.felt {
  position: relative;
  min-height: 520px;
  padding: 22px 16px 26px;
  border-radius: 210px 210px 16px 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.16), transparent 42%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.35), transparent 48%),
    linear-gradient(180deg, #14915f, #0b6844 58%, #085438);
  box-shadow:
    inset 0 0 0 2px rgba(224, 177, 90, 0.55),
    inset 0 0 70px rgba(0, 0, 0, 0.25),
    0 0 0 8px #6d4128,
    0 0 0 12px #3c2416,
    0 16px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand-felt {
  font-family: var(--display);
  letter-spacing: 0.28em;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 4px;
}
.who-line { font-weight: 800; margin-bottom: 8px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.hand { display: flex; justify-content: center; min-height: 96px; }
.hand .card + .card { margin-left: -34px; }
.card {
  width: 84px;
  height: 118px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #f3efe6);
  color: #1a1a1a;
  position: relative;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.28);
  flex: none;
}
.card.red { color: #c81e1e; }
.card .corner { position: absolute; top: 6px; left: 7px; line-height: 1; font-weight: 800; }
.card .corner b { display: block; font-size: 16px; }
.card .corner i { font-style: normal; font-size: 13px; }
.card .br { top: auto; left: auto; right: 7px; bottom: 6px; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; }
.card.face .pip { font-size: 42px; font-family: var(--display); }
.card.back {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
    repeating-linear-gradient(45deg, #123a73 0 8px, #0c2b58 8px 16px);
  border: 3px solid #f3efe6;
  box-shadow: inset 0 0 0 6px #0e2448, 0 8px 14px rgba(0, 0, 0, 0.28);
}
.card.enter { animation: deal 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card.flip { animation: flip 0.42s ease; }
.ghosts i {
  width: 84px;
  height: 118px;
  border-radius: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  display: block;
}
.ghosts i + i { margin-left: 8px; }
.ghosts { display: flex; }
.total {
  min-width: 42px;
  height: 28px;
  margin-top: 8px;
  padding: 0 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(8, 20, 16, 0.78);
  border: 2px solid var(--gold);
  font-weight: 800;
}
.total small { font-size: 10px; font-weight: 700; color: #d7ecff; }
.total.bust { border-color: #ff8ea3; color: #ffd0d8; }
.total.bj { color: #ffe7a3; }
.banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  font-weight: 800;
}
.banner.win, .banner.blackjack, .banner.even { color: #c8ffc4; }
.banner.lose { color: #ffc0cb; }
.banner.push { color: #ffe3a8; }
.banner small { font-weight: 650; color: white; }
.seats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: 100%; margin-top: 12px; }
.seat {
  position: relative;
  min-width: 150px;
  padding: 6px;
  border-radius: 12px;
  text-align: center;
}
.seat.on { box-shadow: inset 0 0 0 2px rgba(255, 223, 140, 0.9); }
.seat-label, .handbet { font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.stamp {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: #ffe7a8;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}
.spot {
  width: 112px;
  height: 112px;
  margin-top: 16px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.5);
  display: grid;
  place-items: center;
  position: relative;
}
.spot .tag {
  position: absolute;
  top: -10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
}
.spot .amt { font-size: 12px; font-weight: 800; text-align: center; }
.stack { position: relative; width: 48px; height: 48px; }
.stack i {
  position: absolute;
  left: 4px;
  width: 40px;
  height: 16px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  bottom: calc(var(--i) * 5px);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}
.controls, .chips, .bet-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.chips.locked, .bet-tools.locked { opacity: 0.45; pointer-events: none; }
.chip {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.22), 0 3px 0 rgba(0, 0, 0, 0.25);
  font-weight: 800;
  font-size: 12px;
}
.chip:active { transform: translateY(2px); }
.beads { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bead {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}
.bead.w { background: #0e8f5b; }
.bead.l { background: var(--danger); }
.bead.p { background: var(--panel-2); }
.bead.bj { background: var(--gold); color: #241a08; }
.keys { margin: 8px 0 0; padding-left: 16px; color: var(--muted); }
.keys li { margin: 3px 0; }
.legend { color: var(--muted); font-size: 12px; margin-top: 8px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 16px;
}
.sheet {
  width: min(440px, 100%);
  background: var(--bg);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--line);
}
.sheet h2 { margin: 0 0 8px; }
.sheet label { display: block; font-weight: 700; margin-bottom: 6px; }
.sheet input { width: 100%; }
.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 25;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.toasts {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  width: min(320px, calc(100vw - 32px));
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes deal {
  from { opacity: 0; transform: translate(70px, -36px) rotate(8deg); }
  to { opacity: 1; transform: none; }
}
@keyframes flip {
  from { transform: rotateY(88deg); }
  to { transform: rotateY(0); }
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(0, 231, 1, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(0, 231, 1, 0); }
}

@media (max-width: 1180px) {
  .pit { grid-template-columns: 1fr; }
  .felt-wrap { order: -1; }
  .f1, .f2, .f4 { display: none; }
}
@media (max-width: 860px) {
  .icon-btn { display: grid; }
  .tabs .tab span { display: none; }
  .wallet .full { display: inline; font-size: 11px; letter-spacing: -0.04em; white-space: nowrap; }
  .wallet .short, .btn-login { display: none; }
  .btn-join { white-space: nowrap; padding: 0 10px; }
  .logo { font-size: 26px; }
  .side {
    position: fixed;
    z-index: 45;
    top: var(--header);
    left: 0;
    transform: translateX(-105%);
    height: calc(100vh - var(--header));
  }
  .side.open { transform: translateX(0); }
  .backdrop {
    display: block;
    position: fixed;
    inset: var(--header) 0 0 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35;
  }
  .hero h1 { font-size: 28px; }
  .float { display: none; }
  .card, .ghosts i { width: 68px; height: 96px; }
  .hand .card + .card { margin-left: -26px; }
  .felt { border-radius: 120px 120px 14px 14px; min-height: 0; padding: 16px 12px 18px; }
  .table-top { flex-direction: column; align-items: flex-start; }
  .table-top h1 { font-size: 22px; }
  .dock {
    position: sticky;
    bottom: 0;
    z-index: 8;
    background: var(--bg);
    padding: 8px 0 12px;
  }
  body.at-table .fab { display: none; }
  .keys { display: none; }
  kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.table-live { margin: 4px 0 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: var(--deep);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.choice.on { box-shadow: inset 0 0 0 2px var(--gold); }
.choice .swatch { display: block; height: 78px; }
.choice .meta { padding: 10px 12px 12px; }
.choice strong { display: block; }
.choice small { color: var(--muted); }

[data-site="kulce"] {
  --bg: #231910;
  --deep: #140f0b;
  --panel: #3a2c22;
  --panel-2: #4d3b2d;
  --text: #f7f0e6;
  --muted: #d2c1ab;
  --blue: #c6a15a;
  --green: #e3c27a;
  --gold: #f0d7a0;
  --line: rgba(240, 215, 160, 0.16);
  --hero: linear-gradient(115deg, #3b2916 0%, #a56b32 46%, #24180f 100%);
  --cta-bg: #f6ead7;
  --cta-ink: #3b2916;
  --hero-sub: rgba(246, 234, 215, 0.9);
  --pill: rgba(36, 24, 12, 0.35);
  --pill-line: rgba(246, 234, 215, 0.28);
}
[data-site="neon"] {
  --bg: #07070e;
  --deep: #04040a;
  --panel: #161222;
  --panel-2: #261833;
  --text: #f6f2ff;
  --muted: #b7a8d4;
  --blue: #ff2f9a;
  --green: #39ffc2;
  --gold: #6af6ff;
  --line: rgba(106, 246, 255, 0.16);
  --hero: linear-gradient(120deg, #1a0520 0%, #5a146e 42%, #042433 100%);
  --cta-bg: #ff2f9a;
  --cta-ink: #1a0012;
  --hero-sub: rgba(232, 255, 252, 0.88);
  --pill: rgba(0, 0, 0, 0.35);
  --pill-line: rgba(106, 246, 255, 0.35);
}
[data-site="neon"] .logo {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 28px;
}
[data-site="kadife"] {
  --bg: #2a1219;
  --deep: #16080d;
  --panel: #4a2230;
  --panel-2: #5e2c3c;
  --text: #fff4f6;
  --muted: #e4c4cc;
  --blue: #e7a3b5;
  --green: #ffd0da;
  --gold: #f0c7a2;
  --line: rgba(255, 214, 222, 0.14);
  --hero: linear-gradient(115deg, #4a1528 0%, #9a3d58 48%, #2a1018 100%);
  --cta-bg: #fff0f3;
  --cta-ink: #4a1528;
  --hero-sub: rgba(255, 240, 243, 0.9);
  --pill: rgba(40, 10, 18, 0.35);
  --pill-line: rgba(255, 214, 222, 0.28);
}
[data-site="buz"] {
  --bg: #121a22;
  --deep: #0b1117;
  --panel: #1c2833;
  --panel-2: #2a3b4a;
  --text: #f3f8fc;
  --muted: #c5d5e2;
  --blue: #8ecfff;
  --green: #b9f3ff;
  --gold: #d7e9f6;
  --line: rgba(185, 220, 240, 0.14);
  --hero: linear-gradient(115deg, #0d3044 0%, #1d6a8a 46%, #10202c 100%);
  --cta-bg: #e7f6ff;
  --cta-ink: #0d3044;
  --hero-sub: rgba(231, 246, 255, 0.9);
  --pill: rgba(8, 24, 36, 0.35);
  --pill-line: rgba(231, 246, 255, 0.28);
}

[data-felt="lacivert"] .felt {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.14), transparent 42%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.35), transparent 48%),
    linear-gradient(180deg, #1d5f9a, #0e3c68 58%, #08243f);
  box-shadow:
    inset 0 0 0 2px rgba(198, 220, 236, 0.5),
    inset 0 0 70px rgba(0, 0, 0, 0.28),
    0 0 0 8px #9aa6b2,
    0 0 0 12px #2a3138,
    0 16px 30px rgba(0, 0, 0, 0.28);
}
[data-felt="lacivert"] .card.back {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    repeating-linear-gradient(45deg, #0d2b52 0 8px, #081c36 8px 16px);
  box-shadow: inset 0 0 0 6px #071628, 0 8px 14px rgba(0, 0, 0, 0.28);
}
[data-felt="bordo"] .felt {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.14), transparent 42%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.38), transparent 48%),
    linear-gradient(180deg, #8d2438, #5c1524 58%, #3a0d16);
  box-shadow:
    inset 0 0 0 2px rgba(240, 199, 162, 0.55),
    inset 0 0 70px rgba(0, 0, 0, 0.28),
    0 0 0 8px #c6a15a,
    0 0 0 12px #3d2a16,
    0 16px 30px rgba(0, 0, 0, 0.28);
}
[data-felt="bordo"] .card.back {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    repeating-linear-gradient(45deg, #6e1c2c 0 8px, #3f101a 8px 16px);
  box-shadow: inset 0 0 0 6px #2a0c12, 0 8px 14px rgba(0, 0, 0, 0.28);
}
[data-felt="mermer"] .felt {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(180deg, #2a2a2e, #141416 55%, #0a0a0c);
  box-shadow:
    inset 0 0 0 1px rgba(232, 208, 154, 0.7),
    inset 0 0 80px rgba(0, 0, 0, 0.45),
    0 0 0 8px #1a1a1c,
    0 0 0 10px #e8d09a,
    0 0 0 14px #111,
    0 16px 30px rgba(0, 0, 0, 0.35);
  border-radius: 18px;
}
[data-felt="mermer"] .card.back {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 28%),
    repeating-linear-gradient(45deg, #1c1c20 0 8px, #0e0e10 8px 16px);
  box-shadow: inset 0 0 0 6px #070708, 0 8px 14px rgba(0, 0, 0, 0.28);
}
[data-felt="kum"] .felt {
  color: #2c2418;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.35), transparent 42%),
    radial-gradient(ellipse at 50% 120%, rgba(90, 60, 20, 0.18), transparent 48%),
    linear-gradient(180deg, #e6d2a8, #c9a56a 58%, #a88448);
  box-shadow:
    inset 0 0 0 2px rgba(92, 58, 24, 0.35),
    inset 0 0 50px rgba(120, 70, 20, 0.12),
    0 0 0 8px #6a3e22,
    0 0 0 12px #2e1c10,
    0 16px 30px rgba(0, 0, 0, 0.28);
}
[data-felt="kum"] .brand-felt,
[data-felt="kum"] .handbet,
[data-felt="kum"] .seat-label { color: rgba(44, 36, 24, 0.72); }
[data-felt="kum"] .who-line { text-shadow: none; }
[data-felt="kum"] .ghosts i { border-color: rgba(44, 36, 24, 0.35); }
[data-felt="kum"] .spot { border-color: rgba(44, 36, 24, 0.45); }
[data-felt="kum"] .banner { background: rgba(44, 36, 24, 0.72); }
[data-felt="kum"] .card.back {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
    repeating-linear-gradient(45deg, #8a5a32 0 8px, #6b4122 8px 16px);
  box-shadow: inset 0 0 0 6px #4a2c16, 0 8px 14px rgba(0, 0, 0, 0.28);
}

html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
button, a, .chip { touch-action: manipulation; }
.page, .check span, .speech p { overflow-wrap: anywhere; }
.hand, .pit, .felt, .table-top { max-width: 100%; }
.composer input, .sheet input, .search input { font-size: 16px; }

@media (max-width: 860px) {
  :root { --header: 56px; }
  body.menu-open { overflow: hidden; }
  .header {
    height: calc(var(--header) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  }
  .header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .logo { justify-self: center; font-size: 22px; }
  [data-site="neon"] .logo { font-size: 16px; letter-spacing: 0.08em; }
  .header-left, .header-right { min-width: max-content; }
  .wallet, .btn-join { height: 36px; }
  .wallet { padding: 0 8px; gap: 6px; }
  .wallet .full { font-size: 13px; font-variant-numeric: tabular-nums; }
  .main {
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .side {
    width: min(280px, 86vw);
    top: calc(var(--header) + env(safe-area-inset-top));
    height: calc(100dvh - var(--header) - env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .backdrop { inset: calc(var(--header) + env(safe-area-inset-top)) 0 0 0; }
  .side .phone-nav {
    display: flex;
    font-weight: 800;
    color: white;
  }
  .hero { min-height: 0; padding: 28px 14px 22px; }
  .hero h1 { font-size: 26px; }
  .cta { min-width: 0; width: min(100%, 280px); }
  .stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 13px;
  }
  .row { overscroll-behavior-x: contain; scroll-padding-inline: 2px; }
  .level { grid-template-columns: 1fr auto; }
  .level .bar { grid-column: 1 / -1; }
  .check { flex-wrap: wrap; }
  .composer { flex-wrap: wrap; }
  .composer input { flex: 1 1 140px; min-width: 0; }
  .wallet-pop {
    position: fixed;
    top: calc(var(--header) + env(safe-area-inset-top) + 8px);
    right: max(8px, env(safe-area-inset-right));
    left: auto;
    width: min(300px, calc(100vw - 16px));
  }
  .modal { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .sheet { max-height: min(92dvh, 640px); overflow: auto; }
  .fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .toasts {
    left: 12px;
    right: 12px;
    top: calc(var(--header) + env(safe-area-inset-top) + 8px);
  }
  .toast { width: auto; }
  .back { display: inline-flex; align-items: center; min-height: 36px; flex: none; }
  .table-top {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 2px 10px;
    margin-bottom: 8px;
  }
  .table-top > div { min-width: 0; flex: 1; }
  .table-top h1 { font-size: 18px; }
  .table-top p { margin: 0; }
  .felt { padding: 10px 10px 12px; }
  .dealer-card {
    order: -2;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }
  .dealer-card .portrait-wrap { grid-column: 1; }
  .dealer-card .bust { width: 52px; }
  .dealer-card .speech { grid-column: 2; margin: 0; min-height: 0; padding: 8px 10px; }
  .dealer-card .speech p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .dealer-card #shoeLabel { grid-column: 3; margin: 0; font-size: 12px; white-space: nowrap; }
  .dealer-card .meter,
  .dealer-card .rules { display: none; }
  .who-line { display: none; }
  .brand-felt { margin-bottom: 2px; font-size: 11px; }
  .hand { min-height: 0; }
  .spot { width: 88px; height: 88px; margin-top: 8px; }
  .seat { min-width: 0; flex: 1 1 132px; }
  .stamp { font-size: 12px; }
  body.at-table .main { padding-bottom: calc(188px + env(safe-area-inset-bottom)); }
  body.at-table .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin: 0;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .controls, .bet-tools { margin-top: 0; }
  .controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
  .bet-tools { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; margin-top: 8px; }
  .controls .btn, .bet-tools .btn { min-height: 48px; padding: 8px 8px; font-size: 13px; line-height: 1.15; }
  .chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin-top: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { width: 54px; height: 54px; flex: none; }
  .chips.locked, .bet-tools.locked { display: none; }
  .side-panel { margin-bottom: 8px; }
}

@media (max-width: 430px) {
  .tabs { display: none; }
  .wallet { position: relative; }
  .wallet .cur {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .wallet .full { font-size: 12px; }
  .btn-join { font-size: 12px; padding: 0 8px; }
  .card, .ghosts i { width: 58px; height: 82px; }
  .card .pip { font-size: 26px; }
  .card .corner b { font-size: 14px; }
  .hand .card + .card { margin-left: -30px; }
  .hero h1 { font-size: 24px; }
  .page h1 { font-size: 26px; }
}

@media (max-width: 860px) and (max-height: 700px) {
  .dealer-card { padding: 6px 8px; }
  .dealer-card .bust { width: 42px; }
  .dealer-card .speech { padding: 4px 8px; }
  .dealer-card .speech p { -webkit-line-clamp: 1; margin: 0; }
  .brand-felt { display: none; }
  .felt { padding: 6px 8px 8px; }
  .card, .ghosts i { width: 50px; height: 70px; }
  .hand .card + .card { margin-left: -24px; }
  .card .pip { font-size: 22px; }
  .spot { width: 54px; height: 54px; margin-top: 0; }
  .chip { width: 46px; height: 46px; }
  .controls .btn, .bet-tools .btn { min-height: 44px; }
  .table-top { margin-bottom: 4px; }
  .table-live { display: none; }
  body.at-table .main { padding-bottom: calc(168px + env(safe-area-inset-bottom)); }
}

@media (max-width: 860px) and (max-height: 500px) {
  .dealer-card .portrait-wrap { display: none; }
  .hero { padding: 14px 12px; }
}
