
:root {
  --gold: #efdfa9;
  --gold-2: #d2b65d;
  --ink: #f8f4e7;
  --muted: #d8cfb7;
  --teal: #5dd4c3;
  --panel: rgba(5, 22, 13, 0.74);
  --panel-strong: rgba(4, 17, 10, 0.86);
  --line: rgba(118, 106, 92, 0.64);
  --line-soft: rgba(118, 106, 92, 0.46);
  --shadow: 0 18px 34px rgba(0,0,0,.32);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-scale: 1;
  --heart: #d64242;
  --light-suit: #ffffff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.22)),
    url('assets/felt-bg-vignette.jpg') center center / cover no-repeat;
}

button, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.app-shell {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1920px;
  height: 1080px;
  padding: 24px;
  transform: translateX(-50%) scale(var(--app-scale));
  transform-origin: top center;
  display: grid;
  grid-template-rows: 250px 122px 1fr;
  gap: 18px;
  overflow: hidden;
}

.panel {
  background: linear-gradient(180deg, rgba(8, 31, 18, .76), rgba(4, 17, 10, .88));
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 760px 1fr;
  gap: 24px;
  padding: 20px;
  align-items: center;
}

.brand-block {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 22px;
  align-items: center;
  min-width: 0;
}

.logo {
  width: 265px;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.36));
}

.brand-copy h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 72px;
  line-height: .94;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.tagline {
  margin: 0;
  color: #f2ead7;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.26;
  font-style: italic;
  text-shadow: 0 2px 6px rgba(0,0,0,.16);
}

.setup-block {
  display: grid;
  grid-template-columns: 1fr 365px;
  gap: 18px;
  align-items: center;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

.setup-grid label span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 17px;
}

select {
  width: 100%;
  height: 44px;
  color: var(--ink);
  background: rgba(2, 12, 7, 0.60);
  border: 2px solid var(--line-soft);
  border-radius: 12px;
  padding: 8px 12px;
  outline: none;
  font-size: 17px;
}

select:focus {
  border-color: rgba(93,212,195,.62);
  box-shadow: 0 0 0 3px rgba(93,212,195,.14);
}

.setup-actions {
  display: grid;
  gap: 14px;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button, .ghost-button {
  border-radius: 14px;
  padding: 12px 16px;
  border: 2px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }

.primary-button {
  min-height: 54px;
  background: linear-gradient(180deg, #55d1c1, #2f9f91);
  color: white;
  box-shadow: 0 10px 18px rgba(0,0,0,.20);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.primary-button.attention {
  box-shadow: 0 0 0 4px rgba(93,212,195,.18), 0 10px 18px rgba(0,0,0,.20);
}

.ghost-button {
  min-height: 48px;
  background: rgba(255,255,255,.045);
  color: var(--ink);
  border-color: var(--line-soft);
  font-size: 17px;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.status-card {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 14px 18px;
  min-height: 0;
}
.status-label {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gold-2);
  font-size: 16px;
}
.status-value {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1.05;
  color: var(--ink);
}
.status-score {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--ink);
}
.status-sub, .delta {
  min-height: 16px;
  color: var(--muted);
  font-size: 14px;
}
.delta { color: #a6eee5; }
.sep { opacity: .72; }

.main-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1285px 1fr;
  gap: 18px;
}
.play-column {
  min-height: 0;
  display: grid;
  grid-template-rows: 374px 1fr;
  gap: 18px;
}

.table-panel {
  min-height: 0;
  padding: 18px;
}
.table-center {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 355px;
  gap: 18px;
}
.upcard-stage, .last-round-stage {
  border: 2px solid var(--line-soft);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.038), transparent 42%), rgba(0,0,0,.10);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 12px;
}
.slot-label {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gold);
  font-size: 15px;
}
.featured-card {
  width: 196px;
  height: auto;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.30));
}
.last-round-cards {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: center;
}
.mini-slot {
  display: grid;
  gap: 7px;
  justify-items: center;
}
.mini-slot span {
  font-family: var(--serif);
  color: var(--muted);
  font-size: 14px;
}
.mini-card {
  width: 72px;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.26));
}
.empty-card { opacity: .18; }

.hand-panel {
  min-height: 0;
  padding: 18px;
}
.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}
.hand-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  color: var(--gold);
}
.hand-header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.hand-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 10px;
}
.card-button {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  min-width: 0;
}
.card-button img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 13px rgba(0,0,0,.24);
  transition: transform .14s ease;
}
.card-button.selected {
  border-color: rgba(93,212,195,.88);
  box-shadow: 0 0 0 3px rgba(93,212,195,.16);
}
.card-button.selected img { transform: translateY(-5px); }
.card-button.used { opacity: .30; pointer-events: none; }
.card-button:hover img { transform: translateY(-2px); }

.hand-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.lock-button {
  min-width: 300px;
  font-size: 23px;
}
.helper-text {
  margin: 13px auto 0;
  max-width: 60ch;
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
}

.side-column {
  min-height: 0;
  display: grid;
  grid-template-rows: 150px 1fr;
  gap: 18px;
}
.result-panel, .scoreboard-panel {
  min-height: 0;
  padding: 16px 18px;
}
.result-panel h2, .scoreboard-panel h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 25px;
}
#roundResult {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.43;
  font-size: 21px;
  color: var(--ink);
}
.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.scoreboard th, .scoreboard td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 6px 7px;
  text-align: center;
}
.scoreboard th {
  color: var(--gold);
  font-family: var(--serif);
  font-weight: 700;
}
.scoreboard td { color: var(--ink); }
.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-inline { white-space: nowrap; }
.suit-heart, .suit-diamond { color: var(--heart); }
.suit-spade, .suit-club { color: var(--light-suit); }
.suit-symbol { padding-left: .02em; }

.dev-hidden { display: none; }
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
  z-index: 999;
}
.overlay.show { display: grid; }
.modal {
  width: min(860px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 18px 20px 20px;
}
.modal-logo {
  float: right;
  width: 110px;
  margin: 0 0 8px 16px;
}
.modal h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 32px;
}
#overlayBody {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.5;
}
#overlayBody p { margin: 0 0 12px; }
#overlayBody ol, #overlayBody ul { padding-left: 24px; margin: 0 0 14px; }
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-top: 12px;
}
.review-table th, .review-table td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 7px 8px;
  text-align: center;
}
.review-table th { color: var(--gold); }
