/* Belote et Rebelote — marketing page.
   Palette: bistro-night — deep emerald felt, warm amber, French tricolor. */

:root {
  --felt: #0b3d2e;
  --felt-deep: #072820;
  --felt-alt: #0e4734;
  --amber: #e7b24b;
  --amber-soft: #f3d08a;
  --cream: #f5efe2;
  --ink: #0a1f18;
  --blue: #0055A4;
  --white: #ffffff;
  --red: #EF4135;
  --muted: rgba(245, 239, 226, 0.72);
  --line: rgba(245, 239, 226, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--felt);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- language toggle ---------- */
.lang-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  gap: 2px;
  background: rgba(7, 40, 32, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-toggle button.active {
  background: var(--amber);
  color: var(--ink);
}

/* ---------- shared ---------- */
.title {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow:
    -1.5px -1.5px 0 rgba(0,0,0,.55),
     1.5px -1.5px 0 rgba(0,0,0,.55),
    -1.5px  1.5px 0 rgba(0,0,0,.55),
     1.5px  1.5px 0 rgba(0,0,0,.55),
     0 6px 20px rgba(0,0,0,.45);
}
.title .t-blue  { color: #4d8fd6; }
.title .t-white { color: #ffffff; }
.title .t-red   { color: #f06a60; }
.title.small { font-size: 1.6rem; }

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 20px;
}
.section-alt { background: var(--felt-deep); max-width: none; }
.section-alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 88px 20px 72px;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--felt-alt) 0%, var(--felt) 45%, var(--felt-deep) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.app-icon {
  width: 120px; height: 120px;
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
  margin-bottom: 26px;
}
.hero .title { font-size: clamp(2.6rem, 9vw, 4.5rem); margin: 0; line-height: 0; }
/* Generated gold-shield wordmark (Scenario) replacing the text title. */
.title-logo {
  display: block;
  margin: 0 auto;
  width: min(560px, 88vw);
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.5));
}
.tagline {
  margin-top: 18px;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--amber-soft);
  font-weight: 500;
}
/* --- Hero video (2026-08-16) ------------------------------------
   Phone-shaped, capped by viewport height so it never pushes the App
   Store badge below the fold on a laptop — the badge is the point of
   the page, the video is the hook. 9:19.5-ish portrait matches the
   886x1920 source, and aspect-ratio reserves the box before the file
   loads so the hero does not reflow (CLS). */
.hero-video {
  margin: 26px auto 0;
  /* Narrow screens: deliberately modest. Measured on a 390x844 iPhone
     viewport, a 240px-wide video pushed the App Store badge to y=921 —
     below the fold. The badge is the conversion point and was above the
     fold before this video existed; regressing that to show a bigger
     preview would be a bad trade. Desktop gets the larger treatment via
     the two-column rule below. */
  width: min(168px, 44vw);
  max-width: 100%;
}
.hero-video__el {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 444 / 961;
  max-height: 58vh;
  object-fit: cover;
  border-radius: 22px;
  background: #1a0d0a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
/* Reduced motion: the script swaps in controls, so give them room and
   stop the frame being clipped by object-fit. */
@media (prefers-reduced-motion: reduce) {
  .hero-video__el { object-fit: contain; }
}

/* Wide viewports: two columns, video beside the copy rather than under
   it. Stacked, the video pushed the App Store badge BELOW THE FOLD on a
   1280x900 laptop (measured: badge top 961px) — and the badge is the
   whole point of this page. Side-by-side keeps icon, wordmark, tagline,
   badge AND video all above the fold, and lets the video be larger, not
   smaller. Below 860px it falls back to the stacked order, where a
   phone's tall viewport has room for both. */
@media (min-width: 860px) {
  .hero-inner {
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "icon     video"
      "title    video"
      "tagline  video"
      "badge    video"
      "trailer  video"
      "platform video";
    align-items: center;
    justify-items: start;
    text-align: left;
    column-gap: 48px;
  }
  .hero-inner > .app-icon    { grid-area: icon; }
  .hero-inner > .title       { grid-area: title; }
  .hero-inner > .tagline     { grid-area: tagline; }
  .hero-inner > .badge-row   { grid-area: badge; }
  .hero-inner > .trailer-link{ grid-area: trailer; }
  .hero-inner > .platforms   { grid-area: platform; }
  .hero-inner > .hero-video  {
    grid-area: video;
    align-self: center;
    margin: 0;
    width: min(260px, 26vw);
  }
  .hero-inner .title-logo { margin: 0; }
  .hero-video__el { max-height: 66vh; }
}

.badge-row { margin-top: 34px; }
.store-badge {
  display: inline-block;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 12px 26px;
  border-radius: 999px;
  background: rgba(231, 178, 75, 0.08);
}
/* Live App Store link (activated on approval — see index.html badge-row).
   Filled amber pill with hover lift; inherits the .store-badge shape. */
.store-badge--live {
  text-decoration: none;
  color: #1a0e08;
  background: var(--amber);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.store-badge--live:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(231, 178, 75, 0.35);
}
/* Trailer link under the store badge (YouTube Short). */
.trailer-link {
  margin-top: 16px;
}
.trailer-link a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, filter 0.15s ease;
}
.trailer-link a:hover {
  filter: brightness(1.1);
  border-color: var(--amber);
}
.platforms {
  margin-top: 22px;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- variant cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: linear-gradient(160deg, var(--felt-alt), var(--felt-deep));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
}
.card-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--amber);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.98rem; }

