:root{
  /* Casino Violet Felt Theme */
  --felt-0:#12061f;
  --felt-1:#1a0730;
  --felt-2:#2a0c4a;
  --felt-3:#3a0f63;

  --ink:#f6f3ff;
  --ink-2:rgba(246,243,255,.80);
  --muted:rgba(246,243,255,.60);

  --line:rgba(255,255,255,.16);
  --line-2:rgba(255,255,255,.10);

  --glass:rgba(18,6,31,.58);
  --glass-2:rgba(18,6,31,.40);

  --gold:#f7d36a;
  --gold-2:#f0b429;

  --violet:#8b5cf6;
  --violet-2:#6d28d9;

  --success:#22c55e;
  --danger:#ef4444;

  --shadow: 0 22px 60px rgba(0,0,0,.55);
  --shadow-2: 0 16px 36px rgba(0,0,0,.45);

  --radius:22px;
}

*{box-sizing:border-box}
html,body{height:100%}
a{color:inherit}
button{font:inherit}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--ink);
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;

  /* Felt + spotlight + subtle noise (pure CSS) */
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(139,92,246,.35), transparent 60%),
    radial-gradient(900px 520px at 18% 8%, rgba(247,211,106,.14), transparent 55%),
    radial-gradient(900px 520px at 86% 20%, rgba(99,102,241,.16), transparent 55%),
    repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.06) 0 1px, rgba(0,0,0,0) 1px 6px),
    linear-gradient(180deg, var(--felt-1), var(--felt-0));
}

/* ---------------- Topbar ---------------- */
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  width:min(1100px, 96vw);
  margin: 16px auto 0;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 36px rgba(0,0,0,.40);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}

.badge{
  font-size:12px;
  color: var(--ink-2);
  background: rgba(255,255,255,.08);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
}

.brand-name{
  font-weight:900;
  letter-spacing:-.02em;
  white-space:nowrap;
}

.brand-sep{color:rgba(255,255,255,.40)}
.brand-sub{
  color:var(--muted);
  font-weight:800;
  white-space:nowrap;
}

/* Actions (shuffle + home) */
.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.deck-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  box-shadow: 0 14px 28px rgba(0,0,0,.35);
  cursor:pointer;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: .2px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.deck-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 18px 34px rgba(0,0,0,.40);
}
.deck-btn:active{transform: translateY(0)}
.deck-btn:focus-visible{
  outline: 3px solid rgba(139,92,246,.45);
  outline-offset: 2px;
}

#deck-card{
  width: 26px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
  transform-origin: 50% 60%;
}

.deck-btn.is-shuffling #deck-card{
  animation: deckShuffleSpin 700ms ease-in-out both;
}

@keyframes deckShuffleSpin{
  0%   { transform: rotate(0deg) translateY(0); filter: saturate(1); }
  35%  { transform: rotate(-14deg) translateY(-2px); filter: saturate(1.2); }
  70%  { transform: rotate(14deg) translateY(-2px); filter: saturate(1.2); }
  100% { transform: rotate(0deg) translateY(0); filter: saturate(1); }
}

.home-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  text-decoration:none;
  background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(109,40,217,.14));
  border: 1px solid rgba(139,92,246,.35);
  box-shadow: 0 14px 28px rgba(0,0,0,.32);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.home-btn span{font-weight:800; color: var(--ink)}
.home-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(247,211,106,.55);
  box-shadow: 0 18px 34px rgba(0,0,0,.38);
}
.home-btn:active{transform: translateY(0)}

/* ---------------- Table container (felt) ---------------- */
.container{
  width:min(1100px, 96vw);
  margin: 16px auto 24px;
  padding: 18px 18px 34px;
  border-radius: calc(var(--radius) + 10px);
  position:relative;
  overflow:visible;

  /* Felt texture inside */
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(255,255,255,.10), transparent 65%),
    radial-gradient(900px 520px at 80% 20%, rgba(247,211,106,.10), transparent 55%),
    repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,.05) 0 1px, rgba(0,0,0,0) 1px 7px),
    linear-gradient(180deg, var(--felt-3), var(--felt-2));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: var(--shadow);
}

/* table rim / stitching */
.container::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px dashed rgba(247,211,106,.28);
  pointer-events:none;
  opacity:.7;
}

.container::after{
  content:"";
  position:absolute;
  inset: 0;
  pointer-events:none;
  background-image: url(\"../assets/brand/logo.png\");
  background-repeat: no-repeat;
  background-position: center 58%;
  background-size: min(520px, 70vw);
  opacity: 0.07;
  transform: rotate(-6deg);
  filter: saturate(1.1);
}

/* ---------------- Header area ---------------- */
.title{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding: 6px 6px 14px;
}

.title h1{
  margin:0;
  font-size: 20px;
  letter-spacing:-.02em;
}

.title p{
  margin:0;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}

/* ---------------- Layout ---------------- */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Table wrap + shoe */
.table-wrap{
  position: relative;
}

.table-wrap .grid{
  padding-right: 170px; /* space for shoe */
}

.shoe{
  position:absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 132px;
  height: 220px;
  pointer-events:none;
  z-index: 5;
}

.shoe-body{
  position:relative;
  width:100%;
  height:100%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20,10,35,.92), rgba(10,5,20,.92));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  overflow:hidden;
}

