:root {
  --felt: #0b3325;
  --felt-2: #13513a;
  --felt-3: #1a6748;
  --gold: #d7ad55;
  --gold-light: #f2d88f;
  --cream: #fff9eb;
  --paper: #fffdf7;
  --ink: #1d2622;
  --muted: #707a75;
  --red: #af3140;
  --line: #e6ddca;
  --panel: rgba(255, 251, 240, 0.985);
  --shadow: 0 18px 46px rgba(2, 20, 13, 0.28);
  --soft-shadow: 0 9px 26px rgba(2, 20, 13, 0.18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--felt); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { -webkit-user-select: none; user-select: none; }
body.modal-open { overflow: hidden; }

.felt-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 17% 8%, rgba(255,255,255,.07), transparent 27%),
    radial-gradient(circle at 86% 20%, rgba(215,173,85,.09), transparent 27%),
    radial-gradient(circle at 50% 100%, rgba(26,103,72,.55), transparent 45%),
    linear-gradient(145deg, var(--felt-2), var(--felt));
}
.felt-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    repeating-linear-gradient(40deg, transparent 0 4px, rgba(255,255,255,.025) 4px 5px),
    repeating-linear-gradient(-40deg, transparent 0 8px, rgba(0,0,0,.025) 8px 9px);
}

.app-shell {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 15px calc(20px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  text-align: left;
  cursor: pointer;
}
.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 57px;
  height: 61px;
}
.brand-card {
  position: absolute;
  width: 40px;
  height: 53px;
  overflow: hidden;
  border: 1px solid rgba(215,173,85,.8);
  border-radius: 10px;
  background: linear-gradient(145deg, #fffef9, #f7e9c5);
  box-shadow: 0 8px 18px rgba(2,20,13,.27);
}
.brand-card-back {
  left: 2px;
  top: 6px;
  display: grid;
  place-items: center;
  color: var(--red);
  background:
    repeating-linear-gradient(45deg, rgba(175,49,64,.09) 0 3px, transparent 3px 7px),
    linear-gradient(145deg, #fffdf8, #f1dfb3);
  font-family: Georgia, serif;
  font-size: 24px;
  transform: rotate(-11deg);
}
.brand-card-front {
  right: 1px;
  top: 1px;
  color: #10251c;
  transform: rotate(5deg);
}
.brand-card-front::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(215,173,85,.55);
  border-radius: 7px;
}
.brand-rank {
  position: absolute;
  z-index: 1;
  left: 7px;
  top: 4px;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 900;
}
.brand-suit {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 6px;
  color: var(--felt);
  font-family: Georgia, serif;
  font-size: 25px;
  text-shadow: 0 1px 0 white;
}
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong {
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 4.8vw, 27px);
  white-space: nowrap;
}
.brand-copy small { margin-top: 2px; font-size: 11px; opacity: .72; }

.icon-btn,
.ghost-btn,
.small-outline-btn,
.modal-close {
  cursor: pointer;
}
.icon-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242,216,143,.3);
  border-radius: 15px;
  color: var(--gold-light);
  background: rgba(255,255,255,.09);
  font-size: 22px;
  backdrop-filter: blur(8px);
}
.icon-btn svg { width: 25px; height: 25px; display: block; fill: currentColor; }

.screen { display: none; }
.screen.active { display: block; animation: rise .24s ease both; }