/* ---------- features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px 24px;
}
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.95rem; }

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.gallery figure {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  background: var(--felt-deep);
}
.gallery img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 14px 10px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  background: linear-gradient(to top, rgba(7,40,32,.92), transparent);
}

/* ---------- how to play ---------- */
.rules-intro { max-width: 820px; margin: 0 auto 36px; }
.rules-intro p { color: var(--muted); font-size: 1rem; }
.rank-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
}
.rank-table {
  flex: 1 1 220px;
  background: linear-gradient(160deg, var(--felt-alt), var(--felt-deep));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.rank-table h4 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}
.rank-table table { width: 100%; border-collapse: collapse; }
.rank-table td { padding: 4px 0; font-size: 0.95rem; }
.rank-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--amber-soft);
}
.rank-table tr + tr td { border-top: 1px solid var(--line); }

.rules-accordion { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.rules-accordion details {
  background: var(--felt-deep);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.rules-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rules-accordion summary::-webkit-details-marker { display: none; }
.rules-accordion summary::after {
  content: "+";
  margin-left: auto;
  font-weight: 400;
  color: var(--amber);
  font-size: 1.4rem;
  line-height: 1;
}
.rules-accordion details[open] summary::after { content: "–"; }
.sum-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--amber);
  padding: 4px 9px;
  border-radius: 6px;
}
.rules-accordion details > .lang-block { padding: 0 22px 20px; }
.rules-accordion ul { list-style: none; }
.rules-accordion li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.97rem;
}
.rules-accordion li::before {
  content: "♦";
  position: absolute;
  left: 0;
  color: var(--amber);
  font-size: 0.7rem;
  top: 4px;
}
.rules-accordion strong { color: var(--cream); }
.rules-source {
  text-align: center;
  margin-top: 28px;
  color: rgba(245,239,226,.45);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---------- footer ---------- */
.footer {
  background: var(--felt-deep);
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 56px 20px 40px;
}
.footer-inner { max-width: 680px; margin: 0 auto; }
.footer-note { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }
.footer-links {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--amber-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.footer-links a:hover { text-decoration: underline; }
.footer-links span { color: var(--muted); }
.copyright { margin-top: 22px; color: rgba(245,239,226,.45); font-size: 0.82rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery img { transition: none; }
}


/* --- Screenshot strip (2026-08-16) -------------------------------
   Raw app captures, three across on desktop and a horizontal
   scroll-snap rail on phones (three 480px portraits will not fit
   side by side on a 390px screen, and shrinking them to fit makes
   the UI text illegible — which defeats the point of showing the
   interface at all). */
.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 900px;
  margin: 0 auto;
}
.shot { margin: 0; text-align: center; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  background: #1a0d0a;
}
.shot figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--amber-soft);
  opacity: 0.85;
}

@media (max-width: 720px) {
  .shots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px 10px;
    /* Let the rail bleed to the screen edges so it reads as swipeable
       rather than as a clipped grid. */
    margin-inline: calc(50% - 50vw);
    max-width: 100vw;
  }
  .shot { scroll-snap-align: center; }
}

/* === Rules links (2026-08-29) ==========================================
   The front page used to carry the full rules accordion; it now lives
   only in rules.html and this is the entry point, one card per variant.
   Deep links (#belote / #contree / #coinche / #annonces) are opened by a
   script on that page. */
.rules-links {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 22px;
}
.rules-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 14px;
  /* The chips read as raw hyperlinks on the live page: an <a> inherits the
     site link colour AND its underline, so the kicker, the title and the
     summary all came out link-blue and underlined. Reported 2026-08-29.
     Colour is set explicitly per child below. */
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.rules-link:hover,
.rules-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
}
.rules-link strong,
.rules-link > span:last-child { text-decoration: none; }
.rules-link:hover,
.rules-link:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}
.rules-link strong {
  font-size: 1.06rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.rules-link > span:last-child {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* rules.html header — owns its layout; see the comment in that file for
   why it must not reuse .hero / .hero-inner. */
.rules-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 8px;
  text-align: center;
}
.rules-back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 16px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.rules-back:hover,
.rules-back:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
}
.rules-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;          /* NOT 0 — .hero .title zeroes it for the logo image */
  margin: 0;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.rules-title .t-blue  { color: #4d8fd6; }
.rules-title .t-white { color: #ffffff; }
.rules-title .t-red   { color: #f06a60; }
.rules-sub {
  margin: 14px auto 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}
.rules-more { margin-top: 20px; }
/* rules.html header: slimmer than the front page's hero — someone who
   followed the app's footer link wants the rules, not the pitch. */

@media (prefers-reduced-motion: reduce) {
  .rules-link { transition: none; }
  .rules-link:hover, .rules-link:focus-visible { transform: none; }
}

/* "In the app" notes inside each variant accordion — what THIS app does,
   as distinct from the rules of the game itself. Values come from the
   engine (deal.ts) and the config sheet, not from the rules PDF. */
.rules-app-note {
  /* Lives INSIDE a .lang-block so it inherits `details > .lang-block`'s
     22px inset. It used to be a sibling of those blocks, which the padding
     rule does not match — so it rendered full-bleed against the accordion
     edge while everything around it was inset, and read as colliding with
     the variant chip. Reported from the live page 2026-08-29. */
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(77, 143, 214, 0.10);
  border: 1px solid rgba(77, 143, 214, 0.24);
}
.rules-app-note h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8fc0f0;
}
.rules-app-note ul { margin: 0; }
.rules-app-note li { margin-bottom: 6px; }
.rules-app-note li:last-child { margin-bottom: 0; }
