:root {
  --page-bg: #e8ddc4;
  --felt-dark: #193f2d;
  --felt-mid: #23513a;
  --felt-light: #2f6848;
  --panel-border: #d6c8a8;
  --text-main: #2c2418;
  --text-soft: #655845;
  --accent: #b8872f;
  --card-red: #b02828;
  --card-black: #1f1f22;
  --shadow-soft: 0 16px 40px rgba(24, 27, 20, 0.12);
  --shadow-card: 0 8px 18px rgba(16, 22, 17, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 24%),
    linear-gradient(180deg, #efe5cf 0%, var(--page-bg) 60%, #dccda9 100%);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1400px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 18px 0 max(48px, env(safe-area-inset-bottom));
}

.hero {
  display: block;
  margin-bottom: 12px;
}

.hero-copy,
.hero-panel,
.intro-panel,
.status-bar,
.score-panel,
.hand-panel,
.content-panel,
.faq-panel {
  background: rgba(246, 239, 223, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  padding: 14px 18px;
}

.hero-panel,
.intro-panel,
.score-panel,
.hand-panel,
.content-panel,
.faq-panel {
  padding: 22px 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.88rem;
  font-weight: 700;
}

.crumb-link {
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.lead {
  max-width: 62ch;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-soft);
  margin: 0;
}

.guide-link-list {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--text-soft);
  line-height: 1.7;
}

.hero-intro {
  max-width: 76ch;
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.hero-trust li {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 241, 0.72);
  border: 1px solid #dfcfaa;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.2;
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  border: 0;
  padding: 14px 22px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(180deg, #d8ae53, #b8872f);
  color: #fff9ef;
  box-shadow: 0 8px 18px rgba(184, 135, 47, 0.28);
}

.secondary-button {
  background: #e7dcc2;
  color: var(--text-main);
  border: 1px solid #cfbf99;
}

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

.hero-panel h2 {
  margin-bottom: 14px;
}

.hero-panel ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text-soft);
  line-height: 1.7;
}

