:root {
  --bg: #072415;
  --felt: #0d3b24;
  --felt-dark: #082417;
  --ink: #f7f4ec;
  --muted: #c7d3c4;
  --panel: #12351f;
  --panel-strong: #f7f4ec;
  --card: #f8f1df;
  --card-shadow: rgba(0, 0, 0, 0.34);
  --black-card: #161616;
  --red-card: #c9333d;
  --gold: #d8b45c;
  --disabled: #253227;
  --ease-on: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
}

.app {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 10px 12px 12px;
  overflow: hidden;
  --screen-bg:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(160deg, #104d2e 0%, var(--felt) 44%, var(--felt-dark) 100%);
}

.app::before,
.picker::before,
.combinations-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--screen-bg);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 50px, #000 calc(100% - 50px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 50px, #000 calc(100% - 50px), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 50px, #000 calc(100% - 50px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 50px, #000 calc(100% - 50px), transparent 100%);
  mask-composite: intersect;
}

.app > *,
.picker > *,
.combinations-page > * {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  height: 60px;
}

.restart,
.players,
.combinations-button,
.mode-toggle,
.picker-action {
  border-radius: 14px;
  background: rgba(247, 244, 236, 0.12);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(247, 244, 236, 0.12);
  transition:
    transform 180ms var(--ease-on),
    background 180ms var(--ease-on),
    color 180ms var(--ease-on),
    box-shadow 180ms var(--ease-on);
}

.players {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 1fr 13px;
  column-gap: 4px;
  align-items: center;
  justify-items: center;
  padding: 5px 7px 6px;
  width: 112px;
  height: 60px;
}

.players strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--gold);
  font-size: 34px;
  line-height: 1;
}