.hero-card,
.panel,
.round-panel,
.player-score-card {
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 245px;
  padding: 33px 22px 28px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(215,173,85,.2), transparent 35%),
    linear-gradient(145deg, #fffef9, #fff5dc);
  border: 1px solid rgba(215,173,85,.5);
}
.hero-card::before,
.hero-card::after {
  position: absolute;
  font-family: Georgia, serif;
  font-size: 145px;
  font-weight: 700;
  opacity: .045;
}
.hero-card::before { content: "♠"; left: -28px; bottom: -56px; transform: rotate(-14deg); }
.hero-card::after { content: "♥"; right: -25px; top: -55px; color: var(--red); transform: rotate(16deg); }
.hero-card h1 {
  margin: 9px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 8.4vw, 48px);
  line-height: 1.01;
  letter-spacing: -.03em;
}
.hero-card > p:last-child { max-width: 510px; margin: 0 auto; color: var(--muted); line-height: 1.5; }
.eyebrow {
  margin: 0;
  color: #8f6a25;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}
.eyebrow.dark { color: #8a6828; }

.mini-deck { height: 54px; margin-bottom: 4px; position: relative; display: flex; justify-content: center; }
.mini-card {
  position: absolute;
  width: 39px;
  height: 50px;
  padding: 5px;
  border: 1px solid #cfbf9e;
  border-radius: 8px;
  background: white;
  font-family: Georgia, serif;
  font-size: 20px;
  box-shadow: 0 6px 13px rgba(36,30,19,.13);
}
.mini-card.red { color: var(--red); }
.mini-card.c1 { transform: translateX(-42px) rotate(-18deg); }
.mini-card.c2 { transform: translateX(-14px) rotate(-6deg); }
.mini-card.c3 { transform: translateX(14px) rotate(6deg); }
.mini-card.c4 { transform: translateX(42px) rotate(18deg); }

.resume-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid rgba(242,216,143,.32);
  border-radius: 19px;
  color: var(--cream);
  background: rgba(255,255,255,.09);
  box-shadow: var(--soft-shadow);
  text-align: left;
  cursor: pointer;
}
.resume-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--felt);
  background: var(--gold-light);
  font-size: 20px;
  font-weight: 900;
}
.resume-card strong, .resume-card small { display: block; }
.resume-card small { margin-top: 3px; opacity: .68; }
.resume-arrow { font-size: 22px; color: var(--gold-light); }

.panel,
.round-panel {
  margin: 14px 0;
  padding: 18px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid rgba(215,173,85,.34);
}
.panel-title-row,
.round-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title-row > div { display: flex; align-items: center; gap: 9px; }
.panel h2,
.round-panel h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.panel-hint { max-width: 180px; color: var(--muted); font-size: 10px; text-align: right; line-height: 1.3; }
.step-pill {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--felt);
  background: #f0dfb3;
  font-size: 12px;
  font-weight: 900;
}

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segment {
  min-height: 49px;
  padding: 9px 6px;
  border: 1px solid #dedfd8;
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s ease;
}
.segment strong, .segment small { display: block; }
.segment strong { font-size: 17px; }
.segment small { margin-top: 1px; font-size: 9px; opacity: .65; }
.segment.active {
  color: var(--cream);
  border-color: var(--felt-2);
  background: linear-gradient(145deg, var(--felt-3), var(--felt));
  box-shadow: inset 0 0 0 1px rgba(242,216,143,.2), 0 6px 15px rgba(11,51,37,.14);
}
.segment.active small { opacity: .75; }

.player-inputs { display: grid; gap: 10px; }
.player-name-row {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 10px;
  align-items: center;
}
.player-suit {
  width: 41px;
  height: 47px;
  display: grid;
  place-items: center;
  border: 1px solid #d8c9aa;
  border-radius: 9px;
  background: white;
  color: #202522;
  font-family: Georgia, serif;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(25,30,27,.08);
}
.player-suit.red { color: var(--red); }
.player-input,
.round-score-input {
  width: 100%;
  border: 1px solid #d7dcd8;
  outline: none;
  color: var(--ink);
  background: white;
}
.player-input {
  min-height: 49px;
  padding: 12px 14px;
  border-radius: 12px;
}
.player-input:focus,
.round-score-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215,173,85,.17); }