.intro-panel p,
.content-panel p,
.faq-panel p,
.hand-help {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.status-bar {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.status-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.status-group strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.25;
  min-height: 1.4em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.score-panel {
  margin-bottom: 12px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.score-card {
  border-radius: 18px;
  border: 1px solid #dbcba9;
  background: rgba(255, 250, 241, 0.74);
  padding: 14px;
}

.score-card.active {
  box-shadow: 0 0 0 3px rgba(184, 135, 47, 0.18);
  border-color: #cfa555;
}

.score-name {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.table-area {
  position: relative;
  min-height: 520px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, var(--felt-light), var(--felt-mid) 28%, var(--felt-dark));
  border-radius: 28px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--shadow-soft);
  border: 1px solid rgba(23, 52, 35, 0.4);
  margin-bottom: 12px;
}

.player-seat {
  position: absolute;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 251, 241, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f9f4ea;
  min-width: 170px;
}

.player-top {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.player-left {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.player-right {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.seat-name {
  margin: 0 0 6px;
  font-weight: 700;
}

.seat-meta {
  margin: 0;
  color: rgba(249, 244, 234, 0.88);
  font-size: 0.92rem;
  line-height: 1.5;
}

.seat-back-row {
  display: flex;
  gap: 3px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mini-card {
  width: 16px;
  height: 26px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 8px, rgba(255,255,255,0.04) 8px 16px),
    linear-gradient(180deg, #2c6a45 0%, #1c4d31 100%);
  border: 1px solid rgba(255,255,255,0.18);
}

.trick-zone {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 260px));
}

.zone-label {
  margin: 0 0 8px;
  color: rgba(255, 250, 239, 0.9);
  font-size: 0.94rem;
  text-align: center;
}

.trick-table {
  position: relative;
  min-height: 250px;
  border-radius: 22px;
  background: rgba(17, 39, 28, 0.25);
  border: 2px dashed rgba(255, 255, 255, 0.16);
}

.trick-card {
  position: absolute;
  width: 98px;
  height: 136px;
}

.trick-card.from-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.trick-card.from-right {
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.trick-card.from-bottom {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.trick-card.from-left {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
}

.trick-card .card {
  width: 100%;
  height: 100%;
}

.hand-panel {
  margin-bottom: 12px;
}

.hand-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.hand-help {
  margin: 0;
  max-width: 40ch;
}

.pass-help {
  margin: 10px 0 0;
  max-width: 40ch;
  color: var(--text-soft);
  line-height: 1.6;
}

.hand-actions {
  display: flex;
  align-items: flex-start;
}

.player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 961px) {
  .page-shell {
    width: min(1480px, calc(100vw - 48px));
    padding-top: 12px;
  }

  .hero {
    margin-bottom: 10px;
  }

  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 18px;
    align-items: center;
    padding: 12px 16px;
  }

  .hero-copy .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  h1 {
    font-size: clamp(1.55rem, 2.4vw, 2.05rem);
    margin-bottom: 0;
  }

  .hero-intro {
    grid-column: 1 / 2;
    margin: 0;
    font-size: 0.96rem;
  }

  .hero-actions {
    justify-content: flex-end;
    align-self: center;
  }

  .hero-trust {
    margin-top: 2px;
  }

  .primary-button,
  .secondary-button {
    padding: 12px 18px;
    font-size: 0.96rem;
  }

  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px 14px;
    align-items: start;
  }

  .status-bar,
  .seo-content,
  .round-overlay {
    grid-column: 1 / -1;
  }

  .status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 14px;
    margin-bottom: 0;
  }

  .status-group {
    flex: 1 1 170px;
    min-width: 0;
  }

  .status-label {
    font-size: 0.72rem;
  }

  .status-group strong {
    font-size: 1rem;
    min-height: 1.25em;
  }

  .score-panel {
    grid-column: 2;
    grid-row: 2 / span 2;
    margin-bottom: 0;
    padding: 14px 16px;
    position: sticky;
    top: 12px;
  }

  .score-panel h2 {
    font-size: 1.08rem;
    margin-bottom: 10px;
  }

  .scoreboard {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
  }

  .score-card {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .score-name {
    margin-bottom: 4px;
    font-size: 0.95rem;
  }

  .score-line {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .table-area {
    grid-column: 1;
    min-height: 400px;
    margin-bottom: 0;
    padding: 12px;
  }

  .player-seat {
    min-width: 128px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .player-top {
    top: 12px;
  }

  .player-left,
  .player-right {
    top: 47%;
  }

  .seat-name {
    margin-bottom: 4px;
    font-size: 0.94rem;
  }

  .seat-meta {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .seat-back-row {
    gap: 2px;
    margin-top: 6px;
  }

  .mini-card {
    width: 12px;
    height: 20px;
    border-radius: 5px;
  }

  .trick-zone {
    width: min(360px, calc(100% - 180px));
  }

  .zone-label {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }

  .trick-table {
    min-height: 180px;
    border-radius: 18px;
  }

  .trick-card {
    width: 78px;
    height: 112px;
  }

  .trick-card.from-top {
    top: 10px;
  }

  .trick-card.from-right {
    right: 10px;
  }

  .trick-card.from-bottom {
    bottom: 10px;
  }

  .trick-card.from-left {
    left: 10px;
  }

  .hand-panel {
    grid-column: 1;
    margin-bottom: 0;
    padding: 12px 14px;
  }

  .hand-heading {
    gap: 10px;
    margin-bottom: 10px;
  }

  .hand-panel h2 {
    font-size: 1.16rem;
  }

  .hand-help,
  .pass-help {
    max-width: none;
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .player-hand {
    gap: 8px;
  }

  .card {
    width: 76px;
    height: 112px;
    padding: 8px;
  }
}

.card {
  position: relative;
  width: 92px;
  height: 132px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(38, 31, 18, 0.2);
  background: linear-gradient(180deg, #fffefb 0%, #fbf7ef 100%);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-cardback {
  cursor: default;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 10px, rgba(255,255,255,0.04) 10px 20px),
    linear-gradient(180deg, #2c6a45 0%, #1c4d31 100%);
}

.card.playable {
  outline: 3px solid rgba(255, 232, 173, 0.2);
}

.card.playable:hover {
  transform: translateY(-4px);
}

.card.selected-pass {
  outline: 4px solid rgba(184, 135, 47, 0.72);
  transform: translateY(-8px);
}

.card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-weight: 700;
  font-size: 0.98rem;
}

.top-left {
  top: 10px;
  left: 10px;
}

.bottom-right {
  right: 10px;
  bottom: 10px;
  transform: rotate(180deg);
}

.card-center {
  font-size: 2rem;
}

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

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

.round-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 35, 25, 0.52);
  z-index: 50;
}

.round-overlay[hidden] {
  display: none;
}

.round-panel {
  width: min(520px, calc(100vw - 32px));
  padding: 30px 28px;
  text-align: center;
  background: rgba(248, 242, 227, 0.98);
  border: 1px solid #dbc89c;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(20, 28, 21, 0.28);
}

.win-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  font-weight: 700;
}

.round-summary {
  color: var(--text-soft);
  line-height: 1.7;
}

.player-seat.active-seat {
  box-shadow: 0 0 0 3px rgba(255, 232, 173, 0.2);
  border-color: rgba(255, 232, 173, 0.58);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.seo-content {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.content-panel h2 {
  font-size: 1.55rem;
  margin-bottom: 8px;
}

.faq-panel {
  margin-top: 0;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.faq-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 251, 243, 0.72);
  border: 1px solid #e4d6b7;
}

.faq-item h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

@media (max-width: 1100px) {
  .page-shell {
    width: min(100%, calc(100vw - 24px));
    padding: 20px 0 32px;
  }

  .hero {
    display: block;
  }

  .scoreboard,
  .content-grid,
  .faq-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trick-zone {
    width: min(420px, calc(100% - 220px));
  }
}

@media (max-width: 820px) {
  .status-bar,
  .scoreboard,
  .content-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }

  .table-area {
    min-height: 700px;
    padding-top: 120px;
    padding-bottom: 180px;
  }

  .player-top {
    top: 16px;
  }

  .player-left {
    left: 12px;
    top: 180px;
    transform: none;
  }

  .player-right {
    right: 12px;
    top: 180px;
    transform: none;
  }

  .trick-zone {
    inset: 310px auto auto 50%;
    width: min(380px, calc(100% - 24px));
  }

  .player-seat {
    min-width: 140px;
  }
}

@media (max-width: 720px) {
  main {
    display: flex;
    flex-direction: column;
  }

  .status-bar {
    order: 1;
  }

  .table-area {
    order: 2;
  }

  .hand-panel {
    order: 3;
  }

  .score-panel {
    order: 4;
  }

  .seo-content {
    order: 5;
  }

  .page-shell {
    width: min(100%, calc(100vw - 16px));
    padding: 12px 0 24px;
  }

  .hero-copy,
  .hero-panel,
  .intro-panel,
  .status-bar,
  .score-panel,
  .hand-panel,
  .content-panel,
  .faq-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .hero-intro {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .status-bar {
    gap: 8px;
    padding: 12px;
  }

  .status-group strong {
    min-height: 1.3em;
  }

  h1 {
    font-size: 1.7rem;
  }

  .hero-actions {
    gap: 8px;
  }

  .primary-button,
  .secondary-button {
    padding: 11px 16px;
    font-size: 0.96rem;
  }

  .score-panel h2,
  .hand-panel h2 {
    font-size: 1.3rem;
  }

  .score-panel {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .score-card {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .score-name {
    margin-bottom: 6px;
    font-size: 0.96rem;
  }

  .score-line {
    font-size: 0.84rem;
    gap: 8px;
  }

  .hand-heading {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  .hand-actions {
    width: 100%;
  }

  .hand-actions .secondary-button {
    width: 100%;
  }

  .player-hand {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-top: 0;
  }

  .card {
    width: 82px;
    height: 118px;
    flex: 0 0 auto;
  }

  .card-corner {
    font-size: 1.05rem;
  }

  .card-center {
    font-size: 1.35rem;
  }

  .table-area {
    min-height: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .player-seat,
  .player-top,
  .player-left,
  .player-right {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    padding: 7px 9px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .player-top {
    order: 1;
  }

  .trick-zone {
    position: static;
    inset: auto;
    transform: none;
    width: 100%;
    order: 4;
  }

  .player-right {
    order: 2;
  }

  .player-left {
    order: 3;
  }

  .seat-name {
    margin-bottom: 0;
    font-size: 0.9rem;
  }

  .seat-meta {
    margin-left: auto;
    text-align: right;
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .seat-back-row {
    display: none;
  }

  .status-group strong {
    min-height: 1.3em;
  }

  .trick-table {
    min-height: 176px;
    border-radius: 18px;
  }

  .trick-card {
    width: 68px;
    height: 98px;
  }

  .trick-card.from-top {
    top: 8px;
  }

  .trick-card.from-right {
    right: 8px;
  }

  .trick-card.from-bottom {
    bottom: 8px;
  }

  .trick-card.from-left {
    left: 8px;
  }

  .zone-label {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }
}

@media (max-width: 600px) {
  .status-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 12px;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    align-items: stretch;
  }

  .status-bar .status-group {
    flex: 1 1 0;
    min-width: 0;
    min-height: auto;
    gap: 3px;
  }

  .status-bar .status-label {
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    line-height: 1.1;
  }

  .status-bar .status-group strong {
    min-height: auto;
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .score-panel {
    padding: 6px 12px;
  }

  .score-panel h2 {
    display: none;
  }

  .score-panel .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
    margin-top: 0;
  }

  .score-panel .score-card {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .score-panel .score-name {
    margin-bottom: 2px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .score-panel .score-line {
    margin: 0 !important;
    justify-content: center;
    gap: 4px;
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .score-panel .score-line span {
    display: none;
  }

  .hand-panel {
    padding: 8px 12px;
  }

  .hand-panel .hand-heading {
    gap: 4px;
    margin-bottom: 4px;
  }

  .hand-panel .hand-heading h2 {
    font-size: 0.95rem;
    margin: 0;
  }

  .hand-panel .hand-heading .hand-help {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.8;
  }

  .hand-panel .pass-help {
    font-size: 0.75rem;
    margin: 2px 0 !important;
    line-height: 1.25;
  }

  .hand-panel .hand-actions {
    margin-top: 4px;
    gap: 4px;
  }

  .hand-panel .hand-actions button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 420px) {
  .hero-copy,
  .hero-panel,
  .intro-panel,
  .status-bar,
  .score-panel,
  .hand-panel,
  .content-panel,
  .faq-panel {
    padding: 14px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .scoreboard {
    gap: 6px;
  }

  .score-card {
    padding: 9px 10px;
  }

  .score-name {
    font-size: 0.9rem;
  }

  .score-line {
    font-size: 0.8rem;
  }

  .status-bar {
    gap: 8px;
    padding: 12px 14px;
  }

  .status-bar .status-label {
    display: none;
  }

  .status-bar .status-group strong {
    font-size: 1rem;
  }

  .table-area {
    padding: 10px;
  }

  .player-seat,
  .player-top,
  .player-left,
  .player-right {
    padding: 6px 8px;
    gap: 8px;
  }

  .seat-name {
    font-size: 0.84rem;
  }

  .seat-meta {
    font-size: 0.7rem;
  }

  .trick-table {
    min-height: 160px;
  }

  .trick-card {
    width: 60px;
    height: 88px;
  }
}
