/* Dwindle — Vintage Deck theme */
:root {
  color-scheme: light;
  --paper: #f4e9d0;
  --paper-2: #ecdcb8;
  --paper-edge: #d9c69a;
  --ink: #2b2114;
  --ink-soft: #5c4d35;
  --red-suit: #9e2b25;
  --black-suit: #1f1a13;
  --gold: #8a6d2b;
  --gold-light: #c9a959;
  --line: #b8a276;
  --felt-shadow: rgba(43, 33, 20, 0.35);
  --ticket: #fbf4df;
}

* { box-sizing: border-box; }

body {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  margin: 0;
  padding: 0 14px 56px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -10%, #3d3a2e 0%, transparent 60%),
    repeating-linear-gradient(
      45deg,
      #2e2b22 0 14px,
      #333026 14px 28px
    );
  background-color: #2e2b22;
  min-height: 100vh;
}

/* faint oversized suits watermark */
body::before {
  content: "♣ ♦ ♥ ♠";
  position: fixed;
  inset: auto 0 -26px 0;
  text-align: center;
  font-size: clamp(80px, 18vw, 200px);
  letter-spacing: 0.15em;
  color: rgba(201, 169, 89, 0.08);
  pointer-events: none;
  z-index: 0;
}

header, main, footer { position: relative; z-index: 1; }

header {
  text-align: center;
  margin: 26px auto 6px;
  max-width: 720px;
  color: var(--paper);
}

header::before {
  content: "♣  ♦  ♥  ♠";
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--gold-light);
  margin-bottom: 8px;
}

header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #f7efda;
  text-shadow: 0 2px 0 #1a1710, 0 4px 18px rgba(0, 0, 0, 0.6);
}

header h1::after {
  content: "";
  display: block;
  width: 180px;
  height: 2px;
  margin: 10px auto 8px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

.subtitle {
  margin: 0;
  font-style: italic;
  font-size: 1rem;
  color: #d8c9a3;
}

main {
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.7), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(138, 109, 43, 0.18), transparent 55%),
    linear-gradient(var(--paper), var(--paper-2));
  border: 1px solid var(--gold);
  outline: 4px double var(--paper-edge);
  outline-offset: -10px;
  border-radius: 10px;
  padding: 26px 22px 20px;
  margin-top: 18px;
  box-shadow: 0 12px 32px var(--felt-shadow), inset 0 0 60px rgba(138, 109, 43, 0.12);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  position: relative;
}

.card h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--ink);
}

.card h3 {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin: 18px 0 6px;
  color: var(--ink-soft);
}

label { font-size: 0.95rem; color: var(--ink-soft); }
label[for="player-input"], label[for="direction"], label[for="first-dealer"] {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  margin: 12px 0 6px;
  color: var(--ink);
}

.row { display: flex; gap: 8px; margin: 8px 0; align-items: center; flex-wrap: wrap; }
.space-between { justify-content: space-between; margin-top: 14px; }

input, select, button {
  font-family: inherit;
  font-size: 1rem;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--ticket);
  color: var(--ink);
}

input:focus, select:focus {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
}

#player-input { flex: 1; min-width: 160px; }

button {
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #6b5626;
  background: linear-gradient(#fdf6e0, #e9d6a8);
  box-shadow: 0 2px 0 #6b5626, 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

button:hover { filter: brightness(1.03); }
button:active { transform: translateY(2px); box-shadow: 0 0 0 #6b5626; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

button.primary {
  background: linear-gradient(#2f2a1e, #1c1912);
  color: #f3e6c6;
  border-color: #1c1912;
  box-shadow: 0 2px 0 var(--gold), 0 4px 14px rgba(0, 0, 0, 0.4);
}

button.danger-ghost {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  color: var(--red-suit);
  border-color: var(--red-suit);
}

ul, ol { padding-left: 20px; }

#player-list { list-style: none; padding: 0; margin: 10px 0; }
#player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(251, 244, 223, 0.7);
  border: 1px solid var(--line);
  border-left: 6px solid var(--black-suit);
  border-radius: 4px;
  padding: 7px 10px;
  margin: 6px 0;
  font-weight: 700;
}

#player-list li:nth-child(even) { border-left-color: var(--red-suit); }
#player-list button { padding: 2px 8px; box-shadow: none; }

.muted { color: var(--ink-soft); font-size: 0.88rem; font-style: italic; }
#deck-info { border-top: 1px dotted var(--line); padding-top: 8px; }

.warning {
  background: #f9e7b8;
  color: #5a3d08;
  border: 1px dashed #8a6d2b;
  border-radius: 6px;
  padding: 9px 11px;
  margin: 10px 0;
  font-size: 0.92rem;
  font-style: italic;
}

table { width: 100%; border-collapse: collapse; margin: 10px 0; background: rgba(251, 244, 223, 0.55); }
th, td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: center; }
thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  background: #2b2519;
  color: #efdfb8;
}
thead th:first-child { border-radius: 6px 0 0 0; }
thead th:last-child { border-radius: 0 6px 0 0; }
th:first-child, td:first-child { text-align: left; font-weight: 700; }
tfoot td {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--ink);
  background: rgba(138, 109, 43, 0.12);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

#round-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
#round-header h2 { border: none; padding: 0; }
#round-header h2::after { display: none; }
#round-meta { margin: 6px 0 0; }
#round-meta::before { content: "❧ "; color: var(--gold); }
#round-nav { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; }
#round-nav button { box-shadow: none; padding: 6px 10px; }

#round-body input { width: 64px; text-align: center; font-weight: 700; }
#round-body tr:nth-child(odd) { background: rgba(138, 109, 43, 0.08); }

#first-dealer { width: 100%; }

.bid-order {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  font-size: 0.75rem;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0 4px;
  background: rgba(251, 244, 223, 0.9);
  color: var(--ink-soft);
  vertical-align: middle;
}

.dealer {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 6px;
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 1px 7px;
  background: #2b2519;
  color: #efdfb8;
  vertical-align: middle;
}

.leader { font-weight: 700; }
#score-body tr { cursor: pointer; }
#score-body tr:hover { background: rgba(158, 43, 37, 0.08); }

#final-list li {
  margin: 6px 0;
  font-size: 1.1rem;
}
#final-list li:first-child {
  font-weight: 700;
  font-size: 1.25rem;
}

footer.muted {
  max-width: 720px;
  margin: 14px auto 0;
  text-align: center;
  color: #cbbb92;
  font-size: 0.85rem;
  font-style: italic;
}

.hidden { display: none !important; }

@media (max-width: 520px) {
  .card { padding: 20px 14px 16px; }
  #round-header { flex-direction: column; }
  #round-body input { width: 56px; }
}