.player-label {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.player-arrows {
  grid-column: 1;
  grid-row: 1;
  color: rgba(247, 244, 236, 0.78);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.restart {
  position: absolute;
  left: 50%;
  top: 0;
  width: 228px;
  height: 60px;
  transform: translateX(-50%);
}

.combinations-button {
  position: absolute;
  left: 420px;
  top: 8px;
  width: 94px;
  height: 44px;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.05;
  padding: 0 6px;
}

.mode-toggle {
  position: absolute;
  right: 0;
  top: 8px;
  width: 62px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 4px;
  line-height: 1;
}

.mode-toggle span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.mode-toggle strong {
  color: var(--gold);
  font-size: 13px;
  font-weight: 950;
}

.mode-toggle.nav-target.is-focused span,
.mode-toggle:hover span {
  color: #12351f;
}

.mode-toggle.nav-target.is-focused strong,
.mode-toggle:hover strong {
  color: #12351f;
}

.version {
  position: absolute;
  right: 2px;
  bottom: -10px;
  height: 10px;
  display: grid;
  align-items: center;
  align-self: center;
  color: rgba(247, 244, 236, 0.64);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.cards-area {
  height: 302px;
  padding-top: 8px;
}

.section-label {
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  margin: 0 0 8px;
}

.slot-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.card-slot,
.card-choice {
  position: relative;
  overflow: hidden;
  background: var(--card);
  color: var(--black-card);
  box-shadow: 0 8px 18px var(--card-shadow);
  transition:
    transform 190ms var(--ease-on),
    background 190ms var(--ease-on),
    color 190ms var(--ease-on),
    box-shadow 190ms var(--ease-on),
    opacity 190ms var(--ease-on);
}

.card-slot {
  width: 84px;
  height: 118px;
  border-radius: 12px;
  display: block;
  padding: 0;
}

.board-row {
  gap: 8px;
}

.board-row .card-slot {
  width: 72px;
  height: 102px;
  border-radius: 10px;
}

.board-row [data-slot="board3"],
.board-row [data-slot="board4"] {
  margin-left: 20px;
}

.nav-target.is-focused,
.card-slot:hover {
  transform: translateY(-3px) scale(1.045);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.42), 0 0 0 4px var(--gold);
}

.restart.nav-target.is-focused,
.players.nav-target.is-focused,
.combinations-button.nav-target.is-focused,
.mode-toggle.nav-target.is-focused,
.restart:hover,
.players:hover,
.combinations-button:hover,
.mode-toggle:hover,
.picker-action.is-target,
.picker-action:hover {
  background: var(--panel-strong);
  color: #12351f;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.restart.nav-target.is-focused,
.restart:hover {
  transform: translateX(-50%) translateY(-2px);
}

.combinations-button.nav-target.is-focused,
.combinations-button:hover,
.mode-toggle.nav-target.is-focused,
.mode-toggle:hover {
  transform: translateY(-2px);
}

.players.nav-target.is-focused .player-label,
.players.nav-target.is-focused .player-arrows,
.players:hover .player-label,
.players:hover .player-arrows {
  color: #12351f;
}

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

.card-slot.filled {
  background: var(--card);
}

.card-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(22, 22, 22, 0.32);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0;
}

.card-corner {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 1px;
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: 0;
}

.card-corner span:first-child {
  font-size: 19px;
  font-weight: 950;
}

.card-corner span:last-child {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  text-rendering: geometricPrecision;
}

.card-corner-top {
  top: 8px;
  left: 8px;
}

.card-corner-bottom {
  right: 8px;
  bottom: 8px;
  transform: rotate(180deg);
}

.card-center-suit {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-rendering: geometricPrecision;
}

.board-row .card-corner-top {
  top: 6px;
  left: 6px;
}

.board-row .card-corner-bottom {
  right: 6px;
  bottom: 6px;
}

.board-row .card-corner span:first-child {
  font-size: 17px;
}

.board-row .card-corner span:last-child {
  font-size: 15px;
}

.board-row .card-center-suit {
  font-size: 40px;
}

.nav-target.is-pressed,
.card-slot:active {
  transform: scale(0.94);
}

.odds-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 92px 46px 18px;
  gap: 8px;
  height: 172px;
  margin-top: 8px;
  align-items: stretch;
}

.odds-panel div {
  border-radius: 12px;
  background: rgba(6, 22, 13, 0.58);
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 6px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(247, 244, 236, 0.1);
}

.odds-panel .win-card {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 336px;
  justify-self: center;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 74, 44, 0.98), rgba(5, 24, 15, 0.98));
  color: var(--ink);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 0 3px rgba(247, 244, 236, 0.4),
    0 0 18px rgba(247, 244, 236, 0.16);
}

.odds-panel div:not(.win-card) {
  grid-row: 2;
  width: 154px;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.odds-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.odds-panel strong {
  color: var(--ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
}

.win-card .odds-label {
  color: currentColor;
  font-size: 15px;
  opacity: 0.78;
}

.win-card strong {
  color: currentColor;
  font-size: 50px;
}

.win-card.win-low {
  color: #f7f4ec;
  background: linear-gradient(180deg, #121512, #020302);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(0, 0, 0, 0.92),
    0 0 18px rgba(0, 0, 0, 0.75);
}

.win-card.win-mid {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(49, 91, 65, 0.98), rgba(14, 46, 28, 0.98));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 0 3px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(255, 255, 255, 0.24);
}

.win-card.win-high {
  color: #ff555f;
  background: linear-gradient(180deg, rgba(86, 24, 31, 0.98), rgba(34, 8, 12, 0.98));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.36),
    0 0 0 3px rgba(255, 85, 95, 0.86),
    0 0 24px rgba(255, 85, 95, 0.38);
}

.win-card.win-gold {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(73, 55, 18, 0.98), rgba(25, 18, 6, 0.98));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.36),
    0 0 0 3px rgba(216, 180, 92, 0.92),
    0 0 28px rgba(216, 180, 92, 0.48);
}

#calc-status {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  color: rgba(247, 244, 236, 0.74);
  font-size: 14px;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.hints {
  display: flex;
  justify-content: center;
  gap: 16px;
  height: 34px;
  align-items: end;
  color: rgba(247, 244, 236, 0.68);
  font-size: 13px;
  font-weight: 760;
}