.shoe-lip{
  position:absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.10);
}

.shoe-card{
  position:absolute;
  right: 14px;
  bottom: 14px;
  width: 102px;
  height: 146px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.22);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  transform: rotate(6deg);
  transform-origin: bottom right;
}

.shoe-shadow{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: -14px;
  height: 26px;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0));
  filter: blur(4px);
  opacity: .9;
}

/* Deal animation that feels like it comes from the shoe */
.card.dealt{
  animation: dealFromShoe .28s ease-out both;
}

@keyframes dealFromShoe{
  from{ transform: translate(110px, -10px) rotate(7deg) scale(.985); opacity:0 }
  to{ transform: translate(0,0) rotate(0deg) scale(1); opacity:1 }
}

.shoe.is-shuffling .shoe-card{
  animation: shoeShake .72s ease-in-out both;
}

@keyframes shoeShake{
  0%{ transform: rotate(6deg) translateX(0) }
  20%{ transform: rotate(10deg) translateX(2px) }
  40%{ transform: rotate(4deg) translateX(-2px) }
  60%{ transform: rotate(9deg) translateX(2px) }
  80%{ transform: rotate(5deg) translateX(-1px) }
  100%{ transform: rotate(6deg) translateX(0) }
}

@media (max-width: 980px){
  .table-wrap .grid{ padding-right: 0; }
  .shoe{
    position: static;
    width: 100%;
    height: 120px;
    transform: none;
    margin-top: 12px;
    pointer-events:none;
  }
  .shoe-body{
    height:120px;
    border-radius: 16px;
  }
  .shoe-card{
    width: 86px;
    height: 124px;
    right: 12px;
    bottom: 10px;
  }
}

.section{
  position:relative;
  overflow:visible;
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-2);
}

.section::before{
  content:"";
  position:absolute;
  inset:-40px -60px auto auto;
  width:220px;
  height:220px;
  background: radial-gradient(circle at 30% 30%, rgba(139,92,246,.28), transparent 60%);
  transform: rotate(12deg);
  pointer-events:none;
  filter: blur(.2px);
}
.section.dealer::before{
  inset:-60px auto auto -60px;
  background: radial-gradient(circle at 70% 40%, rgba(247,211,106,.20), transparent 60%);
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.header .name{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
}
.header .name small{
  color: var(--muted);
  font-weight: 800;
}

.score{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
  min-width: 140px;
  justify-content:space-between;
}
.score-label{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.score-value{
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* Card zone + subtle slots */
.cards{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  min-height: 186px;
  align-items:flex-start;
  align-content:flex-start;
  padding: 10px;
  border-radius: 16px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.10);
}

.card{
  width: 118px;
  height: 168px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.22);
  box-shadow: 0 18px 40px rgba(0,0,0,.48);
  background: rgba(255,255,255,.96);
  transform-origin: bottom center;
}

.card.dealt{
  animation: deal .24s ease-out both;
}

@keyframes deal{
  from{ transform: translateY(10px) rotate(-1.2deg) scale(.985); opacity:0 }
  to{ transform: translateY(0) rotate(0deg) scale(1); opacity:1 }
}

/* ---------------- Messages ---------------- */
.message{
  margin: 14px 6px 10px;
  padding: 14px 14px;
  border-radius: 16px;
  text-align:center;
  font-weight: 850;
  letter-spacing: -.01em;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(247,211,106,.12));
  border: 1px solid rgba(247,211,106,.22);
}

/* ---------------- Controls (casino chips) ---------------- */
.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  padding: 10px 6px 6px;
  position: sticky;
  bottom: 12px;
  z-index: 30;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(18,6,31,.55), rgba(18,6,31,.35));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: 0 14px 26px rgba(0,0,0,.35);
  position:relative;
  overflow:hidden;
}

.btn::before{
  content:"";
  position:absolute;
  inset: -1px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 45%);
  opacity:.9;
  pointer-events:none;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(247,211,106,.40);
  box-shadow: 0 18px 30px rgba(0,0,0,.40);
  background: rgba(255,255,255,.10);
}

.btn:active{transform: translateY(0)}

.btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px rgba(139,92,246,.40), 0 18px 30px rgba(0,0,0,.40);
}

.btn-primary{
  background: linear-gradient(135deg, rgba(139,92,246,.36), rgba(109,40,217,.28));
  border-color: rgba(139,92,246,.48);
}
.btn-success{
  background: linear-gradient(135deg, rgba(34,197,94,.34), rgba(22,163,74,.24));
  border-color: rgba(34,197,94,.45);
}

.btn:disabled{
  cursor:not-allowed;
  opacity:.55;
  transform:none !important;
  box-shadow:none !important;
}

/* ---------------- Footer ---------------- */
.footer{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 6px 6px;
  text-align:center;
}
.footer strong{color: var(--ink-2)}

/* Responsive */
@media (max-width: 860px){
  .grid{grid-template-columns: 1fr}
  .topbar{border-radius: 18px}
  .home-btn span{display:none}
  .card{width: 104px; height: 148px}
  .cards{min-height: 166px}
}

@media (max-width: 560px){
  .deck-btn span{ display:none; }
}
