/*
 * The public pages: the landing page (pages/home and its two example
 * partials), the rules pages, the privacy statement and the terms.
 *
 * `stylesheet_link_tag :app` loads this file on every page, so every selector
 * carries its own prefix (landing-, legal-, rules-) and nothing defined in
 * application.css is restyled outside them. The error pages need nothing
 * beyond the design system.
 */

/* ── Shared ─────────────────────────────────────────────────────────────── */

.landing-nowrap { white-space: nowrap; }

/* An anchor link lands on its section below the sticky header through the
   scroll-margin-top application.css gives everything outside a sticky bar,
   which keeps a focused field out from under the header as well. No
   scroll-margin of its own here: it would override that one, and drift
   from the header's height as the header changes. */

/* Titles one level below a section's h3. They read as card titles, set like
   the design system's h3 rather than its small uppercase h4 label. */
.landing-card-title {
  margin: 0 0 0.6rem;
  font-family: var(--f-serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--c-text);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3.5rem;
  align-items: center;
}
.landing-hero .hero-lead { margin-bottom: 2rem; }
.landing-note {
  margin: 1.4rem 0 0;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--c-text-dim);
}
@media (max-width: 960px) {
  .landing-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
}

/* ── Example scoreboard (pages/_hero_board, pages/_settle_mock) ─────────── */

/* Drawn after the real scoreboard (the chinezen-* rules in application.css)
   but with its own classes: the real table's sticky cells, scroll caps and
   mobile tab rules would all fight a picture that never scrolls. */
.landing-mock {
  position: relative;
  overflow: hidden;
  padding: 1.2rem 1.2rem 1.3rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  box-shadow: var(--shadow-soft);
}
.landing-mock::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  opacity: 0.45;
}

.landing-mock-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 1rem;
  margin-bottom: 0.9rem;
}
.landing-mock-title {
  font-family: var(--f-serif);
  font-size: 1.4rem;
  color: var(--c-text);
}
.landing-mock-meta {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.landing-mock-live { color: var(--c-accent); }
.landing-mock-live::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--c-success);
  vertical-align: 0.1em;
  animation: landing-pulse 2.4s ease-in-out infinite;
}
@keyframes landing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.landing-mock-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--f-mono);
  font-size: 0.8rem;
}
.landing-mock-table th,
.landing-mock-table td {
  padding: 0.42rem 0.55rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-border);
}
.landing-mock-table th {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.landing-mock-table .landing-mock-num,
.landing-mock-table .landing-mock-swap {
  text-align: center;
  color: var(--c-text-dim);
}
.landing-mock-table .landing-mock-dealer { text-align: left; }
.landing-mock-table td.landing-mock-dealer {
  font-family: var(--f-sans);
  color: var(--c-text);
}
.landing-mock-table .pos { color: var(--c-success); }
.landing-mock-table .neg { color: var(--c-danger); }
/* The dealer's own cell, marked the way the real board marks it. */
.landing-mock-table td.is-dealer {
  background: var(--c-accent-wash);
  box-shadow: inset 2px 0 0 var(--c-accent);
}
/* The misdeal, as the real board shows one: struck through, in the faintest
   text, rather than faded. */
.landing-mock-table tr.is-void td {
  color: var(--c-text-faint);
  text-decoration: line-through;
}
.landing-mock-table tr.is-void td.landing-mock-dealer {
  color: var(--c-text-dim);
  text-decoration: none;
}
.landing-mock-table tfoot td {
  border-top: 1px solid var(--c-border-strong);
  border-bottom: 0;
  font-weight: 500;
}
.landing-mock-flag {
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-danger);
  border: 1px solid var(--c-danger-line);
  border-radius: var(--r-sm);
}

/* The round being filled in. */
.landing-mock-round {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}
.landing-mock-round-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.landing-mock-pill {
  padding: 0.12rem 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
}
.landing-mock-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.landing-mock-scores li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.38rem 0.6rem;
  font-size: 0.86rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-3);
}
.landing-mock-scores li > span + span { font-family: var(--f-mono); }
.landing-mock-scores li.is-mine {
  border-color: var(--c-accent-line);
  background: var(--c-accent-wash);
}
.landing-mock-scores .pos { color: var(--c-success); }
.landing-mock-scores .neg { color: var(--c-danger); }
.landing-mock-waiting { color: var(--c-text-faint); }
.landing-mock-sum {
  margin: 0.7rem 0 0;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--c-text-dim);
}
.landing-mock-voice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0.4rem 0.9rem;
  font-family: var(--f-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--c-accent-2);
  border: 1px solid var(--c-border-strong);
  border-radius: 999px;
}

