:root {
  color-scheme: dark;
  --ink: #050a08;
  --deep: #0b1712;
  --felt: #123f31;
  --cream: #f5eedf;
  --muted: #9eb0a6;
  --gold: #d5b36f;
  --gold-bright: #efd598;
  --red: #b84245;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select { font: inherit; }

button { color: inherit; }

button:focus-visible,
select:focus-visible,
.catalog-return:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

button:disabled { cursor: not-allowed; opacity: 0.35; }

.catalog-return {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(239, 213, 152, 0.34);
  border-radius: 999px;
  background: rgba(5, 10, 8, 0.82);
  color: #d9c899;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.catalog-return:hover { border-color: var(--gold); color: var(--gold-bright); }

.casino-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  padding: 0 28px 22px;
  background:
    radial-gradient(circle at 50% -10%, rgba(57, 117, 90, 0.22), transparent 35%),
    linear-gradient(180deg, #0b1511 0%, #050907 100%);
}

.casino-shell::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.24;
  pointer-events: none;
}

.topbar,
.table-meta,
.table-stage,
.control-deck,
footer { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1440px, 100%);
  min-height: 92px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 248px; padding-left: 100px; }

.brand-diamond {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, rgba(213, 179, 111, 0.13), transparent);
  color: var(--gold-bright);
  font-size: 21px;
  transform: rotate(45deg);
}

.brand > div { display: flex; flex-direction: column; gap: 2px; }

.brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1;
}

