:root {
  color: #f9f4e8;
  background: #12201f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button {
  font: inherit;
}

.table-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(216, 190, 115, 0.12), transparent 28rem),
    linear-gradient(135deg, #182826, #0d1615 58%, #241b18);
}

.score-strip {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.score-strip div {
  min-height: 68px;
  border: 1px solid rgba(249, 244, 232, 0.16);
  background: rgba(16, 25, 24, 0.76);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-strip span,
.eyebrow {
  color: #cfc7b4;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-strip strong {
  font-size: 1.8rem;
  line-height: 1;
}

.felt {
  width: min(980px, 100%);
  min-height: 720px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px);
  display: grid;
  grid-template-rows: auto 1fr auto 1fr auto;
  gap: 18px;
  border: 1px solid rgba(249, 244, 232, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 32px 32px,
    #0f3f3b;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

.table-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.round-message {
  max-width: 310px;
  color: #f4ddb0;
  line-height: 1.45;
  text-align: right;
}

.hand-panel {
  display: grid;
  grid-template-columns: minmax(88px, 140px) 1fr;
  gap: 18px;
  align-items: center;
}

.hand-meta {
  display: grid;
  gap: 8px;
}

.hand-meta h2 {
  color: #e8dec5;
  font-size: 1rem;
  font-weight: 700;
}

.hand-meta span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 240, 221, 0.2);
  border-radius: 50%;
  background: rgba(6, 23, 22, 0.46);
  color: #f8e5ad;
  font-size: 1.75rem;
  font-weight: 800;
}

.cards {
  min-height: 164px;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
  overflow-x: auto;
  padding: 6px 2px 12px;
}

.card {
  position: relative;
  flex: 0 0 clamp(82px, 13vw, 118px);
  aspect-ratio: 5 / 7;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 11px;
  border: 1px solid rgba(30, 30, 30, 0.08);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 12px 24px rgba(3, 16, 15, 0.28);
}

.card span {
  color: inherit;
  font-weight: 800;
  line-height: 1;
}

.card span:last-child {
  justify-self: end;
  align-self: end;
  transform: rotate(180deg);
}

.card strong {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 1.35rem;
}

.card.red {
  color: #b9313b;
}

.card.black {
  color: #162523;
}

.hidden-card {
  padding: 0;
  overflow: hidden;
  background: #123f3a;
}

.hidden-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.table-center {
  height: 76px;
  display: grid;
  place-items: center;
}

.table-center span {
  width: 66px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid #d7be73;
  border-radius: 8px;
  background: #14322f;
  color: #f8e5ad;
  font-weight: 800;
  box-shadow: 7px 7px 0 #0a2724;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.icon-button {
  min-width: 132px;
  min-height: 48px;
  border: 1px solid rgba(246, 240, 221, 0.28);
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  background: rgba(246, 240, 221, 0.09);
  color: #fff9ec;
  cursor: pointer;
}

.icon-button.primary {
  background: #d7be73;
  color: #172321;
  border-color: #f8e5ad;
  font-weight: 800;
}

.icon-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.icon-button:not(:disabled):hover {
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .table-shell {
    padding: 12px;
  }

  .score-strip div {
    min-height: 58px;
    padding: 10px;
    display: grid;
    gap: 4px;
    justify-items: center;
  }

  .score-strip strong {
    font-size: 1.35rem;
  }

  .felt {
    min-height: calc(100vh - 106px);
  }

  .table-header,
  .hand-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .round-message {
    text-align: left;
  }

  .hand-meta {
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
  }

  .hand-meta span {
    width: 54px;
    height: 54px;
    font-size: 1.3rem;
  }

  .cards {
    min-height: 130px;
  }

  .card {
    flex-basis: 82px;
  }

  .card strong {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .icon-button {
    flex: 1 1 30%;
    min-width: 92px;
    padding: 0 10px;
  }
}
