:root {
  color-scheme: dark;
  --bg: #10130f;
  --felt: #176148;
  --felt-dark: #0e3d30;
  --panel: #f6f0df;
  --ink: #1c211b;
  --muted: #6b7168;
  --line: rgba(28, 33, 27, .14);
  --gold: #d7a72e;
  --gold-2: #f3d36d;
  --red: #be2f35;
  --black: #242826;
  --blue: #2f6fb3;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(215, 167, 46, .18), transparent 28%),
    linear-gradient(135deg, #151910 0%, #0c1713 46%, #17150f 100%);
  color: var(--panel);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  padding: 0 16px;
  color: #fff8e2;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: rgba(243, 211, 109, .75);
}

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

.primary {
  border-color: rgba(215, 167, 46, .88);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2d2104;
  font-weight: 800;
}

.app {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar,
.dashboard {
  display: grid;
  gap: 14px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 14px;
}

.eyebrow,
.label {
  display: block;
  margin: 0 0 5px;
  color: rgba(246, 240, 223, .68);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  letter-spacing: 0;
  line-height: .92;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(246, 240, 223, .82);
}

.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(246, 240, 223, .72);
  font-size: 13px;
  font-weight: 800;
}

select {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  padding: 0 34px 0 12px;
  color: #fff8e2;
  background: rgba(0, 0, 0, .22);
}

.dashboard {
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr);
  margin-bottom: 14px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(246, 240, 223, .1);
  box-shadow: var(--shadow);
}

.liquidity {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.liquidity strong {
  display: block;
  color: var(--gold-2);
  font-size: 34px;
}

.stake-row {
  display: grid;
  grid-template-columns: auto minmax(92px, 130px) auto;
  align-items: center;
  gap: 10px;
}

.stake-row label {
  color: rgba(246, 240, 223, .72);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: rgba(0, 0, 0, .2);
}

.metrics {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  color: rgba(246, 240, 223, .76);
}

.metrics b {
  color: #fff8df;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode {
  padding-inline: 10px;
}

.mode.active {
  border-color: var(--gold);
  color: var(--gold-2);
}

.contract p {
  margin: 12px 0 0;
  min-height: 44px;
  color: rgba(246, 240, 223, .74);
}

.table {
  min-height: 620px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    radial-gradient(circle at center, var(--felt), var(--felt-dark));
  background-size: 38px 38px, 38px 38px, auto;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .28), var(--shadow);
}

.opponents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  min-height: 104px;
}

.opponent {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, .18);
}

.opponent.active {
  border-color: var(--gold-2);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 109, .28);
}

.opponent-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.card-backs {
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.reveal-hand {
  justify-content: flex-start;
  gap: 5px;
  max-height: 86px;
  overflow: auto;
}

.back {
  width: 26px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: repeating-linear-gradient(45deg, #8d1f2f, #8d1f2f 4px, #c7a146 4px, #c7a146 8px);
}

.center-stack {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 270px;
  padding: 26px 0 20px;
}

.last-play {
  width: min(610px, 100%);
  min-height: 142px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  padding: 15px;
  background: rgba(11, 28, 22, .74);
  text-align: center;
}

.last-play strong {
  display: block;
  margin-top: 10px;
  color: #fff7d9;
}

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

.player-zone {
  min-height: 190px;
}

.player-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.player-meta strong,
#selectedScore {
  color: #fff7d9;
}

.hand-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.sort-option {
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, .14);
  color: rgba(246, 240, 223, .82);
}

.sort-option.active {
  border-color: var(--gold);
  color: var(--gold-2);
  background: rgba(215, 167, 46, .16);
}

#selectedScore {
  min-width: 84px;
  text-align: right;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.cards.empty {
  align-items: center;
  min-height: 74px;
  color: rgba(246, 240, 223, .58);
}

.card {
  position: relative;
  width: 68px;
  height: 96px;
  flex: 0 0 68px;
  border: 1px solid rgba(28, 33, 27, .22);
  border-radius: 8px;
  padding: 7px;
  background: #fffdf4;
  color: var(--black);
  box-shadow: 0 8px 15px rgba(0, 0, 0, .24);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card.red {
  color: var(--red);
}

.card.selected {
  transform: translateY(-16px);
  box-shadow: 0 0 0 3px var(--gold-2), 0 16px 20px rgba(0, 0, 0, .28);
}

.card .rank {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.card .suit {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.card .pip {
  position: absolute;
  right: 7px;
  bottom: 4px;
  font-size: 28px;
  opacity: .86;
}

.small .card {
  width: 54px;
  height: 76px;
  flex-basis: 54px;
}

.small .rank {
  font-size: 19px;
}

.small .suit,
.small .pip {
  font-size: 18px;
}

@media (max-width: 820px) {
  .topbar,
  .dashboard,
  .liquidity,
  .opponents {
    grid-template-columns: 1fr;
  }

  .wallet,
  .language-picker,
  .metrics,
  .player-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .stake-row {
    grid-template-columns: 1fr;
  }

  .table {
    padding: 14px;
  }

  .card {
    width: 58px;
    height: 84px;
    flex-basis: 58px;
  }
}