.primary-btn,
.secondary-btn,
.secondary-light-btn,
.danger-outline-btn,
.danger-outline-on-dark {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.primary-btn:active,
.secondary-btn:active,
.secondary-light-btn:active,
.danger-outline-on-dark:active { transform: scale(.986); }
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  color: #173324;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 10px 23px rgba(215,173,85,.18);
}
.big-btn { min-height: 57px; font-size: 15px; }
.secondary-btn {
  border: 1px solid rgba(255,255,255,.2);
  color: var(--cream);
  background: rgba(255,255,255,.09);
}
.secondary-light-btn {
  border: 1px solid #ded5c4;
  color: var(--ink);
  background: #f4eee2;
}
.danger-outline-on-dark {
  border: 1px solid rgba(255,166,174,.34);
  color: #ffd6da;
  background: rgba(126,27,39,.12);
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.danger-outline-btn {
  margin-top: 17px;
  border: 1px solid #d8a7ad;
  color: #982c38;
  background: transparent;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ghost-btn {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  color: var(--cream);
  background: rgba(255,255,255,.08);
}
.toolbar-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.round-badge,
.target-badge {
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}
.round-badge { color: var(--cream); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); }
.target-badge { color: var(--gold-light); background: rgba(215,173,85,.08); border: 1px solid rgba(215,173,85,.29); }

.leader-banner {
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(242,216,143,.25);
  border-radius: 14px;
  color: #f9e9bd;
  background: rgba(255,255,255,.065);
  font-size: 12px;
  text-align: center;
}

.score-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-score-card {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 135px;
  padding: 15px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffefa, #fbf5e8);
  border: 1px solid rgba(215,173,85,.34);
}
.player-score-card::after {
  content: attr(data-suit);
  position: absolute;
  right: -7px;
  bottom: -22px;
  font-family: Georgia, serif;
  font-size: 86px;
  opacity: .045;
}
.player-score-card.red-card::after { color: var(--red); }
.score-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.score-name .suit { font-family: Georgia, serif; font-size: 20px; }
.score-name .suit.red { color: var(--red); }
.score-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.score-total {
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 8vw, 45px);
  line-height: 1;
  font-weight: 700;
  color: var(--felt);
}
.score-meta { margin-top: 6px; color: var(--muted); font-size: 10px; }
.progress-wrap {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 11px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e7e8e2;
  appearance: none;
  -webkit-appearance: none;
}
.progress-wrap::-webkit-progress-bar { border-radius: 999px; background: #e7e8e2; }
.progress-wrap::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--felt-3), var(--gold)); }
.progress-wrap::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--felt-3), var(--gold)); }

.round-panel { margin-top: 13px; }
.round-panel-head { align-items: center; margin-bottom: 7px; }
.round-panel-tools { display: grid; justify-items: end; gap: 7px; }
.round-notes-row {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 12px;
}
.round-dealer-badge {
  max-width: 250px;
  padding: 7px 10px;
  border: 1px solid #d8c489;
  border-radius: 999px;
  color: #173324;
  background: #f8e9bd;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.round-dealer-badge strong { color: #7e1b27; }
.round-draft-label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.round-draft {
  width: 100%;
  min-height: 62px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid #d7dcd8;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
}
.round-draft:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215,173,85,.17); }
.round-draft-label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.round-panel .eyebrow { margin-bottom: 3px; }
.round-panel h2 { font-size: 24px; }
.round-help { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.small-outline-btn {
  padding: 8px 10px;
  border: 1px solid #d5c8ad;
  border-radius: 10px;
  color: #67512a;
  background: #fffaf0;
  font-size: 11px;
  font-weight: 800;
}
.round-inputs { display: grid; gap: 9px; margin-bottom: 14px; }
.round-input-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(112px, 145px);
  gap: 12px;
  align-items: center;
}
.round-player-name { display: flex; align-items: center; min-width: 0; gap: 7px; font-size: 13px; font-weight: 800; }
.round-player-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-total-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #d8c489;
  border-radius: 999px;
  color: #fff9eb;
  background: var(--felt-2);
  box-shadow: 0 2px 7px rgba(11,51,37,.15);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.score-field {
  position: relative;
}
.round-score-input {
  width: 100%;
  height: 48px;
  padding: 9px 37px 9px 10px;
  border-radius: 12px;
  font-size: 19px;
  text-align: right;
  font-weight: 800;
}
.score-unit {
  position: absolute;
  right: 11px;
  top: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  transform: translateY(-50%);
}