/* Settling up: the trend chart and the payments. One custom property per
   player carries the line colour to the polyline, its end dot and the legend
   swatch; the colours are the scoreboard chart's (--c-series-*). */
.landing-trend-1 { --landing-series: var(--c-series-1); }
.landing-trend-2 { --landing-series: var(--c-series-2); }
.landing-trend-3 { --landing-series: var(--c-series-3); }
.landing-trend-4 { --landing-series: var(--c-series-4); }

.landing-trend {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.1rem 0 0.5rem;
}
.landing-trend-zero {
  stroke: var(--c-border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.landing-trend-line {
  fill: none;
  stroke: var(--landing-series);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.landing-trend-end { fill: var(--landing-series); }

.landing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
}
.landing-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.landing-legend .pos { color: var(--c-success); }
.landing-legend .neg { color: var(--c-danger); }
.landing-legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--landing-series);
}

.landing-settle-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.landing-settle-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.8rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--c-border);
}
.landing-settle-from,
.landing-settle-to {
  font-family: var(--f-serif);
  font-size: 1.15rem;
}
.landing-settle-from { text-align: right; color: var(--c-danger); }
.landing-settle-to { color: var(--c-success); }
.landing-settle-arrow { color: var(--c-text-faint); }
.landing-settle-amt {
  font-family: var(--f-mono);
  font-size: 0.9rem;
  text-align: right;
  color: var(--c-accent);
}
.landing-settle-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.landing-chip {
  padding: 0.28rem 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
}
.landing-chip.is-solid {
  color: var(--c-on-accent);
  background: var(--c-accent);
  border-color: var(--c-accent);
}

@media (max-width: 560px) {
  .landing-mock { padding: 1rem 0.85rem 1.1rem; }
  /* Five columns fit a 360px screen, seven do not. The dealer stays visible
     as the marked cell in each row. */
  .landing-mock-table .landing-mock-swap,
  .landing-mock-table .landing-mock-dealer { display: none; }
  .landing-mock-table th,
  .landing-mock-table td { padding: 0.4rem 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-mock-live::before { animation: none; }
}

/* ── Ribbon, steps, closing ornament ────────────────────────────────────── */

/* Cormorant's default old-style figures turn the ribbon's "0" into an "o"
   and its "1" into an "I"; figures that stand alone have to read as numbers.
   The price card follows suit, so the page writes its figures one way. */
.landing-ribbon .num,
.landing-price-amount { font-variant-numeric: lining-nums; }

.landing-steps .step p {
  max-width: 64ch;
  margin-bottom: 0;
}

.ornament.landing-suit {
  font-size: 1.1rem;
  letter-spacing: 0;
}

/* ── Features ───────────────────────────────────────────────────────────── */

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 3rem;
  align-items: start;
}
.landing-feature {
  padding: 1.4rem 0;
  border-top: 1px solid var(--c-border);
}
.landing-feature:last-child { border-bottom: 1px solid var(--c-border); }
.landing-feature p { margin: 0; }
@media (max-width: 900px) {
  .landing-split { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  /* Read first, then see it. */
  .landing-split .landing-feature-list { order: -1; }
}

.landing-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (max-width: 1100px) {
  .landing-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .landing-grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Price ──────────────────────────────────────────────────────────────── */

.landing-pricing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.landing-price-amount {
  margin: 0.2rem 0 0.4rem;
  font-family: var(--f-serif);
  font-size: clamp(3rem, 6vw, 4.2rem);
  line-height: 1;
  white-space: nowrap;
  color: var(--c-accent);
}
.landing-price-unit {
  margin: 0 0 1.6rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.landing-price-cta { margin-top: 2rem; }
.landing-notes h3 { margin-bottom: 1rem; }
.landing-note-item {
  padding: 1.2rem 0;
  border-top: 1px solid var(--c-border);
}
.landing-note-item:last-child { border-bottom: 1px solid var(--c-border); }
.landing-note-item p { margin: 0; }
@media (max-width: 900px) {
  .landing-pricing { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
}

/* ── Questions ──────────────────────────────────────────────────────────── */

.landing-faq { max-width: 52rem; }
.landing-faq details { border-top: 1px solid var(--c-border); }
.landing-faq details:last-child { border-bottom: 1px solid var(--c-border); }
.landing-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-family: var(--f-serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--c-text);
  list-style: none;
  cursor: pointer;
  transition: color 150ms ease;
}
.landing-faq summary::-webkit-details-marker { display: none; }
.landing-faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--f-mono);
  font-size: 1.1rem;
  color: var(--c-accent);
}
.landing-faq details[open] > summary::after { content: "−"; }
.landing-faq summary:hover { color: var(--c-accent-2); }
.landing-faq summary:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}
.landing-faq-answer {
  max-width: 64ch;
  padding-bottom: 1.4rem;
}
.landing-faq-answer p { color: var(--c-text-dim); }
.landing-faq-answer p:last-child { margin-bottom: 0; }

