:root {
  color-scheme: dark;
  --gold: #ffd166;
  --gold-deep: #e7a928;
  --felt: #07553d;
  --felt-dark: #032f24;
  --ink: #f7f1df;
  --muted: #a8c8b9;
  --red: #ef476f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, #186b50 0, transparent 42%),
    linear-gradient(145deg, #071713, #020807 70%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  padding: 18px;
}

button { font: inherit; }

.table-shell {
  width: min(980px, 100%);
  filter: drop-shadow(0 30px 70px #000a);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #071d18;
  border: 1px solid #ffffff14;
  border-bottom: 2px solid var(--gold-deep);
  border-radius: 24px 24px 0 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: .68rem;
  letter-spacing: .34em;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  letter-spacing: .12em;
}

.bankroll {
  min-width: 110px;
  padding: 9px 16px;
  border-radius: 14px;
  background: #ffffff0c;
  border: 1px solid #ffd16652;
  text-align: right;
}

.bankroll span, .control-label {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .18em;
  font-weight: 800;
}

.bankroll strong { color: var(--gold); font-size: 1.45rem; }

.felt {
  min-height: 570px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto 1fr auto;
  gap: 10px;
  padding: 28px clamp(18px, 5vw, 48px) 22px;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 14px, #ffffff05 15px 16px),
    radial-gradient(ellipse at center, #0a6b4d, var(--felt));
  border-inline: 7px solid #6d3e18;
  box-shadow: inset 0 0 55px #00150f99;
}

.felt::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid #ffd16630;
  border-radius: 40% / 12%;
  pointer-events: none;
}

.ambient { position: absolute; border-radius: 50%; filter: blur(42px); opacity: .18; }
.ambient-one { width: 180px; height: 180px; background: #38f5b1; left: -60px; top: 34%; }
.ambient-two { width: 160px; height: 160px; background: #ffd166; right: -80px; bottom: 12%; }

.hand-zone { z-index: 1; min-height: 150px; }
.hand-title { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 14px; }
.hand-title span { color: #d8ecdf; font-size: .78rem; letter-spacing: .17em; font-weight: 800; }
.hand-title strong { min-width: 38px; padding: 4px 8px; border-radius: 99px; color: #05291e; background: var(--gold); text-align: center; }

.cards { display: flex; justify-content: center; min-height: 120px; }
.card {
  width: 82px;
  height: 116px;
  margin-left: -16px;
  padding: 9px;
  border-radius: 10px;
  color: #17201c;
  background: linear-gradient(145deg, #fff, #e9e5d9);
  border: 1px solid #fff;
  box-shadow: 0 9px 18px #00150f66;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: Georgia, serif;
  font-weight: 800;
  font-size: 1.16rem;
  animation: deal .28s cubic-bezier(.2,.8,.2,1) both;
}
.card:first-child { margin-left: 0; }
.card.red { color: #c51f46; }
.card .suit { align-self: center; font-size: 2.1rem; line-height: 1; }
.card .bottom { transform: rotate(180deg); align-self: end; }
.card.back {
  border: 5px solid #eee7d8;
  background: repeating-linear-gradient(45deg, #102a56 0 6px, #d5ad43 6px 9px);
}

.table-mark { z-index: 1; text-align: center; color: #f9d98b; opacity: .78; }
.table-mark span, .table-mark small { display: block; font-size: .63rem; letter-spacing: .17em; }
.table-mark strong { display: block; font: 800 1.55rem Georgia, serif; }

.message {
  z-index: 2;
  justify-self: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  color: #fff;
  background: #041d17cc;
  border: 1px solid #ffffff1e;
  text-align: center;
  font-weight: 800;
}
.message.win { color: var(--gold); border-color: #ffd16675; }
.message.lose { color: #ff94ac; border-color: #ef476f75; }

.controls {
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #071d18;
  border: 1px solid #ffffff14;
  border-top: 2px solid var(--gold-deep);
  border-radius: 0 0 24px 24px;
}
.bet-controls { text-align: center; }
.chip-row, .play-controls { display: flex; gap: 12px; margin-top: 10px; justify-content: center; }
.chip {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px dashed #fff8;
  outline: 3px solid currentColor;
  color: var(--gold);
  background: #3b2513;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 7px 12px #0008;
  transition: transform .15s, filter .15s;
}
.chip:nth-child(2) { color: #7ee8fa; background: #123348; }
.chip:nth-child(3) { color: #ff89a5; background: #481326; }
.chip:nth-child(4) { color: #c9a7ff; background: #2e1948; }
.chip:hover:not(:disabled), .action:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.15); }
button:disabled { opacity: .35; cursor: not-allowed; }

.action {
  min-width: 145px;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid #ffffff24;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .08em;
}
.action.primary { color: #1d1605; background: linear-gradient(#ffe39b, var(--gold-deep)); }
.action.secondary { color: white; background: #ffffff0e; }

footer { padding-top: 10px; color: #6f9182; text-align: center; font-size: .72rem; }

@keyframes deal {
  from { opacity: 0; transform: translateY(-24px) rotate(-6deg) scale(.8); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  body { padding: 0; display: block; }
  .table-shell { min-height: 100vh; }
  .topbar, .controls { border-radius: 0; }
  .topbar { padding: 12px 16px; }
  .felt { min-height: calc(100vh - 210px); border-inline-width: 3px; padding: 18px 10px 14px; }
  .hand-zone { min-height: 130px; }
  .card { width: 68px; height: 96px; font-size: 1rem; }
  .card .suit { font-size: 1.7rem; }
  .chip { width: 50px; }
  .action { min-width: 132px; }
  footer { display: none; }
}