.dealer-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-bottom: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(242,216,143,.32);
  border-radius: 15px;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(215,173,85,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.dealer-banner strong { margin-left: 5px; color: white; }

.game-actions { display: grid; gap: 9px; margin-top: 13px; }
.game-actions button:disabled,
#validateRoundBtn:disabled { opacity: .48; cursor: not-allowed; }

.signature {
  padding: 28px 0 4px;
  text-align: center;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 16px;
}
.signature-brand { opacity: .9; }
.signature-brand span:first-child { color: var(--cream); }
.signature-brand span:last-child { color: #f0909a; }
.signature-brand small { margin-left: 4px; font-family: inherit; font-size: 10px; font-style: normal; opacity: .62; }
.privacy-link {
  display: inline-block;
  margin-top: 9px;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-style: normal;
  opacity: .72;
  text-underline-offset: 3px;
}

.privacy-page .topbar { margin-bottom: 24px; }
.privacy-page .brand { text-decoration: none; }
.privacy-panel {
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid rgba(215,173,85,.5);
  border-radius: 24px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.privacy-panel h1,
.privacy-panel h2 { font-family: Georgia, "Times New Roman", serif; }
.privacy-panel h1 { margin: 6px 0 10px; font-size: clamp(30px, 7vw, 46px); line-height: 1.05; }
.privacy-panel h2 { margin: 27px 0 8px; font-size: 21px; }
.privacy-panel p,
.privacy-panel li { color: #56605b; line-height: 1.62; }
.privacy-panel ul { padding-left: 22px; }
.privacy-panel a { color: #0c5b3e; font-weight: 800; text-underline-offset: 3px; }
.privacy-updated { margin-top: 28px; font-size: 12px; }

.hidden { display: none !important; }

.modal {
  width: min(92vw, 610px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}
.modal::backdrop { background: rgba(2,17,11,.78); backdrop-filter: blur(5px); }
.modal-card {
  max-height: 88vh;
  overflow: auto;
  padding: 21px;
  border: 1px solid rgba(215,173,85,.45);
  border-radius: 24px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-header h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; }
.modal-header p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.modal-close {
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  border: 1px solid #ded5c5;
  border-radius: 11px;
  color: var(--ink);
  background: #f1eadc;
}
.modal-actions { display: grid; gap: 9px; margin-top: 18px; }
.modal-actions.two-cols { grid-template-columns: 1fr 1fr; }

.stats-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 17px 0 10px; }
.stat-box { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.stat-box strong { display: block; color: var(--felt); font-size: 24px; }
.stat-box span { color: var(--muted); font-size: 10px; }
.table-scroll { overflow-x: auto; }
.stats-table,
.history-table {
  width: 100%;
  margin-top: 13px;
  border-collapse: collapse;
  font-size: 12px;
}
.stats-table th,
.stats-table td,
.history-table th,
.history-table td { padding: 10px 7px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.stats-table th,
.history-table th { color: var(--muted); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.stats-table th:not(:first-child), .stats-table td:not(:first-child),
.history-table th:not(:first-child), .history-table td:not(:first-child) { text-align: right; }
.rank-medal { display: inline-grid; width: 23px; height: 23px; margin-right: 5px; place-items: center; border-radius: 50%; background: #eee7d7; font-size: 10px; font-weight: 900; }
.recent-title { margin: 20px 0 6px; font-family: Georgia, serif; font-size: 18px; }
.recent-list { display: grid; gap: 7px; }
.recent-game { display: flex; justify-content: space-between; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 11px; }
.recent-game span:last-child { color: var(--muted); }
.empty-state { padding: 27px 8px 15px; color: var(--muted); text-align: center; font-size: 13px; }

.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: auto;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 15px max(18px, env(safe-area-inset-bottom));
  background: rgba(2,17,11,.82);
  backdrop-filter: blur(5px);
}
.winner-overlay .winner-card {
  width: min(100%, 610px);
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.winner-card { position: relative; z-index: 2; text-align: center; }
.winner-crown { font-size: 54px; color: #b98428; line-height: 1; }
.winner-card h2 { margin: 5px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; }
.winner-card > p:not(.eyebrow) { margin: 0 auto; max-width: 430px; color: var(--muted); }
.winner-podium { display: grid; gap: 6px; margin-top: 17px; text-align: left; }
.podium-row { display: grid; grid-template-columns: 27px 1fr auto; gap: 8px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 12px; }
.podium-row:first-child { border-color: #d9bd78; background: #fff8e4; }
.podium-place { font-weight: 900; color: #846521; }
.podium-score { font-weight: 900; color: var(--felt); }

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -12vh;
  width: var(--size);
  height: calc(var(--size) * 1.65);
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--duration) var(--delay) cubic-bezier(.18,.72,.28,1) forwards;
}
.confetti-color-0 { background: #d7ad55; }
.confetti-color-1 { background: #f2d88f; }
.confetti-color-2 { background: #af3140; }
.confetti-color-3 { background: #1a6748; }
.confetti-color-4 { background: #fff9eb; }
.confetti-size-0 { --size: 6px; }
.confetti-size-1 { --size: 8px; }
.confetti-size-2 { --size: 10px; }
.confetti-size-3 { --size: 12px; }
.confetti-speed-0 { --duration: 2.6s; }
.confetti-speed-1 { --duration: 3.1s; }
.confetti-speed-2 { --duration: 3.6s; }
.confetti-speed-3 { --duration: 4.1s; }
.confetti-delay-0 { --delay: 0s; }
.confetti-delay-1 { --delay: .12s; }
.confetti-delay-2 { --delay: .24s; }
.confetti-delay-3 { --delay: .36s; }
.confetti-delay-4 { --delay: .48s; }
.confetti-delay-5 { --delay: .6s; }
.confetti-track-0 { left: 3%; --drift: 72px; --spin: 720deg; }
.confetti-track-1 { left: 11%; --drift: -54px; --spin: 910deg; }
.confetti-track-2 { left: 19%; --drift: 88px; --spin: 580deg; }
.confetti-track-3 { left: 28%; --drift: -76px; --spin: 1030deg; }
.confetti-track-4 { left: 37%; --drift: 45px; --spin: 840deg; }
.confetti-track-5 { left: 46%; --drift: -92px; --spin: 640deg; }
.confetti-track-6 { left: 55%; --drift: 81px; --spin: 1080deg; }
.confetti-track-7 { left: 64%; --drift: -47px; --spin: 760deg; }
.confetti-track-8 { left: 73%; --drift: 64px; --spin: 940deg; }
.confetti-track-9 { left: 82%; --drift: -83px; --spin: 610deg; }
.confetti-track-10 { left: 90%; --drift: 51px; --spin: 1000deg; }
.confetti-track-11 { left: 97%; --drift: -69px; --spin: 820deg; }

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, -5vh, 0) rotate(0deg); }
  100% { opacity: .92; transform: translate3d(var(--drift), 118vh, 0) rotate(var(--spin)); }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece { animation: none; }
}

.dealer-prompt-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 13px;
  margin-bottom: 11px;
  padding: 16px;
  border: 2px solid #d9bd78;
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf7, #f5e5bd);
  box-shadow: var(--soft-shadow);
  overscroll-behavior: contain;
  touch-action: manipulation;
}
.dealer-prompt-copy { min-width: 0; }
.dealer-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0;
  place-items: center;
  border: 2px solid #d9bd78;
  border-radius: 17px;
  color: var(--felt);
  background: linear-gradient(145deg, #fff, #f2ddb0);
  box-shadow: 0 8px 18px rgba(23,38,31,.14);
  font-family: Georgia, serif;
  font-size: 31px;
  transform: rotate(-4deg);
}
.dealer-prompt-panel h2 { margin: 3px 0 5px; font-family: Georgia, serif; font-size: 23px; }
.dealer-prompt-panel p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dealer-options { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.dealer-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d9cfbb;
  border-radius: 13px;
  color: var(--ink);
  background: white;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.dealer-option .suit { flex: 0 0 auto; font-family: Georgia, serif; font-size: 21px; }
.dealer-option .suit.red { color: var(--red); }
.dealer-option:disabled { opacity: .38; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 30px);
  padding: 11px 15px;
  border: 1px solid rgba(242,216,143,.22);
  border-radius: 999px;
  color: white;
  background: #10251c;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: .2s ease;
  text-align: center;
  font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 680px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
  .hero-card { padding-top: 38px; padding-bottom: 34px; }
  .score-board[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-board[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .round-input-row { grid-template-columns: minmax(160px, 1fr) 160px; }
}

@media (max-width: 430px) {
  .brand-copy small { display: none; }
  .panel-hint { display: none; }
  .segmented { gap: 6px; }
  .segment { font-size: 12px; }
  .round-input-row { grid-template-columns: minmax(88px, 1fr) minmax(108px, 132px); }
  .round-panel-head { align-items: flex-start; }
  .round-panel-tools { max-width: 58%; }
  .round-dealer-badge { line-height: 1.25; }
  .dealer-options { grid-template-columns: 1fr; }
  .dealer-prompt-panel { grid-template-columns: 48px minmax(0, 1fr); padding: 13px; }
  .dealer-symbol { width: 48px; height: 48px; font-size: 26px; }
}

/* Publisher logo shown at each fresh application opening. */
.launch-splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: #fffdf7;
  color: #1d2622;
}
.launch-splash[hidden] { display: none; }
.launch-splash img { display: block; width: min(100%, 520px); height: auto; max-height: 65vh; object-fit: contain; }
.launch-splash p { margin: 0; font-size: clamp(18px, 4vw, 26px); font-weight: 750; text-align: center; }
.brand-copy strong { font-size: clamp(15px, 4vw, 23px); }