.eyebrow {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.brand-safety {
  max-width: 220px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(213, 179, 111, 0.28);
  color: #82968b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }

.select-control,
.bankroll-pill {
  display: flex;
  height: 48px;
  flex-direction: column;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.select-control {
  position: relative;
  min-width: 132px;
  gap: 2px;
  justify-content: center;
  overflow: hidden;
  padding: 7px 43px 7px 13px;
  border-color: rgba(213, 179, 111, 0.23);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(213, 179, 111, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(30, 47, 39, 0.98), rgba(12, 24, 19, 0.98));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    inset 0 -1px rgba(0, 0, 0, 0.35),
    0 7px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  isolation: isolate;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.select-control::after {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 0;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(213, 179, 111, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(213, 179, 111, 0.12), rgba(213, 179, 111, 0.035));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  content: "";
  transform: translateY(-50%);
}

.select-control::before {
  position: absolute;
  top: calc(50% - 3px);
  right: 18px;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--gold-bright);
  border-bottom: 1.5px solid var(--gold-bright);
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

.select-control:not(.is-disabled):hover {
  border-color: rgba(239, 213, 152, 0.55);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.075),
    0 9px 22px rgba(0, 0, 0, 0.23),
    0 0 0 1px rgba(213, 179, 111, 0.05);
  transform: translateY(-1px);
}

.select-control:focus-within {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(213, 179, 111, 0.18), inset 0 1px rgba(255, 255, 255, 0.07);
}

.select-control.is-disabled { cursor: not-allowed; filter: saturate(0.6); opacity: 0.54; }
.decks-control { min-width: 112px; }

.select-control span,
.bankroll-pill span {
  color: #84978d;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.select-control span {
  position: relative;
  z-index: 1;
  color: #9eaa9f;
  font-size: 7px;
  letter-spacing: 0.19em;
  line-height: 1;
  pointer-events: none;
}

.select-control .select-value {
  position: relative;
  z-index: 1;
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.05;
  pointer-events: none;
  text-shadow: 0 1px rgba(0, 0, 0, 0.5);
}

.select-control select {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.select-control select:focus-visible { outline: 0; }
.select-control select:disabled { cursor: not-allowed; }
.select-control select option { background: #f5eedf; color: #08100d; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }

.round-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: #8fa197;
  cursor: pointer;
}

.round-icon:hover,
.round-icon.active {
  border-color: rgba(213, 179, 111, 0.55);
  background: rgba(213, 179, 111, 0.08);
  color: var(--gold-bright);
}

.feature-action {
  display: flex;
  min-width: 66px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #8fa197;
  cursor: pointer;
  transition: 160ms ease;
}

.feature-action span { color: var(--gold); font-family: Georgia, serif; font-size: 16px; }
.feature-action small { font-size: 7px; font-weight: 900; letter-spacing: 0.12em; }
.feature-action:hover,
.feature-action.active { border-color: rgba(213, 179, 111, 0.55); background: rgba(213, 179, 111, 0.09); color: var(--gold-bright); transform: translateY(-1px); }
.count-toggle.active { box-shadow: inset 0 0 18px rgba(85, 181, 140, 0.11), 0 0 0 1px rgba(85, 181, 140, 0.12); }
.strategy-button { min-width: 86px; }

.bankroll-pill {
  min-width: 150px;
  align-items: flex-end;
  border-color: rgba(213, 179, 111, 0.3);
  background: linear-gradient(135deg, rgba(213, 179, 111, 0.12), rgba(213, 179, 111, 0.02));
}

.bankroll-pill strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 18px; font-weight: 500; }

.table-meta {
  display: flex;
  width: min(1380px, 96%);
  height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  color: #7f9288;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-meta b { color: #c2cfc8; }

.shoe-meter { position: relative; width: 185px; height: 5px; text-align: center; white-space: nowrap; }
.shoe-meter::before { position: absolute; top: -7px; left: 0; width: 100%; height: 2px; background: rgba(255, 255, 255, 0.08); content: ""; }
.shoe-meter i { position: absolute; top: -7px; left: 0; height: 2px; background: var(--gold); transition: width 400ms ease; }

.table-stage { width: min(1440px, 100%); margin: 0 auto; }

.table-rail {
  padding: 11px;
  border-radius: 74px 74px 34px 34px;
  background:
    linear-gradient(110deg, #3b2117, #8a5b35 13%, #2a1711 29%, #694021 48%, #1e120d 70%, #7c4e2c 88%, #2f1b13),
    #4b2c1d;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.58), inset 0 1px 1px rgba(255, 255, 255, 0.26), inset 0 -4px 8px rgba(0, 0, 0, 0.7);
}

.felt-table {
  position: relative;
  height: clamp(590px, calc(100svh - 230px), 700px);
  overflow: hidden;
  border: 1px solid rgba(235, 213, 162, 0.42);
  border-radius: 64px 64px 25px 25px;
  background:
    radial-gradient(ellipse at 50% 72%, rgba(41, 116, 84, 0.5), transparent 45%),
    radial-gradient(ellipse at 50% 12%, rgba(33, 99, 74, 0.34), transparent 47%),
    linear-gradient(180deg, #154633, #0e362a 62%, #0a2a21);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.46), inset 0 0 0 7px rgba(0, 0, 0, 0.12);
}

.felt-table::after {
  position: absolute;
  inset: 24px 31px;
  border: 1px solid rgba(226, 195, 130, 0.14);
  border-radius: 44px 44px 18px 18px;
  content: "";
  pointer-events: none;
}

.felt-grain {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(23deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
  opacity: 0.19;
}

.count-panel {
  position: absolute;
  top: 24px;
  right: 31px;
  z-index: 5;
  width: 190px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(213, 179, 111, 0.3);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(5, 21, 16, 0.94), rgba(8, 31, 23, 0.86));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.count-title,
.count-detail,
.count-key { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.count-title span { color: var(--gold); font-size: 7px; font-weight: 900; letter-spacing: 0.18em; }
.count-title b { padding: 2px 5px; border-radius: 999px; background: rgba(85, 181, 140, 0.16); color: #89d7ab; font-size: 6px; letter-spacing: 0.1em; }
.count-values { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 7px; }
.count-values div { padding: 7px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; background: rgba(255, 255, 255, 0.025); }
.count-values span { display: block; color: #789087; font-size: 5px; font-weight: 800; letter-spacing: 0.08em; }
.count-values strong { display: block; margin-top: 2px; color: var(--gold-bright); font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.count-detail { color: #91a59b; font-size: 6px; }
.count-key { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.count-key b { color: #c0ccc5; font-size: 6px; font-weight: 800; }

.dealer-zone {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 2;
  display: flex;
  width: 260px;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.dealer-label,
.player-label { display: flex; min-height: 24px; align-items: center; gap: 8px; }

.dealer-label span,
.player-label span { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: 0.2em; }

.dealer-label b,
.score-badge {
  display: grid;
  min-width: 30px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(213, 179, 111, 0.36);
  border-radius: 10px;
  background: rgba(4, 15, 11, 0.5);
  color: var(--gold-bright);
  font-size: 9px;
}

.dealer-zone p { margin: 8px 0 0; color: #759388; font-size: 8px; letter-spacing: 0.13em; text-transform: uppercase; }

.empty-card-line { display: flex; height: 88px; align-items: center; gap: 7px; }
.empty-card-line span { width: 60px; height: 83px; border: 1px dashed rgba(235, 238, 230, 0.16); border-radius: 7px; }

.cards { display: flex; min-height: 96px; align-items: center; justify-content: center; padding-right: 18px; }

.playing-card {
  position: relative;
  width: 64px;
  height: 90px;
  flex: 0 0 auto;
  margin-right: -18px;
  overflow: hidden;
  border: 1px solid rgba(18, 17, 13, 0.32);
  border-radius: 7px;
  background: linear-gradient(145deg, #fffef8, #e7e0d1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.27), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.playing-card.is-dealing {
  animation: card-deal 360ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes card-deal {
  from { opacity: 0; transform: translateY(-24px) rotate(-4deg) scale(.86); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.red-card { color: #b42c35; }
.black-card { color: #121a17; }

.card-corner { position: absolute; display: flex; flex-direction: column; align-items: center; font-family: Georgia, serif; line-height: 0.9; }
.card-corner b { font-size: 15px; }
.card-corner i { margin-top: 3px; font-size: 12px; font-style: normal; }
.card-corner.top { top: 5px; left: 6px; }
.card-corner.bottom { right: 6px; bottom: 5px; transform: rotate(180deg); }
.card-suit { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; opacity: 0.88; }

.card-back {
  display: grid;
  place-items: center;
  border: 4px solid #e8dfcb;
  background:
    linear-gradient(45deg, transparent 44%, rgba(229, 200, 136, 0.38) 45% 55%, transparent 56%) 0 0 / 13px 13px,
    linear-gradient(-45deg, transparent 44%, rgba(229, 200, 136, 0.24) 45% 55%, transparent 56%) 0 0 / 13px 13px,
    #173d30;
  color: var(--gold-bright);
}

.back-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(239, 213, 152, 0.7); background: #0f2d23; font-family: Georgia, serif; font-size: 13px; transform: rotate(45deg); }

.opponents {
  position: absolute;
  top: 165px;
  right: 5.5%;
  left: 5.5%;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 52px);
}

.opponent {
  min-width: 0;
  padding: 11px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-top: 2px solid var(--seat-color);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(4, 18, 13, 0.59), rgba(4, 17, 13, 0.28));
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.16);
  transition: 220ms ease;
}

.opponent.thinking { border-color: var(--seat-color); box-shadow: 0 0 28px color-mix(in srgb, var(--seat-color), transparent 72%); transform: translateY(-5px); }
.opponent-head { position: relative; display: flex; align-items: center; gap: 10px; }

.avatar {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--seat-color);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--seat-color), white 38%), transparent 22%),
    conic-gradient(from 45deg, var(--seat-color), #10281f, var(--seat-color));
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.avatar::before,
.avatar::after { position: absolute; width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, 0.25); content: ""; transform: rotate(45deg); }
.avatar::after { width: 18px; height: 18px; transform: rotate(22deg); }
.avatar span { position: relative; z-index: 1; color: white; font-family: Georgia, serif; font-size: 18px; text-shadow: 0 2px 6px #000; }

.opponent-name { display: flex; min-width: 0; flex-direction: column; }
.opponent-name span { color: var(--seat-color); font-size: 7px; font-weight: 800; letter-spacing: 0.17em; text-transform: uppercase; }
.opponent-name strong { font-family: Georgia, serif; font-size: 19px; font-weight: 500; line-height: 1.25; }
.opponent-name small { overflow: hidden; color: #8ca097; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.score-badge { margin-left: auto; }

.ai-cards { min-height: 69px; margin-top: -2px; }
.ai-cards .cards { min-height: 67px; padding-right: 13px; }
.ai-cards .playing-card { width: 46px; height: 64px; margin-right: -13px; border-radius: 5px; }
.ai-cards .card-corner b { font-size: 10px; }
.ai-cards .card-corner i { margin-top: 1px; font-size: 8px; }
.ai-cards .card-corner.top { top: 3px; left: 4px; }
.ai-cards .card-corner.bottom { right: 4px; bottom: 3px; }
.ai-cards .card-suit { font-size: 20px; }

.quote { min-height: 27px; overflow: hidden; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.06); color: #adbbb4; font-family: Georgia, serif; font-size: 10px; font-style: italic; text-overflow: ellipsis; white-space: nowrap; }
.quote span { margin-right: 7px; color: var(--seat-color); font-family: Inter, sans-serif; font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.empty-mini-cards { display: flex; height: 67px; align-items: center; justify-content: center; gap: 5px; }
.empty-mini-cards i { width: 44px; height: 60px; border: 1px dashed rgba(255, 255, 255, 0.12); border-radius: 5px; }

.table-inscription { position: absolute; top: 51%; left: 50%; z-index: 1; display: flex; width: min(700px, 68%); align-items: center; justify-content: center; gap: 25px; color: rgba(222, 196, 137, 0.38); text-align: center; transform: translate(-50%, -50%); }
.table-inscription span { width: 220px; padding: 9px 0; border-top: 1px solid rgba(222, 196, 137, 0.2); border-bottom: 1px solid rgba(222, 196, 137, 0.2); font-family: Georgia, serif; font-size: 9px; letter-spacing: 0.13em; }
.table-inscription b { font-size: 24px; font-weight: 400; }

.player-zone { position: absolute; bottom: 28px; left: 50%; z-index: 4; display: flex; width: min(720px, 78%); min-height: 225px; flex-direction: column; align-items: center; justify-content: flex-end; transform: translateX(-50%); }
.player-label strong { font-family: Georgia, serif; font-size: 14px; font-weight: 400; }
.player-hands { display: flex; align-items: flex-start; justify-content: center; gap: 24px; }
.player-hand { position: relative; min-width: 170px; padding: 5px 12px 1px; border: 1px solid transparent; border-radius: 13px; }
.player-hand.active-hand { border-color: rgba(239, 213, 152, 0.52); background: rgba(213, 179, 111, 0.07); box-shadow: 0 0 28px rgba(213, 179, 111, 0.08); }
.hand-caption { display: flex; min-height: 19px; align-items: center; justify-content: center; gap: 8px; }
.hand-caption span { color: #b4c3bb; font-size: 8px; font-weight: 800; letter-spacing: 0.12em; }
.hand-caption b { min-width: 26px; color: var(--gold-bright); font-family: Georgia, serif; font-size: 15px; font-weight: 400; }
.player-hand .cards { min-height: 117px; padding-right: 23px; }
.player-hand .playing-card { width: 78px; height: 110px; margin-right: -23px; border-radius: 8px; }
.player-hand .card-corner b { font-size: 18px; }
.player-hand .card-corner i { font-size: 14px; }
.player-hand .card-suit { font-size: 35px; }

.player-placeholder { display: flex; height: 155px; flex-direction: column; align-items: center; justify-content: center; color: #739083; font-size: 8px; letter-spacing: 0.15em; text-transform: uppercase; }
.seat-glow { width: 135px; height: 68px; margin-bottom: 12px; border: 1px dashed rgba(239, 213, 152, 0.22); border-radius: 50%; background: radial-gradient(ellipse, rgba(213, 179, 111, 0.07), transparent 68%); }
.strategy-hint { max-width: 360px; margin-top: 8px; padding: 8px 12px; border-left: 2px solid var(--gold); background: rgba(3, 12, 9, 0.72); color: #b8c6bf; font-size: 9px; }
.strategy-hint span { margin-right: 9px; color: var(--gold); font-size: 7px; font-weight: 800; letter-spacing: 0.15em; }
.result-tag { width: max-content; margin: -1px auto 0; padding: 4px 9px; border-radius: 12px; background: rgba(4, 15, 11, 0.85); color: #d0dad4; font-size: 8px; font-weight: 800; letter-spacing: 0.12em; }
.result-tag.win { color: #7ee0a5; }
.result-tag.loss { color: #e8908f; }
.result-tag.push { color: var(--gold-bright); }

.control-deck {
  position: sticky;
  bottom: 10px;
  z-index: 8;
  display: flex;
  width: min(1060px, calc(100% - 36px));
  min-height: 82px;
  align-items: center;
  gap: 19px;
  margin: -10px auto 0;
  padding: 11px 14px;
  border: 1px solid rgba(213, 179, 111, 0.19);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 34, 29, 0.98), rgba(9, 16, 13, 0.99));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.05);
}

.control-status { min-width: 144px; padding-right: 16px; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.control-status span { display: block; margin-bottom: 4px; color: #71867b; font-size: 8px; font-weight: 800; letter-spacing: 0.18em; }
.control-status strong { display: block; max-width: 190px; overflow: hidden; color: var(--cream); font-family: Georgia, serif; font-size: 17px; font-weight: 400; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.bet-controls,
.play-controls,
.settled-controls { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 10px; }
.chips { display: flex; gap: 6px; }

.bet-decrease {
  display: flex;
  width: 51px;
  height: 51px;
  flex: 0 0 51px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(213, 179, 111, 0.3);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(213, 179, 111, 0.08), rgba(255, 255, 255, 0.025));
  color: var(--gold-bright);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.bet-decrease span { font-family: Georgia, serif; font-size: 14px; line-height: 1; }
.bet-decrease small { color: #82968b; font-size: 6px; font-weight: 800; letter-spacing: 0.12em; }
.bet-decrease:hover:not(:disabled) { border-color: var(--gold); background: rgba(213, 179, 111, 0.12); transform: translateY(-2px); }

.chip {
  width: 51px;
  height: 51px;
  padding: 4px;
  border: 3px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32), inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease;
}

.chip:hover { transform: translateY(-3px) rotate(4deg); }
.chip span { display: grid; width: 100%; height: 100%; place-items: center; border: 1px solid rgba(255, 255, 255, 0.42); border-radius: 50%; background: rgba(0, 0, 0, 0.15); color: white; font-size: 11px; font-weight: 900; }
.chip-0 { background: #457c62; }
.chip-1 { background: #b44446; }
.chip-2 { background: #315a9c; }
.chip-3 { background: #151816; }
.bet-tools { display: flex; flex-direction: column; gap: 2px; margin: 0 4px; }
.bet-tools button { padding: 2px 7px; border: 0; background: transparent; color: #81958a; font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.bet-tools button:hover { color: var(--gold-bright); }

.primary-action,
.secondary-action,
.game-action {
  min-height: 50px;
  padding: 0 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.primary-action { border-color: #d1ad65; background: linear-gradient(180deg, #e0c27f, #b78e45); color: #142019; box-shadow: 0 7px 18px rgba(190, 151, 77, 0.15); }
.primary-action:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); }
.deal-action { display: flex; min-width: 122px; align-items: center; justify-content: center; gap: 11px; }
.primary-action small,
.game-action small { opacity: 0.55; font-size: 8px; }
.game-action { display: flex; min-width: 105px; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.045); color: #bdcbc4; }
.game-action:hover:not(:disabled) { border-color: rgba(213, 179, 111, 0.55); background: rgba(213, 179, 111, 0.09); color: var(--gold-bright); }
.hit-action { border-color: rgba(88, 177, 128, 0.36); background: rgba(65, 142, 99, 0.12); }
.stand-action { border-color: rgba(213, 179, 111, 0.38); }
.surrender-action { border-color: rgba(192, 107, 107, 0.34); color: #d9b7b7; }
.secondary-action { background: transparent; color: #9db0a6; }
.secondary-action:hover { border-color: var(--gold); color: var(--gold-bright); }
.waiting-control { display: flex; flex: 1; align-items: center; justify-content: center; gap: 14px; color: #b9c7c0; font-family: Georgia, serif; font-size: 16px; }
.waiting-control i { width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); animation: pulse-line 1s ease-in-out infinite alternate; }
.waiting-control i:last-child { transform: rotate(180deg); }
@keyframes pulse-line { from { opacity: .25; } to { opacity: 1; } }
.rebuy-action { margin-left: auto; }

footer { display: flex; width: min(1380px, 96%); justify-content: space-between; margin: 21px auto 0; color: #516259; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 22px; background: rgba(2, 7, 5, 0.82); backdrop-filter: blur(8px); }
.rules-modal { position: relative; width: min(620px, 100%); max-height: min(780px, 92vh); overflow-y: auto; padding: 34px; border: 1px solid rgba(213, 179, 111, 0.33); border-radius: 18px; background: linear-gradient(145deg, #15251e, #09110e); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65); }
.rules-modal h2 { margin: 6px 0 12px; font-family: Georgia, serif; font-size: 35px; font-weight: 400; }
.rules-lead { margin: 0 0 24px; color: #acbbb3; font-family: Georgia, serif; font-size: 15px; line-height: 1.55; }
.modal-close { position: absolute; top: 14px; right: 17px; width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50%; background: transparent; color: #aab8b1; font-size: 22px; cursor: pointer; }
.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rule-grid div { display: flex; min-height: 88px; flex-direction: column; justify-content: space-between; padding: 13px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 10px; background: rgba(255, 255, 255, 0.025); }
.rule-grid b { color: var(--gold-bright); font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.rule-grid span { color: #83958b; font-size: 8px; letter-spacing: 0.08em; line-height: 1.35; text-transform: uppercase; }
.mode-list { margin-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mode-list div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.mode-list strong { color: var(--gold); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.mode-list p { margin: 0; color: #9aaba2; font-size: 11px; line-height: 1.45; }
.fine-print { margin: 20px 0 0; color: #65766d; font-size: 9px; line-height: 1.5; }

.strategy-modal { width: min(1120px, 100%); }
.strategy-modal .rules-lead strong { color: var(--gold-bright); font-weight: 500; }
.strategy-assumptions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.strategy-assumptions span { padding: 5px 8px; border: 1px solid rgba(213, 179, 111, 0.2); border-radius: 999px; background: rgba(213, 179, 111, 0.06); color: #b8c6bf; font-size: 7px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.strategy-caveat { margin: 0 0 14px; padding: 10px 12px; border-left: 2px solid #c99c57; background: rgba(201, 156, 87, 0.08); color: #cbbda1; font-size: 10px; line-height: 1.45; }
.strategy-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 13px 0 18px; color: #91a39a; font-size: 8px; }
.strategy-legend span { display: inline-flex; align-items: center; gap: 5px; }
.strategy-legend b { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 6px; font-size: 8px; }
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.strategy-table-card { min-width: 0; padding: 13px; border: 1px solid rgba(255, 255, 255, 0.075); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.strategy-table-card h3 { margin: 0 0 10px; color: var(--gold); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; }
.strategy-table-scroll { overflow-x: auto; }
.strategy-table-card table { width: 100%; min-width: 430px; border-collapse: separate; border-spacing: 2px; font-size: 8px; text-align: center; }
.strategy-table-card th,
.strategy-table-card td { height: 24px; padding: 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.035); }
.strategy-table-card thead th { color: #7f9288; font-size: 7px; }
.strategy-table-card tbody th { width: 42px; color: #d9dfdc; text-align: left; }
.strategy-table-card td { color: #aebdb5; font-weight: 900; }
[data-move="H"] { background: rgba(76, 125, 167, 0.2) !important; color: #9bc1e2 !important; }
[data-move="S"] { background: rgba(85, 181, 140, 0.16) !important; color: #99d8b4 !important; }
[data-move="D"],
[data-move="DS"] { background: rgba(213, 179, 111, 0.17) !important; color: var(--gold-bright) !important; }
[data-move="P"] { background: rgba(141, 104, 179, 0.2) !important; color: #ccb2e5 !important; }
[data-move="R"] { background: rgba(184, 66, 69, 0.2) !important; color: #e8a3a4 !important; }
.strategy-sources { margin: 18px 0 0; color: #71837a; font-size: 9px; line-height: 1.55; }
.strategy-sources a { color: #d6bd83; text-underline-offset: 3px; }
.strategy-sources a:hover { color: var(--gold-bright); }

@media (max-width: 980px) {
  .casino-shell { padding-inline: 14px; }
  .topbar { align-items: flex-start; padding: 12px 0; }
  .top-actions { flex-wrap: wrap; }
  .felt-table { height: 720px; }
  .opponents { right: 3%; left: 3%; gap: 10px; }
  .opponent { padding-inline: 8px; }
  .avatar { width: 48px; height: 48px; flex-basis: 48px; }
  .opponent-name strong { font-size: 16px; }
  .control-deck { width: calc(100% - 16px); }
  .control-status { min-width: 120px; }
  .game-action { min-width: 90px; padding-inline: 16px; }
}

@media (max-width: 720px) {
  html,
  body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }

  .catalog-return { top: max(4px, env(safe-area-inset-top)); left: 6px; min-height: 25px; padding-inline: 8px; font-size: 8px; }

  .casino-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    padding: max(4px, env(safe-area-inset-top)) 5px max(4px, env(safe-area-inset-bottom));
  }

  .topbar { width: 100%; min-height: 0; flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 4px; padding: 2px 4px 5px; border-bottom: 0; }
  .brand { width: 100%; height: 28px; min-width: 0; gap: 9px; padding-left: 70px; }
  .brand-diamond { width: 27px; height: 27px; flex-basis: 27px; font-size: 13px; }
  .brand > div { flex-direction: row; align-items: baseline; gap: 8px; }
  .brand h1 { font-size: 17px; }
  .brand .eyebrow,
  .brand-safety { display: none; }
  .top-actions {
    display: grid;
    width: 100%;
    height: 70px;
    grid-template-areas: "mode shoe bankroll bankroll" "count strategy sound rules";
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr) minmax(42px, 0.56fr) minmax(42px, 0.56fr);
    grid-template-rows: 35px 32px;
    gap: 3px;
    padding: 0;
    overflow: visible;
  }
  .top-actions > .select-control:nth-child(1) { grid-area: mode; }
  .top-actions > .select-control:nth-child(2) { grid-area: shoe; }
  .count-toggle { grid-area: count; }
  .strategy-button { grid-area: strategy; }
  .top-actions > .round-icon:nth-of-type(3) { grid-area: sound; }
  .top-actions > .round-icon:nth-of-type(4) { grid-area: rules; }
  .bankroll-pill { grid-area: bankroll; }
  .select-control,
  .bankroll-pill { width: auto; min-width: 0; height: 35px; padding: 4px 8px; border-radius: 8px; }
  .select-control { gap: 1px; padding-right: 28px; padding-left: 8px; border-radius: 9px; }
  .select-control::after { right: 5px; width: 19px; height: 22px; border-radius: 6px; }
  .select-control::before { top: calc(50% - 3px); right: 11px; width: 5px; height: 5px; }
  .select-control span,
  .bankroll-pill span { font-size: 7px; }
  .select-control span { font-size: 6px; letter-spacing: 0.13em; }
  .select-control .select-value { font-size: 11px; }
  .round-icon { width: 100%; height: 32px; align-self: center; border-radius: 8px; font-size: 12px; }
  .feature-action { width: 100%; min-width: 0; height: 32px; gap: 4px; padding: 0 6px; border-radius: 8px; }
  .feature-action span { font-size: 12px; }
  .feature-action small { font-size: 7px; letter-spacing: 0.08em; }
  .bankroll-pill strong { font-size: 14px; }
  .table-meta,
  footer { display: none; }

  .table-stage { width: 100%; min-height: 0; flex: 1 1 auto; overflow: hidden; }
  .table-rail,
  .felt-table { height: 100%; }
  .table-rail { padding: 4px; border-radius: 27px 27px 13px 13px; }
  .felt-table { min-height: 0; border-radius: 23px 23px 10px 10px; }
  .felt-table::after { inset: 9px; border-radius: 16px 16px 7px 7px; }
  .count-panel { top: 6px; right: 5px; width: clamp(112px, 32vw, 126px); padding: 7px 8px; border-radius: 9px; }
  .count-title span { font-size: 6px; letter-spacing: 0.1em; }
  .count-title b { padding: 2px 4px; font-size: 5px; }
  .count-values { gap: 4px; margin: 6px 0; }
  .count-values div { padding: 4px; border-radius: 5px; }
  .count-values span { font-size: 5px; }
  .count-values strong { font-size: 18px; }
  .count-detail { display: none; }
  .count-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 5px; padding-top: 4px; }
  .count-key b { display: block; font-size: 5px; line-height: 1.4; text-align: center; white-space: nowrap; }
  .felt-table.counting-on .dealer-zone { left: 30%; }
  .dealer-zone { top: 7px; width: 180px; }
  .dealer-label { min-height: 18px; }
  .dealer-label span { font-size: 7px; }
  .dealer-label b { min-width: 25px; height: 17px; font-size: 7px; }
  .dealer-zone .cards { min-height: 66px; }
  .dealer-zone .playing-card { width: 46px; height: 64px; margin-right: -13px; }
  .dealer-zone .card-corner.bottom { display: none; }
  .dealer-zone .card-suit { font-size: 20px; }
  .dealer-zone p { display: none; }
  .empty-card-line { height: 64px; }
  .empty-card-line span { width: 45px; height: 60px; }

  .opponents { top: 104px; right: 2%; left: 2%; gap: 4px; }
  .opponent { min-height: 145px; padding: 5px 3px 4px; border-radius: 8px; }
  .opponent-head { flex-direction: column; gap: 1px; text-align: center; }
  .avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .avatar::before { width: 20px; height: 20px; }
  .avatar::after { width: 12px; height: 12px; }
  .avatar span { font-size: 12px; }
  .opponent-name { align-items: center; }
  .opponent-name span { display: block; max-width: 95px; overflow: hidden; font-size: 5px; text-overflow: ellipsis; white-space: nowrap; }
  .opponent-name strong { font-size: 13px; line-height: 1.05; }
  .opponent-name small { max-width: 95px; font-size: 6px; }
  .score-badge { position: absolute; top: -2px; right: 1px; min-width: 22px; height: 15px; font-size: 6px; }
  .ai-cards,
  .ai-cards .cards { min-height: 48px; }
  .ai-cards .playing-card { width: 34px; height: 47px; margin-right: -13px; }
  .ai-cards .card-corner b { font-size: 8px; }
  .ai-cards .card-corner i { font-size: 6px; }
  .ai-cards .card-corner.bottom { display: none; }
  .ai-cards .card-suit { font-size: 15px; }
  .empty-mini-cards { height: 48px; }
  .empty-mini-cards i { width: 31px; height: 44px; }
  .quote { height: 18px; min-height: 18px; padding-top: 4px; font-size: 0; text-align: center; }
  .quote span { margin: 0; font-size: 6px; }
  .table-inscription { display: none; }

  .player-zone { bottom: 6px; width: 96%; min-height: 185px; max-height: 42%; }
  .player-label { min-height: 21px; gap: 7px; }
  .player-label span { font-size: 7px; }
  .player-label strong { max-width: 220px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .player-hands { width: 100%; gap: 3px; }
  .player-hand { min-width: 0; max-width: 240px; flex: 1; padding: 2px 4px 1px; }
  .hand-caption { min-height: 16px; }
  .hand-caption span { font-size: 6px; }
  .hand-caption b { font-size: 12px; }
  .player-hand .cards { min-height: 88px; padding-right: 18px; }
  .player-hand .playing-card { width: 61px; height: 85px; margin-right: -18px; }
  .player-hand .card-corner b { font-size: 14px; }
  .player-hand .card-corner i { font-size: 10px; }
  .player-hand .card-suit { font-size: 27px; }
  .split-hands .player-hand .playing-card { width: 49px; height: 70px; margin-right: -19px; }
  .player-placeholder { height: 112px; }
  .seat-glow { width: 112px; height: 56px; }
  .strategy-hint { max-width: 270px; margin-top: 3px; padding: 5px 8px; border-left: 0; border-top: 2px solid var(--gold); font-size: 8px; text-align: center; }
  .result-tag { padding: 3px 7px; font-size: 6px; }

  .control-deck { position: relative; bottom: auto; width: calc(100% - 4px); height: 60px; min-height: 0; flex: 0 0 60px; gap: 6px; margin: 4px auto 0; padding: 5px 6px; border-radius: 11px; }
  .control-status { min-width: 68px; max-width: 74px; padding-right: 5px; }
  .control-status span { font-size: 6px; letter-spacing: 0.1em; }
  .control-status strong { font-size: 11px; white-space: normal; }
  .bet-controls { min-width: 0; gap: 3px; }
  .chips { gap: 2px; }
  .bet-decrease { width: 30px; height: 34px; flex-basis: 30px; gap: 1px; border-radius: 8px; }
  .bet-decrease span { font-size: 10px; }
  .bet-decrease small { font-size: 4px; }
  .chip { width: clamp(28px, 8.7vw, 34px); height: 34px; padding: 3px; border-width: 2px; }
  .chip span { font-size: 8px; }
  .bet-tools { display: none; }
  .primary-action { min-height: 40px; padding-inline: 10px; font-size: 9px; }
  .deal-action { min-width: 68px; }
  .primary-action small { display: none; }
  .play-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .game-action { min-width: 0; min-height: 40px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 3px; font-size: 7px; letter-spacing: 0.07em; }
  .game-action small { font-size: 6px; }
  .settled-controls { gap: 5px; }
  .settled-controls button { min-height: 40px; padding-inline: 9px; font-size: 8px; }
  .waiting-control { gap: 8px; font-size: 11px; }
  .waiting-control i { width: 18px; }
  .rules-modal { max-height: 100%; padding: 28px 20px; }
  .rule-grid { grid-template-columns: repeat(2, 1fr); }
  .strategy-modal { padding: 24px 12px; }
  .strategy-modal h2 { font-size: 26px; }
  .strategy-modal .rules-lead { margin-bottom: 14px; font-size: 12px; }
  .strategy-grid { grid-template-columns: 1fr; }
  .strategy-table-card { padding: 9px; }
  .strategy-table-card table { min-width: 390px; }
}

@media (max-width: 720px) and (max-height: 700px) {
  .brand { height: 24px; }
  .brand-diamond { width: 23px; height: 23px; flex-basis: 23px; font-size: 11px; }
  .brand h1 { font-size: 16px; }
  .top-actions { height: 61px; grid-template-rows: 31px 27px; }
  .select-control,
  .bankroll-pill { height: 31px; }
  .round-icon,
  .feature-action { height: 27px; }
  .dealer-zone .playing-card { width: 40px; height: 56px; }
  .dealer-zone .cards { min-height: 57px; }
  .opponents { top: 104px; }
  .opponent { min-height: 126px; }
  .avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .ai-cards,
  .ai-cards .cards { min-height: 42px; }
  .ai-cards .playing-card { width: 30px; height: 41px; }
  .quote { display: none; }
  .player-zone { min-height: 158px; }
  .player-hand .cards { min-height: 76px; }
  .player-hand .playing-card { width: 54px; height: 75px; }
  .control-deck { height: 55px; flex-basis: 55px; }
}

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