#picker-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  transform: translate3d(var(--cursor-x, 300px), var(--cursor-y, 300px), 0) translate(-50%, -50%);
  pointer-events: none;
  z-index: 20;
}

#picker-cursor span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(216, 180, 92, 0.82);
  box-shadow: 0 0 0 4px rgba(247, 244, 236, 0.2);
}

.picker {
  position: fixed;
  inset: 0;
  width: 600px;
  height: 600px;
  padding: 10px;
  overflow: hidden;
  --screen-bg:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07), transparent 48%),
    linear-gradient(160deg, #0f4930 0%, #0a2f1e 100%);
  color: var(--ink);
  z-index: 50;
}

.picker.hidden {
  display: none;
}

.picker-header {
  height: 60px;
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  gap: 8px;
  align-items: stretch;
}

#picker-title {
  display: flex;
  align-items: center;
  padding-left: 4px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

#picker-mode-hint {
  padding-left: 5px;
  color: rgba(247, 244, 236, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.picker-action {
  font-size: 14px;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(13, 42px);
  grid-template-rows: repeat(4, 60px);
  justify-content: center;
  align-content: start;
  gap: 7px 4px;
  height: 506px;
  padding-top: 34px;
}

.card-choice {
  width: 42px;
  height: 60px;
  border-radius: 7px;
  min-width: 0;
  display: grid;
  grid-template-rows: 26px 34px;
  align-items: center;
  justify-items: center;
  gap: 0;
  padding: 0;
}

.card-choice.is-target {
  transform: translateY(-2px) scale(1.18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42), 0 0 0 3px var(--gold);
  z-index: 2;
}

.picker.swipe-mode #picker-cursor {
  display: none;
}

.picker.swipe-mode .card-choice.is-target {
  transform: translateY(-3px) scale(1.2);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.48),
    0 0 0 4px var(--gold),
    0 0 20px rgba(216, 180, 92, 0.38);
}

.picker-card-rank,
.picker-card-suit {
  display: block;
  line-height: 0.9;
  text-rendering: geometricPrecision;
}

.picker-card-rank {
  align-self: end;
  font-size: 22px;
  font-weight: 950;
  transform: translateY(-1px);
}

.picker-card-suit {
  align-self: start;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 700;
  transform: translateY(1px);
}

.card-choice.is-used {
  background: var(--disabled);
  color: rgba(247, 244, 236, 0.28);
  box-shadow: none;
  opacity: 0.7;
}

.combinations-page {
  position: fixed;
  inset: 0;
  width: 600px;
  height: 600px;
  padding: 10px;
  overflow: hidden;
  --screen-bg:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 48%),
    linear-gradient(160deg, #0f4930 0%, #07180f 100%);
  color: var(--ink);
  z-index: 60;
}

.combinations-page.hidden {
  display: none;
}

.combinations-header {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
  align-items: stretch;
}

.combinations-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  text-transform: uppercase;
}

.combinations-header div {
  display: grid;
  align-content: center;
  gap: 5px;
  padding-left: 4px;
}

.combinations-header span {
  color: var(--gold);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.combinations-scroll {
  height: 506px;
  overflow-y: auto;
  padding: 6px 4px 18px;
  scroll-behavior: smooth;
}

.combinations-scroll::-webkit-scrollbar {
  width: 8px;
}

.combinations-scroll::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(216, 180, 92, 0.65);
}

.combination-row {
  display: grid;
  grid-template-columns: 40px 190px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(4, 16, 10, 0.68);
  box-shadow: inset 0 0 0 1px rgba(247, 244, 236, 0.08);
}

.combo-rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #092315;
  background: var(--gold);
  font-size: 17px;
  font-weight: 950;
}

.combo-cards {
  display: flex;
  gap: 4px;
}

.mini-card {
  width: 34px;
  height: 48px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--black-card);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.32);
}

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

.combo-copy h2 {
  margin: 0 0 3px;
  color: #61d77f;
  font-size: 19px;
  line-height: 1;
  text-transform: uppercase;
}

.combo-copy p {
  margin: 0;
  color: rgba(247, 244, 236, 0.78);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}
