/*
 * site.css — shared stylesheet for the static marketing pages
 * (landing + privacy + terms, all locales). Progressive enhancement only:
 * the pages are fully functional without JS (site.js just adds nicety).
 *
 * Theme matches the game: deep felt-green surfaces (not black) so the jump to
 * the green /play game feels seamless; gold accents; the joker mascot.
 * Mobile-first and fully fluid — no horizontal scroll at any width.
 * Breakpoints mirror src/constants/index.ts (480 / 768 / 1024).
 */

:root {
  /* Deep felt greens — the same family as the in-game toolbar/table, so the
     landing reads as part of the game rather than a separate black site. */
  --bg: #0b2a13;
  --bg-deep: #07200e;
  --surface: #103a1c;
  --felt: #0d6016;
  --felt-dark: #0a4d12;
  --gold: #ffa000;
  --gold-bright: #ffd700;
  --navy: #1e3a5f;
  --crest-red: #8b1e2d;
  --text: #ffffff;
  --text-secondary: #b9c2b6;
  --text-dim: #8a958b;
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.07);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --gold-soft: rgba(255, 160, 0, 0.14);
  --header-bg: #0b2a13;
  --menu-bg: #0b2a13;
  --maxw: 920px;
  /* Matches Toolbar.tsx: 33px controls + 8px vertical padding top/bottom. */
  --hdr-h: 49px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; -webkit-user-drag: none; }

/* Disable text selection, copy, and long-press callout on the marketing pages */
html {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Disable drag on all elements, and long-press callout on links and images */
.site-header, .site-header *,
.site-footer, .site-footer * {
  -webkit-user-drag: none;
  user-drag: none;
}
a, img, button {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }

html.await-hero-image,
html.await-hero-image body {
  overflow: hidden;
}

html.await-hero-image body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 160, 0, 0.12) 0, rgba(255, 160, 0, 0.05) 18%, transparent 48%),
    var(--bg);
  z-index: 999;
}