/* ── Privacy statement and terms ────────────────────────────────────────── */

.hero.legal-hero { padding-bottom: 2.5rem; }
.legal-body { padding-bottom: 4rem; }
.legal { max-width: 46rem; }
.legal h2 {
  margin: 3rem 0 0.8rem;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}
.legal h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.3rem;
}
.legal-list {
  margin: 0 0 1em;
  padding-left: 1.2rem;
}
.legal-list li { margin-bottom: 0.55rem; }
.legal-list li::marker { color: var(--c-accent); }
.legal-summary {
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-2);
}
.legal .legal-summary h2 {
  margin-top: 0;
  font-size: 1.5rem;
}
.legal-processors { margin-bottom: 1em; }
@media (max-width: 600px) {
  .legal-summary { padding: 1.3rem 1.2rem; }
}

/* ── Rules pages ────────────────────────────────────────────────────────── */

/* The rules pages are long reads like the legal texts (.legal and its
   summary), with two things of their own: example hands and point tables. */

/* Their closing call to action follows the text closely: .legal-body's
   bottom padding and the ornament's margin are space enough. */
.rules-closing { padding-top: 0; }

/* An example hand, its rows as they lie on the table: the front on top.
   The hand's name goes under its cards, so five cards fit a phone. */
.rules-board {
  margin: 1.4rem 0 1.6rem;
  border-collapse: collapse;
}
.rules-board caption {
  caption-side: top;
  padding-bottom: 0.6rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--c-text-dim);
}
.rules-board th {
  padding: 0.85rem 1.2rem 0.5rem 0;
  vertical-align: top;
  text-align: left;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.rules-board td { padding: 0.5rem 0; }
.rules-cards {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.rules-card {
  min-width: 2.5rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  font-family: var(--f-mono);
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: center;
  color: var(--c-text);
}
.rules-card-red { color: var(--c-danger); }
.rules-hand-name {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--c-text-dim);
}

/* Points and royalties. The wrapper scrolls a table that is wider than a
   small phone instead of the page. */
.rules-table-wrap {
  margin: 1.4rem 0 1.6rem;
  overflow-x: auto;
}
/* A table of a few columns stays narrow, its points near their names. */
.rules-table-narrow { max-width: 30rem; }
.rules-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--c-border);
  background: var(--c-bg-2);
  font-size: 0.95rem;
}
.rules-table caption {
  caption-side: top;
  padding-bottom: 0.6rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--c-text-dim);
}
.rules-table th,
.rules-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
}
.rules-table tbody th { font-weight: 500; }
.rules-table thead th {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  background: var(--c-bg-3);
}
.rules-table .num {
  text-align: right;
  white-space: nowrap;
  font-family: var(--f-mono);
}
.rules-table tfoot th,
.rules-table tfoot td {
  border-top: 1px solid var(--c-border-strong);
  background: var(--c-bg-3);
}
/* On a phone the example's six columns fit the screen: tighter cells, and
   the heads' letter spacing taken back. */
@media (max-width: 600px) {
  .rules-table { font-size: 0.85rem; }
  .rules-table th,
  .rules-table td { padding: 0.5rem 0.4rem; }
  .rules-table thead th { letter-spacing: 0.06em; }
}