html.await-hero-image body::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--gold);
  animation: site-loader-spin 0.8s linear infinite;
  z-index: 1000;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@keyframes site-loader-spin {
  to { transform: rotate(360deg); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.suit-red { color: #ff6b6b; }
.suit-dark { color: #808080; }

/* Accessibility skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #000;
  padding: 10px 16px;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Match in-game toolbar typography source (React Native Web System stack). */
.site-header,
.site-header * {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.hdr-inner {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  min-height: var(--hdr-h);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.brand { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 1; min-width: 0; }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}
.wordmark {
  font-family: var(--font);
  font-weight: 750;
  letter-spacing: 0.45px;
  font-size: 1.18rem;
  line-height: 1.1;
  color: #fff;
}
.wordmark-accent {
  margin-left: 5px;
  font-family: inherit;
  font-weight: inherit;
}

.hdr-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Language picker pill (flag + code button) */
.lang-dd { position: relative; }
.lang-dd > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  min-width: 33px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.3px;
  line-height: 20px;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.lang-dd > summary::-webkit-details-marker { display: none; }
.lang-dd > summary:hover {
  background: rgba(255, 255, 255, 0.14);
}
.lang-dd[open] > summary {
  background: rgba(255, 200, 0, 0.2);
}
.lang-dd[open] > summary .lang-code { color: var(--gold); }
.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  line-height: 20px;
  font-size: 0.9rem;
}
.lang-code {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 20px;
}
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  min-width: 140px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
/* Fixed-width flag column so all language names left-align perfectly */
.lang-menu a .lf {
  display: inline-flex;
  justify-content: center;
  width: 1.4em;
  flex-shrink: 0;
  font-size: 1.05em;
  line-height: 1;
}
.lang-menu a:hover { background: var(--card); color: #fff; }
.lang-menu a[aria-current="true"] { color: var(--gold); background: var(--gold-soft); }

/* Play button */
.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  box-shadow: none;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.btn-play:hover,
.btn-play:focus-visible,
.btn-play:active {
  background: inherit;
  color: inherit;
  text-decoration: none;
}
.btn-play--header { padding: 0 10px; font-size: 0.6875rem; font-weight: 600; }

/* Toolbar Play Now keeps toolbar geometry but uses primary action color. */
.btn-play--header {
  background: #266b2a;
  color: #fff;
}

.btn-play--header:hover,
.btn-play--header:focus-visible,
.btn-play--header:active {
  background: #266b2a;
  color: #fff;
}

/* Match in-game toolbar label typography on landing header controls. */
.btn-play--header {
  font-size: 0.6875rem;
  letter-spacing: 0.3px;
  line-height: 20px;
}

/* Center hero Play Now stays the original primary CTA treatment. */
.btn-play--hero {
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 999px;
  background: #266b2a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: none;
}

.btn-play--hero:hover,
.btn-play--hero:focus-visible,
.btn-play--hero:active {
  background: #266b2a;
  color: #fff;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Keep header controls aligned with the in-game toolbar control height. */
.btn-play--header,
.lang-dd > summary {
  height: 33px;
  min-width: 33px;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
/* Fills the first screen exactly — content centered, the next section starts
   just below the fold (so How-to-Play never peeks in only partially). */
.hero {
  position: relative;
  text-align: center;
  min-height: calc(100vh - var(--hdr-h));
  min-height: calc(100svh - var(--hdr-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 52px;
  background: #0b2a13;
  border-bottom: 1px solid var(--border-soft);
}
.hero h1 {
  margin: 0 auto 16px;
  max-width: 16ch;
  font-size: clamp(1.9rem, 5.6vw, 3.3rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero .lede {
  margin: 0 auto;
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: clamp(0.98rem, 2.2vw, 1.15rem);
}
.hero .lede + .lede { margin-top: 12px; }
.hero-cta {
  margin-top: clamp(24px, 3.5vw, 36px);
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 16px 36px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: var(--font);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }

/* ── Sections ──────────────────────────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) 20px;
}
.section + .section { border-top: 1px solid var(--border-soft); }
.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 8px;
}
.prose { color: var(--text-secondary); }
.prose strong { color: #fff; }

/* Card blocks (rules / deck / combos) */
.block {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 24px);
  margin-top: 18px;
}
.block h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
}
.block p { color: var(--text-secondary); margin: 0 0 10px; }

/* Numbered rule rows */
.rule-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; }
.rule-badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  margin-top: 2px;
}
.rule-row p { color: var(--text-secondary); margin: 0; }
.rule-sub {
  margin: 8px 0 0 38px;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 200, 0, 0.3);
  color: var(--text-dim);
  font-size: 0.95rem;
}
.rule-sub p { margin: 0 0 4px; color: var(--text-dim); }
.bullet-list { list-style: none; margin: 0; padding: 0; }
.bullet-list li { position: relative; padding-left: 18px; margin-top: 10px; color: var(--text-secondary); }
.bullet-list li::before { content: "›"; position: absolute; left: 0; color: var(--gold); font-weight: 800; }
.divider-soft { height: 1px; background: var(--border-soft); margin: 16px 0 4px; }

.rank-row {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  color: #fff;
  word-spacing: 2px;
}

/* Tips */
.tip {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 22px);
  margin-top: 16px;
}
.tip h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; }
.tip-n { color: var(--gold); }
.tip p { margin: 0; color: var(--text-secondary); }

/* FAQ */
.faq {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 22px);
  margin-top: 16px;
}
.faq h3 { margin: 0 0 8px; font-size: 1.1rem; }
.faq p { margin: 0; color: var(--text-secondary); }


/* Reserved ad-slot placeholder (ads added post-AdSense-approval; reserves
   height now so dropping units in later causes zero layout shift). */
.ad-slot { min-height: 100px; margin: 24px auto; max-width: var(--maxw); }

/* The one site-wide logo image: landing hero + blog index/articles + legal
   pages all render this. Width is the smaller of 88vw (near full-width on
   mobile) or 35svh × 1.905 (logo aspect ratio 1200/630, so it never dominates
   tall screens), clamped between 260px and 720px. */
.page-banner {
  display: block;
  width: clamp(260px, min(88vw, 35svh * 1.905), 720px);
  max-width: 100%;
  height: auto;
  margin: 0 auto clamp(12px, 2vw, 20px);
  border-radius: clamp(14px, 2.5vw, 24px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* ── Blog index ────────────────────────────────────────────────────────── */
.blog-index { max-width: 760px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) 20px; }
.blog-index > h1 { font-size: clamp(1.9rem, 5.6vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; margin: 0 0 10px; text-align: center; }
.blog-index-intro { color: var(--text-secondary); font-size: clamp(0.98rem, 2.2vw, 1.15rem); margin: 0 auto 28px; max-width: 60ch; text-align: center; }
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.post-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 24px);
}
.post-card-date { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 6px; }
.post-card-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; line-height: 1.25; }
.post-card-title a { color: #fff; }
.post-card-title a:hover { color: var(--gold); }
.post-card-excerpt { color: var(--text-secondary); margin: 0 0 10px; }
.post-card-more a { color: var(--gold); font-weight: 600; font-size: 0.9rem; }

/* ── Blog article ──────────────────────────────────────────────────────── */
.post { max-width: 760px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) 20px; }
.post-eyebrow { margin: 0 0 18px; font-size: 0.9rem; }
.post-eyebrow a { color: var(--gold); font-weight: 600; }
.post h1 { font-size: clamp(1.9rem, 5.6vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; margin: 0 0 10px; text-align: center; }
/* `.post .post-byline` (0,2,0) so the margin beats the broader `.post p` (0,1,1). */
.post .post-byline { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 28px; text-align: center; }
.post h2 { font-size: 1.15rem; font-weight: 700; margin: 36px 0 12px; }
.post p { color: var(--text-secondary); margin: 0 0 14px; }
.post a { color: var(--gold); }

/* Shared intro lede — article, blog index, and legal pages (matches .hero .lede). */
.lede { color: var(--text-secondary); font-size: clamp(0.98rem, 2.2vw, 1.15rem); line-height: 1.6; margin: 0 0 28px; }

/* Shared prose list style — legal + article, matches the landing .bullet-list. */
.legal ul, .post ul { list-style: none; padding: 0; margin: 0 0 14px; }
.legal li, .post li { position: relative; padding-left: 18px; margin: 10px 0 0; color: var(--text-secondary); }
.legal li::before, .post li::before { content: "›"; position: absolute; left: 0; color: var(--gold); font-weight: 800; }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) 20px; }
.legal h1 { font-size: clamp(1.9rem, 5.6vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; margin: 0 0 10px; text-align: center; }
.legal .updated { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 28px; text-align: center; }
.legal h2 { font-size: 1.15rem; font-weight: 700; margin: 36px 0 12px; }
/* First section sits closer to the title block (header→body gap); later
   sections keep the larger 36px separation. */
.legal .updated + h2 { margin-top: 28px; }
.legal p { color: var(--text-secondary); margin: 0 0 14px; }
.legal a { color: var(--gold); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border-soft);
  background: #0b2a13;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}
.footer-links a { color: var(--text-dim); font-size: 0.9rem; padding: 4px 8px; }
.footer-links a:hover { color: #fff; }
.footer-links .dot { color: rgba(255, 255, 255, 0.25); }
.footer-copyright { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 4px; }
.footer-tagline { color: rgba(255, 255, 255, 0.35); font-size: 0.8rem; margin: 0; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Compact wordmark and play button so the header never crowds. */
  .hdr-inner {
    padding: 4px 12px;
    gap: 6px;
  }
  .brand,
  .hdr-actions { gap: 6px; }
  .brand-mark { width: 24px; height: 24px; }
  .wordmark { font-size: 0.8125rem; line-height: 1.15; }
  .btn-play--header { padding: 0 10px; font-size: 0.6875rem; }
}

/* Mirror in-game title breakpoint: title wraps to two lines below 690px. */
@media (max-width: 690px) {
  .wordmark { display: inline-flex; flex-direction: column; }
  .wordmark-accent { margin-left: 0; margin-top: 2px; }
}

/* Very small screens (iPhone SE ≤375px): shrink hero buttons just enough
   so both fit side-by-side on one line without wrapping. */
@media (max-width: 375px) {
  .btn-play--hero,
  .btn-ghost { padding: 14px 22px; font-size: 0.97rem; }
}

/* Mobile landscape — mirrors the in-game toolbar compact mode
   (isLandscapeMobile: landscape + height < 570).
   Matches Toolbar.tsx toolbarCompact paddingVertical: 4. */
@media (orientation: landscape) and (max-height: 569px) {
  :root { --hdr-h: 41px; }  /* 33px controls + 4px top + 4px bottom */
  .hdr-inner {
    padding: 4px 12px;
  }
  .wordmark {
    letter-spacing: 0.05px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .btn-play { transition: none; }
  html.await-hero-image body::after { animation: none; }
}
