/* =========================================================================
   Деберць / Deberc — public site
   One stylesheet for every page and every language.
   ========================================================================= */

/* ---------- Fonts (self-hosted, OFL) ---------------------------------- */
/* Each family is split into Latin, Latin Extended and Cyrillic files, and
   Arabic has its own two families; unicode-range lets the browser fetch only
   the files a page actually needs. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/playfair-display-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/playfair-display-cyrillic-400-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/playfair-display-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/manrope-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/manrope-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/manrope-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/manrope-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/manrope-cyrillic-800-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/manrope-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/playfair-display-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/playfair-display-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/manrope-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/manrope-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/manrope-latin-ext-800-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Amiri";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/amiri-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal; font-weight: 700 800; font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Tokens ----------------------------------------------------- */
/* Values mirror lib/theme.dart of the app. Dark is the default. */

:root {
  color-scheme: dark light;

  /* app tokens — dark */
  --bg:        #111118;
  --bg-2:      #1A1A2F;
  --surf:      rgba(255, 255, 255, 0.055);
  --surf-2:    rgba(255, 255, 255, 0.09);
  --bdr:       rgba(255, 255, 255, 0.08);
  --tx:        #FFFFFF;
  --tx-2:      #AAAAAA;
  --tx-3:      #555555;   /* decorative only, never body text */
  --acc:       #C5A453;
  --t0:        #C5A453;
  --t1:        #5A9FD4;
  --t2:        #6DBE7A;
  --danger:    #E05252;
  --egg:       #F0B429;
  --nk:        rgba(255, 255, 255, 0.07);
  --nk-del:    rgba(224, 82, 82, 0.12);

  /* derived */
  --acc-dim:    rgba(197, 164, 83, 0.16);
  --acc-bdr:    rgba(197, 164, 83, 0.45);
  --t0-dim:     rgba(197, 164, 83, 0.13);
  --t1-dim:     rgba(90, 159, 212, 0.13);
  --danger-dim: rgba(224, 82, 82, 0.12);
  --egg-dim:    rgba(240, 180, 41, 0.13);

  /* site-only */
  --muted:     #9A9AA6;   /* small secondary text, ≥ 4.5:1 on --bg */
  --card:      rgba(255, 255, 255, 0.035);
  --card-bdr:  rgba(255, 255, 255, 0.08);
  --glow:      rgba(197, 164, 83, 0.14);
  --rule:      rgba(255, 255, 255, 0.035);  /* score-sheet ruling */
  --suit-red:  #E05252;   /* the app's ♥ ♦ red, same in both themes */
  --on-acc:    #111111;
  --cta-a:     #C5A453;   /* the app's ctaGradient, same in both themes */
  --cta-b:     #E0C070;
  --focus:     #E0C070;
  --phone:     #07070B;
  --shadow:    0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  --grain-opacity: 0.05;

  /* type */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-text: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-hero:    clamp(2.5rem, 1.55rem + 4.6vw, 4.75rem);   /* 40 → 76 */
  --fs-h2:      clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);  /* 30 → 44 */
  --fs-h3:      1.125rem;                                   /* 18 */
  --fs-lead:    clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);   /* 17 → 20 */
  --fs-body:    1rem;                                       /* 16 */
  --fs-small:   0.875rem;                                   /* 14 */
  --fs-eyebrow: 0.75rem;                                    /* 12 */

  /* layout */
  --gutter: 16px;
  --max: 1120px;
  --max-text: 42rem;
  --radius: 18px;
  --radius-sm: 12px;
  --space-section: clamp(4rem, 3rem + 5vw, 7.5rem);
}

/* Arabic pages: Amiri for display, IBM Plex Sans Arabic for text; Latin
   letters and digits fall through to the usual families. Letter-spacing would
   pull the joined Arabic letters apart, and Arabic has no italics. */
html[lang="ar"] {
  --font-display: "Amiri", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-text: "IBM Plex Sans Arabic", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
html[lang="ar"] body * { letter-spacing: normal; }
html[lang="ar"] body .display-italic, html[lang="ar"] body .game-native { font-style: normal; }


/* light — app tokens from AppTheme(isDark: false) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #F2F2F7;
    --bg-2:      #E5E5ED;
    --surf:      rgba(0, 0, 0, 0.05);
    --surf-2:    rgba(0, 0, 0, 0.09);
    --bdr:       rgba(0, 0, 0, 0.09);
    --tx:        #111111;
    --tx-2:      #666666;
    --tx-3:      #BBBBBB;
    --acc:       #8F6520;
    --t0:        #8F6520;
    --t1:        #1A6FB5;
    --t2:        #2E7D3E;
    --danger:    #C0392B;
    --egg:       #B07800;
    --nk:        rgba(0, 0, 0, 0.06);
    --nk-del:    rgba(192, 57, 43, 0.09);

    --acc-dim:    rgba(143, 101, 32, 0.16);
    --acc-bdr:    rgba(143, 101, 32, 0.45);
    --t0-dim:     rgba(143, 101, 32, 0.13);
    --t1-dim:     rgba(26, 111, 181, 0.13);
    --danger-dim: rgba(192, 57, 43, 0.12);
    --egg-dim:    rgba(176, 120, 0, 0.13);

    --muted:     #5E5E68;
    --card:      rgba(255, 255, 255, 0.7);
    --card-bdr:  rgba(0, 0, 0, 0.08);
    --glow:      rgba(143, 101, 32, 0.12);
    --rule:      rgba(26, 111, 181, 0.08);
    --focus:     #8F6520;
    --shadow:    0 30px 60px -24px rgba(30, 30, 60, 0.35), 0 10px 24px -14px rgba(30, 30, 60, 0.3);
    --grain-opacity: 0.035;
  }
}

/* explicit override hooks for a future theme switch (same values) */
:root[data-theme="light"] {
  --bg: #F2F2F7; --bg-2: #E5E5ED; --surf: rgba(0,0,0,.05); --surf-2: rgba(0,0,0,.09);
  --bdr: rgba(0,0,0,.09); --tx: #111111; --tx-2: #666666; --tx-3: #BBBBBB;
  --acc: #8F6520; --t0: #8F6520; --t1: #1A6FB5; --t2: #2E7D3E; --danger: #C0392B; --egg: #B07800;
  --nk: rgba(0,0,0,.06); --nk-del: rgba(192,57,43,.09);
  --acc-dim: rgba(143,101,32,.16); --acc-bdr: rgba(143,101,32,.45); --t0-dim: rgba(143,101,32,.13);
  --t1-dim: rgba(26,111,181,.13); --danger-dim: rgba(192,57,43,.12); --egg-dim: rgba(176,120,0,.13);
  --muted: #5E5E68; --card: rgba(255,255,255,.7); --card-bdr: rgba(0,0,0,.08);
  --glow: rgba(143,101,32,.12); --rule: rgba(26,111,181,.08); --focus: #8F6520;
  --shadow: 0 30px 60px -24px rgba(30,30,60,.35), 0 10px 24px -14px rgba(30,30,60,.3);
  --grain-opacity: .035;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(110% 70% at 50% -10%, var(--bg-2) 0%, transparent 60%),
    radial-gradient(60% 40% at 85% 20%, var(--glow) 0%, transparent 70%);
  background-repeat: no-repeat;
  color: var(--tx);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* felt grain — inline SVG noise, no network request */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

h1, h2, h3 { margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
.legend b, .example .num, .feature::after, .steps li::before { font-variant-numeric: lining-nums; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--acc); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--acc);
  color: var(--on-acc);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
:root[data-theme="light"] .skip-link { color: #fff; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .skip-link { color: #fff; } }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 768px)  { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; } }

/* inline suit glyphs (SVG <use>) */
.suit { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: -0.12em; }
.suit--red { color: var(--suit-red); }

/* ---------- Header ------------------------------------------------------ */

.site-header { padding-block: 14px; }
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand lang" "nav nav";
  align-items: center;
  row-gap: 10px;
}
@media (min-width: 720px) {
  .site-header { padding-block: 20px; }
  .site-header .wrap {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav lang";
    column-gap: 32px;
  }
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--tx);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-mark { width: 32px; height: 32px; }

/* On a phone the menu is one row that scrolls sideways instead of wrapping. */
.site-nav { grid-area: nav; min-width: 0; }
.site-nav ul {
  display: flex;
  gap: 20px;
  margin: 0; padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.site-nav ul::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .site-nav ul { justify-content: flex-end; gap: 28px; } }
.site-nav a {
  color: var(--tx-2);
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 600;
  padding-block: 6px;
  display: inline-block;
}
.site-nav a:hover { color: var(--tx); }
.site-nav a[aria-current="page"] {
  color: var(--tx);
  box-shadow: inset 0 -2px 0 var(--acc);
}

/* language switcher: УКР / ENG */
.lang {
  grid-area: lang;
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surf);
  border: 1px solid var(--bdr);
}
.lang a {
  display: inline-block;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--tx-2);
  text-decoration: none;
}
.lang a:hover { color: var(--tx); }
.lang a[aria-current="true"] {
  background: var(--acc-dim);
  color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--acc-bdr);
}

/* ---------- Shared bits ------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
}
.eyebrow .tally-mark { width: 22px; height: 16px; color: var(--acc); }

.section { padding-block: var(--space-section) 0; }
.section-head { max-width: var(--max-text); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.section-head h2 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.section-head p { margin-top: 16px; font-size: var(--fs-lead); color: var(--tx-2); }

.display-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--acc); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 14px;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn--gold {
  color: var(--on-acc);
  background: linear-gradient(135deg, var(--cta-a), var(--cta-b));
  box-shadow: 0 8px 24px -10px rgba(197, 164, 83, 0.7);
}
.btn--gold:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(197, 164, 83, 0.8); }
.btn--ghost {
  color: var(--tx);
  background: var(--surf);
  box-shadow: inset 0 0 0 1px var(--bdr);
}
.btn--ghost:hover { background: var(--surf-2); }
.btn:focus-visible { outline-offset: 4px; border-radius: 14px; }

/* tally drawing (sticks / circles), shared by the hero copy and the score section */
.tally { display: inline-flex; align-items: center; gap: 0.1em; color: var(--t0); }
.tally svg { height: 1em; width: auto; overflow: visible; }
.tally .note { font-size: 0.32em; font-weight: 800; opacity: 0.7; align-self: flex-start; line-height: 1; }
.tally .note--extra { align-self: flex-end; padding-bottom: 0.08em; }
.tally--t1 { color: var(--t1); }

/* ---------- Hero -------------------------------------------------------- */

.hero { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) 0; overflow-x: clip; }
.hero .wrap {
  display: grid;
  gap: clamp(3rem, 2rem + 3vw, 4rem);
  align-items: center;
}
@media (min-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

.hero h1 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero h1 em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--acc);
}
.hero .lead {
  margin-top: 22px;
  max-width: 36rem;
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--tx-2);
}
.hero .lead strong { color: var(--tx); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 480px) { .hero-actions .btn { flex: 0 0 auto; } }

.promise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.promise-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--bdr);
  background: var(--surf);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tx-2);
}
.promise-list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc);
}

/* the stage under the phone: two card backs fanned out on the felt */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  grid-template-columns: 100%;
  padding-block: 12px 24px;
  isolation: isolate;
}
.stage::before {           /* lamp light over the table */
  content: "";
  position: absolute;
  inset: 0 -10%;
  z-index: -2;
  background: radial-gradient(closest-side, var(--glow), transparent 75%);
}
.card-back {
  position: absolute;
  z-index: -1;
  top: 10%;
  width: min(52%, 190px);
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  background:
    repeating-linear-gradient(45deg, transparent 0 7px, var(--acc-dim) 7px 8px),
    repeating-linear-gradient(-45deg, transparent 0 7px, var(--acc-dim) 7px 8px),
    var(--bg-2);
  box-shadow: inset 0 0 0 6px var(--bg-2), inset 0 0 0 7px var(--acc-bdr), var(--shadow);
}
.card-back--l { left: 2%; transform: rotate(-14deg); }
.card-back--r { right: 2%; transform: rotate(11deg); top: 16%; }
.card-face {
  position: absolute;
  z-index: -1;
  right: 4%;
  bottom: 6%;
  width: min(30%, 112px);
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  background: #FBF8EF;
  color: #1A1A22;
  transform: rotate(18deg);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.card-face .idx { position: absolute; top: 8px; left: 9px; line-height: 0.9; font-size: 1.05rem; text-align: center; }
.card-face .idx .suit { display: block; margin: 2px auto 0; width: 0.85em; height: 0.85em; }
.card-face > .suit { width: 42%; height: auto; aspect-ratio: 1; }
@media (max-width: 420px) {
  .card-face { width: 28%; right: 0; }
}

/* ---------- Phone mockup --------------------------------------------------
   The screen is a scaled copy of the app at 390 logical px wide. 1 app px
   is --u; container query units keep the drawing proportional at any width. */

.phone {
  --u: 0.74px;
  container-type: inline-size;
  position: relative;
  width: min(100%, 300px);
  padding: 9px;
  border-radius: 44px;
  background: var(--phone);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 0 0 3px #000,
    var(--shadow);
}
@supports (width: 1cqi) { .phone { --u: calc(100cqi / 390); } }
@media (min-width: 1100px) { .phone { width: 320px; } }

.phone .screen {
  position: relative;
  aspect-ratio: 390 / 760;
  overflow: hidden;
  border-radius: calc(36 * var(--u) + 2px);
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font-text);
  font-size: calc(13 * var(--u));
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  user-select: none;
}
.phone .island {
  position: absolute;
  top: calc(11 * var(--u));
  left: 50%;
  translate: -50% 0;
  width: calc(108 * var(--u));
  height: calc(30 * var(--u));
  border-radius: 999px;
  background: #000;
  z-index: 2;
}
.phone .status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: calc(50 * var(--u));
  padding: calc(6 * var(--u)) calc(30 * var(--u)) 0;
  font-size: calc(15 * var(--u));
  font-weight: 600;
  background: var(--bg-2);
}
.phone .status .bat {
  width: calc(25 * var(--u)); height: calc(12 * var(--u));
  border-radius: calc(3 * var(--u));
  border: calc(1.5 * var(--u)) solid var(--tx-2);
  padding: calc(1.5 * var(--u));
}
.phone .status .bat::before { content: ""; display: block; height: 100%; width: 70%; background: var(--tx); border-radius: 1px; }

/* app header bar */
.m-head {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(12 * var(--u)) calc(18 * var(--u)) calc(10 * var(--u));
  background: linear-gradient(var(--bg-2), var(--bg));
}
.m-btn {
  padding: calc(7 * var(--u)) calc(13 * var(--u));
  border-radius: calc(10 * var(--u));
  background: var(--surf);
  font-size: calc(13 * var(--u));
  font-weight: 600;
  color: var(--tx-2);
  white-space: nowrap;
}
.m-title {
  flex: 1;
  text-align: center;
  font-size: calc(13 * var(--u));
  font-weight: 800;
  letter-spacing: calc(0.5 * var(--u));
  color: var(--tx-3);
}
.m-pill {
  padding: calc(4 * var(--u)) calc(11 * var(--u));
  border-radius: 999px;
  background: var(--surf);
  font-size: calc(12 * var(--u));
  font-weight: 800;
  color: var(--tx-2);
}

/* traditional score block */
.m-scores { padding: calc(6 * var(--u)) calc(18 * var(--u)) 0; }
.m-side { margin-bottom: calc(8 * var(--u)); }
.m-side-name {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  font-size: calc(11 * var(--u));
  font-weight: 800;
  letter-spacing: calc(0.4 * var(--u));
}
.m-deals {
  padding: calc(2 * var(--u)) calc(8 * var(--u));
  border-radius: 999px;
  font-size: calc(9 * var(--u));
  font-weight: 800;
  letter-spacing: calc(0.5 * var(--u));
}
.m-bar {
  height: calc(4 * var(--u));
  margin-block: calc(4 * var(--u));
  border-radius: calc(2 * var(--u));
  background: var(--surf-2);
  overflow: hidden;
}
.m-bar > i { display: block; height: 100%; border-radius: inherit; }
.m-side .tally { font-size: calc(30 * var(--u)); gap: calc(3 * var(--u)); }

.c-t0 { color: var(--t0); }
.c-t1 { color: var(--t1); }
.bg-t0 { background: var(--t0); }
.bg-t1 { background: var(--t1); }
.dim-t0 { background: var(--t0-dim); color: var(--t0); }
.dim-t1 { background: var(--t1-dim); color: var(--t1); }

/* numeric score block (used on the entry-panel mockup) */
.m-numeric { padding: calc(6 * var(--u)) calc(18 * var(--u)) 0; }
.m-numeric .names { display: flex; justify-content: space-around; text-align: center; }
.m-numeric .names > div { display: grid; justify-items: center; gap: calc(2 * var(--u)); font-size: calc(11 * var(--u)); font-weight: 800; letter-spacing: calc(0.4 * var(--u)); }
.m-numeric .big {
  display: flex; justify-content: center; align-items: center; gap: calc(16 * var(--u));
  font-size: calc(56 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: calc(-2 * var(--u));
}
.m-numeric .big .colon { font-size: calc(20 * var(--u)); color: var(--tx-3); letter-spacing: 0; }
.m-bars { display: flex; align-items: center; gap: calc(4 * var(--u)); padding: calc(8 * var(--u)) calc(18 * var(--u)) 0; }
.m-bars .m-bar { flex: 1; height: calc(5 * var(--u)); margin: 0; }
.m-bars .sep { width: 1px; height: calc(10 * var(--u)); background: var(--bdr); }
.m-limits { display: flex; justify-content: space-between; padding: calc(4 * var(--u)) calc(18 * var(--u)) 0; }
/* points a side still needs to win */
.m-togo {
  padding: calc(1 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  font-size: calc(10 * var(--u));
  font-weight: 700;
  letter-spacing: 0;
}
.m-side-name .m-togo { margin-inline-start: auto; }

/* held points banner */
.m-held {
  margin: calc(4 * var(--u)) calc(18 * var(--u)) 0;
  padding: calc(6 * var(--u)) calc(11 * var(--u));
  border-radius: calc(10 * var(--u));
  background: var(--egg-dim);
  color: var(--egg);
  font-size: calc(12 * var(--u));
  font-weight: 800;
  text-align: center;
}

/* round history */
.m-rounds {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--u));
  padding: calc(8 * var(--u)) calc(18 * var(--u));
  overflow: hidden;
}
.m-round {
  display: grid;
  grid-template-columns: calc(64 * var(--u)) 1fr 1px 1fr calc(64 * var(--u));
  align-items: center;
  column-gap: calc(5 * var(--u));
  padding: calc(6 * var(--u)) calc(9 * var(--u));
  border-radius: calc(10 * var(--u));
  border: 1px solid var(--bdr);
  background: var(--surf);
  font-size: calc(14 * var(--u));
  font-weight: 800;
}
.m-round .no { font-size: calc(11 * var(--u)); color: var(--tx-3); }
.m-round .div { align-self: stretch; background: var(--bdr); }
/* each side's marks follow its points, reading away from the divider */
.m-round .l, .m-round .r { display: flex; align-items: center; gap: calc(4 * var(--u)); white-space: nowrap; }
.m-round .l { justify-content: flex-end; }
.m-round .r { justify-content: flex-start; }
.m-round .lost { color: var(--danger); text-decoration: line-through; }
.m-round .lost-mark { color: var(--danger); }
.m-round .meta { display: flex; justify-content: flex-end; align-items: center; gap: calc(3 * var(--u)); font-size: calc(9 * var(--u)); font-weight: 400; color: var(--tx-3); white-space: nowrap; }
.m-badge {
  padding: calc(2 * var(--u)) calc(6 * var(--u));
  border-radius: 999px;
  font-size: calc(8.5 * var(--u));
  font-weight: 800;
  letter-spacing: calc(0.4 * var(--u));
}
.m-badge--bait, .m-badge--penalty { background: var(--danger-dim); color: var(--danger); }
.m-badge--eggs { background: var(--egg-dim); color: var(--egg); }

/* bottom CTA bar */
.m-foot {
  border-top: 1px solid var(--bdr);
  padding: calc(11 * var(--u)) calc(18 * var(--u)) calc(30 * var(--u));
}
.m-cta {
  padding: calc(14 * var(--u));
  border-radius: calc(14 * var(--u));
  background: linear-gradient(135deg, var(--cta-a), var(--cta-b));
  color: #111111;
  font-size: calc(15 * var(--u));
  font-weight: 800;
  text-align: center;
}

/* entry panel */
.m-panel {
  border-top: 1px solid var(--bdr);
  padding: calc(10 * var(--u)) calc(18 * var(--u)) calc(26 * var(--u));
  display: grid;
  gap: calc(8 * var(--u));
  background: var(--bg);
}
.m-panel .cols { display: grid; grid-template-columns: 2fr 3fr; gap: calc(10 * var(--u)); }
.m-panel .col-head { height: calc(16 * var(--u)); margin-bottom: calc(4 * var(--u)); font-size: calc(12 * var(--u)); font-weight: 600; color: var(--tx-2); white-space: nowrap; }
.m-panel .col-head--gv { font-size: calc(13 * var(--u)); font-weight: 800; color: var(--acc); }
.m-chip {
  height: calc(31 * var(--u));
  display: grid; place-items: center;
  border-radius: 999px;
  border: calc(1.5 * var(--u)) solid var(--bdr);
  font-size: calc(12 * var(--u)); font-weight: 800; color: var(--tx-2);
}
.m-chip + .m-chip { margin-top: calc(4 * var(--u)); }
.m-chip--on1 { border-color: var(--t1); background: var(--t1-dim); color: var(--t1); }
.m-counters { display: grid; grid-template-columns: 1fr 1fr; gap: calc(4 * var(--u)); }
.m-counter, .m-bella {
  height: calc(31 * var(--u));
  border-radius: calc(12 * var(--u));
  border: calc(1.5 * var(--u)) solid var(--bdr);
  display: grid; place-items: center;
}
.m-counter { grid-template-columns: calc(22 * var(--u)) 1fr calc(22 * var(--u)); text-align: center; font-weight: 800; color: var(--tx-2); font-size: calc(16 * var(--u)); }
.m-counter .lbl { display: block; font-size: calc(8 * var(--u)); color: var(--tx-3); line-height: 1; }
.m-counter .n { display: block; font-size: calc(14 * var(--u)); line-height: 1.1; }
.m-counter--on { background: var(--acc-dim); border-color: var(--acc-bdr); }
.m-counter--on .lbl, .m-counter--on .n { color: var(--acc); }
.m-bella { grid-column: 1 / -1; margin-top: calc(4 * var(--u)); font-size: calc(12 * var(--u)); font-weight: 800; color: var(--tx-2); }
.m-input {
  display: flex; align-items: center;
  padding: calc(9 * var(--u)) calc(10 * var(--u));
  border-radius: calc(13 * var(--u));
  background: var(--surf);
}
.m-input > div { flex: 1; text-align: center; padding: calc(4 * var(--u)) calc(6 * var(--u)); border-radius: calc(9 * var(--u)); }
.m-input .active { background: var(--surf-2); }
.m-input .name { font-size: calc(10 * var(--u)); font-weight: 800; letter-spacing: calc(0.4 * var(--u)); }
.m-input .val { font-size: calc(26 * var(--u)); font-weight: 800; line-height: 1.1; }
.m-input .colon { flex: 0; padding-inline: calc(10 * var(--u)); color: var(--tx-3); font-weight: 800; }
.m-input .caret { display: inline-block; width: calc(2 * var(--u)); height: 0.8em; margin-left: calc(2 * var(--u)); background: var(--t1); vertical-align: -0.05em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.m-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(5 * var(--u)); }
.m-pad span {
  height: calc(36 * var(--u));
  display: grid; place-items: center;
  border-radius: calc(10 * var(--u));
  background: var(--nk);
  font-size: calc(17 * var(--u));
  font-weight: 600;
}
.m-pad .del { background: var(--nk-del); color: var(--danger); }
.m-pad .deb { font-size: calc(13 * var(--u)); font-weight: 800; color: var(--tx-2); }
.m-actions { display: flex; gap: calc(6 * var(--u)); }
.m-actions span { padding: calc(12 * var(--u)) calc(13 * var(--u)); border-radius: calc(12 * var(--u)); font-size: calc(13 * var(--u)); font-weight: 600; }
.m-actions .ghost { background: var(--surf); color: var(--tx-2); }
.m-actions .bait { background: var(--danger-dim); color: var(--danger); box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--danger-dim); font-weight: 800; }
.m-actions .save { flex: 1; text-align: center; background: linear-gradient(135deg, var(--cta-a), var(--cta-b)); color: #111111; font-weight: 800; font-size: calc(14 * var(--u)); }

.phone-figure { margin: 0; display: grid; grid-template-columns: 100%; justify-items: center; gap: 18px; }
.phone-figure > .stage { justify-self: stretch; }
.phone-figure figcaption { font-size: var(--fs-small); color: var(--muted); text-align: center; max-width: 30ch; }

/* ---------- Features --------------------------------------------------- */

.features {
  display: grid;
  gap: 14px;
  margin: 0; padding: 0;
  list-style: none;
}
@media (min-width: 620px)  { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.feature {
  position: relative;
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-bdr);
  overflow: hidden;
}
.feature::after {            /* a card's corner index */
  content: attr(data-index);
  position: absolute;
  top: 16px; right: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tx-3);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--acc-dim);
  color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--acc-bdr);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin-top: 18px; font-size: var(--fs-h3); font-weight: 800; line-height: 1.3; letter-spacing: -0.005em; }
.feature p { margin-top: 8px; font-size: 0.9375rem; color: var(--tx-2); line-height: 1.55; }

.app-word {               /* the app's own labels, e.g. «роздає», БАЙТ */
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: 0.06em;
}
.app-word--deals { background: var(--t0-dim); color: var(--t0); }
.app-word--bait  { background: var(--danger-dim); color: var(--danger); }
.app-word--eggs  { background: var(--egg-dim); color: var(--egg); }
.app-word--gold  { background: var(--acc-dim); color: var(--acc); }

/* ---------- How a deal is recorded ------------------------------------- */

.record { display: grid; gap: clamp(2.5rem, 2rem + 3vw, 4rem); align-items: center; }
@media (min-width: 900px) { .record { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.record .phone-figure { order: 2; }
@media (min-width: 900px) { .record .phone-figure { order: 0; } }

.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 16px;
  padding: 18px 0;
  border-top: 1px solid var(--bdr);
}
.steps li:last-child { border-bottom: 1px solid var(--bdr); }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--acc);
}
.steps h3 { font-size: var(--fs-h3); font-weight: 800; line-height: 1.35; }
.steps p { color: var(--tx-2); }
.record-note { margin-top: 22px; color: var(--tx-2); }

/* ---------- Paper-style score ----------------------------------------- */

.sheet {
  position: relative;
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(24px, 4vw, 48px);
  background:
    linear-gradient(transparent 31px, var(--rule) 31px, var(--rule) 32px) 0 18px / 100% 32px,
    var(--card);
  border: 1px solid var(--card-bdr);
  display: grid;
  gap: clamp(2rem, 1.5rem + 3vw, 3.5rem);
}
@media (min-width: 900px) { .sheet { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.sheet::before {            /* margin rule of a score sheet */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: clamp(14px, 2.5vw, 30px);
  width: 1px;
  background: var(--danger);
  opacity: 0.35;
}
.sheet h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; margin-top: 14px; }
.sheet .intro { margin-top: 16px; font-size: var(--fs-lead); color: var(--tx-2); }

.legend { margin: 0; display: grid; gap: 12px; }
.legend div { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 14px; }
.legend dt { display: flex; justify-content: center; }
.legend dt .tally { font-size: 40px; }
.legend dd { margin: 0; display: flex; align-items: baseline; gap: 12px; font-weight: 600; line-height: 1.3; }
.legend dd b { flex: 0 0 2.4ch; font-family: var(--font-display); font-size: 1.5rem; color: var(--acc); font-weight: 700; }

.examples { display: grid; gap: 14px; margin-top: 4px; }
.example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surf);
}
.example .num { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; min-width: 2.6ch; }
.example .tally { font-size: 38px; }
.example .eq { color: var(--muted); font-size: var(--fs-small); flex-basis: 100%; }
@media (min-width: 520px) { .example .eq { flex-basis: auto; margin-inline-start: auto; } }

/* ---------- Privacy band ---------------------------------------------- */

.trust {
  display: grid;
  gap: 28px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(80% 120% at 100% 0%, var(--glow), transparent 60%),
    var(--card);
  border: 1px solid var(--card-bdr);
}
@media (min-width: 900px) { .trust { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; } }
.trust h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; margin-top: 14px; }
.trust > div > p { margin-top: 14px; color: var(--tx-2); }
.trust > div > p a { font-weight: 700; }
.trust-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 520px) { .trust-list { grid-template-columns: 1fr 1fr; } }
.trust-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surf);
  font-weight: 600;
  line-height: 1.4;
}
.trust-list svg { width: 20px; height: 20px; margin-top: 1px; color: var(--acc); }

/* ---------- Download --------------------------------------------------- */

.download { text-align: center; }
.download .section-head { margin-inline: auto; }
.stores {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .stores { grid-template-columns: repeat(3, 1fr); } }
.store {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px dashed var(--acc-bdr);
  background: var(--surf);
  text-align: start;
  color: var(--tx);
}
.store svg { width: 28px; height: 28px; color: var(--tx-2); }
.store .label { display: grid; line-height: 1.2; }
.store .label small { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc); }
.store .label span { font-size: 1.0625rem; font-weight: 800; }
.download .also { margin-top: 22px; color: var(--tx-2); font-size: var(--fs-small); }

/* The installers on the site itself: solid, clickable buttons. */
.store--get {
  border: 1px solid var(--acc-bdr);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.store--get:hover { border-color: var(--acc); transform: translateY(-1px); }
.store--get:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.store--get .label { flex: 1; }
.store--get svg { color: var(--acc); }
.store--get svg.get { width: 20px; height: 20px; }
/* The app in the browser, for those who would rather not install anything. */
.download .web-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 960px;
  margin: 16px auto 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--acc-bdr);
  background: var(--acc-dim);
  text-align: center;
}
.download .web-app p { margin: 0; color: var(--tx); font-weight: 600; }
.download .web-app .btn { flex: none; }
@media (min-width: 720px) {
  .download .web-app { flex-direction: row; justify-content: space-between; text-align: start; padding-inline: 28px; }
}
.download .app-release { margin: 16px 0 34px; color: var(--tx-2); font-size: var(--fs-small); }

/* One card per platform: its download button and the install steps for it. */
.get-cards {
  display: grid;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: start;
}
@media (min-width: 860px) { .get-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.get-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--card-bdr);
  background: var(--card);
}
.get-card .fits { margin: 0 4px; color: var(--tx-2); font-size: var(--fs-small); font-weight: 700; }
.get-card .how {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
  counter-reset: how;
  color: var(--tx-2);
  font-size: var(--fs-small);
}
.get-card .how li { position: relative; padding-inline-start: 1.4em; counter-increment: how; }
.get-card .how li::before { content: counter(how) "."; position: absolute; inset-inline-start: 0; color: var(--acc); font-weight: 800; }
.get-card .how code, .get-card .alt code {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surf);
  color: var(--tx);
  font-size: 0.95em;
  overflow-wrap: anywhere;
}
.get-card .alt {
  margin: 0 4px;
  padding-top: 10px;
  border-top: 1px solid var(--bdr);
  color: var(--tx-2);
  font-size: var(--fs-small);
}
.get-card .alt a { color: var(--acc); font-weight: 700; }

.source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 28px clamp(20px, 4vw, 40px);
  border-radius: var(--radius);
  border: 1px solid var(--card-bdr);
  background: var(--card);
}
@media (min-width: 720px) { .source-card { flex-direction: row; text-align: start; justify-content: space-between; } }
.source-card h3 { font-size: var(--fs-h3); font-weight: 800; }
.source-card p { margin-top: 4px; color: var(--tx-2); font-size: 0.9375rem; }

/* ---------- Game family home ------------------------------------------ */

/* the hero hand: one card per game, fanned out under the lamp */
.fan {
  --step: 8deg;
  --w: clamp(78px, 21vw, 104px);
  position: relative;
  height: calc(var(--w) * 2.6);
  isolation: isolate;
}
@media (min-width: 960px) { .fan { --step: 11deg; --w: 124px; } }
.fan::before {
  content: "";
  position: absolute;
  inset: -10% -20%;
  z-index: -2;
  background: radial-gradient(closest-side, var(--glow), transparent 75%);
}
.fan-card {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: var(--w);
  aspect-ratio: 5 / 7;
  margin-left: calc(var(--w) / -2);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #FBF8EF;
  color: #1A1A22;
  box-shadow: var(--shadow);
  transform-origin: 50% 230%;
  transform: rotate(calc(var(--i) * var(--step)));
  font-family: var(--font-display);
  font-weight: 700;
}
.fan-card::before {        /* the card's rank in its corner */
  content: attr(data-rank);
  position: absolute;
  top: 7px; left: 9px;
  font-size: calc(var(--w) * 0.14);
  line-height: 1;
}
/* the corner of a card that stays in sight under the next one */
.fan-card .pip {
  position: absolute;
  top: calc(var(--w) * 0.28); left: 7px;
  width: calc(var(--w) * 0.34); height: auto;
  border-radius: 22%;
}
.fan-card .face { width: 58%; height: auto; border-radius: 22%; }

/* the games: one card each, ranked like a suit of the 32-card deck */
.games {
  display: grid;
  gap: 14px;
  margin: 0; padding: 0;
  list-style: none;
}
@media (min-width: 620px)  { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .games { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.game {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-bdr);
  color: var(--tx);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.game:hover { border-color: var(--acc-bdr); transform: translateY(-2px); }
.game:focus-visible { border-radius: var(--radius); }
.game::after {
  content: attr(data-index);
  position: absolute;
  top: 16px; right: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tx-3);
}
.game-icon { width: 56px; height: 56px; border-radius: 14px; }
.game-origin {
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
}
.game h3 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}
.game-native { display: block; margin-top: 2px; font-family: var(--font-display); font-style: italic; color: var(--tx-2); }
.game-desc { display: block; margin-top: 10px; font-size: 0.9375rem; line-height: 1.55; color: var(--tx-2); }
.game-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.game-meta span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tx-2);
}
.game-go { font-weight: 800; color: var(--acc); }
/* phones: a compact row per game — icon, name and the short facts */
@media (max-width: 619px) {
  .games { gap: 10px; }
  .game {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    align-items: center;
    padding: 16px 40px 16px 16px;
  }
  .game::after { top: 14px; right: 16px; }
  .game h3 { font-size: 1.3rem; margin-top: 2px; }
  .game-desc, .game-go { display: none; }
  .game-meta { grid-column: 2; margin-top: 0; }
  .game--ask .game-desc { display: block; grid-column: 1 / -1; margin-top: 0; }
}
.game--ask { border-style: dashed; border-color: var(--acc-bdr); background: transparent; }
.game--ask .feature-icon { width: 56px; height: 56px; border-radius: 14px; }

/* the header's right corner: language menu and theme switch */
.header-tools { grid-area: lang; display: inline-flex; align-items: center; gap: 8px; justify-self: end; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--bdr);
  background: var(--surf);
  color: var(--tx-2);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--tx); }
.theme-toggle svg { width: 18px; height: 18px; }
/* show the theme a click switches to */
.theme-toggle .to-dark { display: none; }
:root[data-theme="light"] .theme-toggle .to-dark { display: block; }
:root[data-theme="light"] .theme-toggle .to-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .to-dark { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .to-light { display: none; }
}

/* language menu for pages in many languages: a <details> popup */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--acc);
  cursor: pointer;
  list-style: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 16px; height: 16px; color: var(--tx-2); transition: transform .15s ease; }
.lang-menu[open] summary svg { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--bdr);
  box-shadow: var(--shadow);
}
.lang-menu a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--tx);
  text-decoration: none;
  font-weight: 600;
}
.lang-menu a small { font-size: var(--fs-eyebrow); font-weight: 800; letter-spacing: 0.08em; color: var(--muted); }
.lang-menu a:hover { background: var(--surf); }
.lang-menu a[aria-current="true"] { background: var(--acc-dim); color: var(--acc); }

/* ---------- Footer ---------------------------------------------------- */

.site-footer {
  margin-top: var(--space-section);
  padding-block: 40px 32px;
  border-top: 1px solid var(--bdr);
  font-size: var(--fs-small);
  color: var(--muted);
}
.site-footer .wrap { display: grid; gap: 28px; }
@media (min-width: 760px) {
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; }
}
.footer-brand p { margin-top: 10px; max-width: 32ch; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.footer-nav a { color: var(--tx-2); text-decoration: none; font-weight: 600; display: inline-block; padding-block: 4px; }
.footer-nav a:hover { color: var(--tx); text-decoration: underline; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--bdr);
}
@media (min-width: 760px) { .footer-base { grid-column: 1 / -1; } }
.footer-suits { display: inline-flex; gap: 8px; color: var(--tx-2); font-size: 14px; }

/* ---------- Legal / support pages ------------------------------------- */

.page-head { padding-block: clamp(2rem, 1rem + 4vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.page-head h1 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.page-head .lead { margin-top: 16px; max-width: var(--max-text); font-size: var(--fs-lead); color: var(--tx-2); }
.page-meta { margin-top: 18px; font-size: var(--fs-small); color: var(--muted); }

.legal-layout { display: grid; gap: 40px; }
@media (min-width: 960px) {
  .legal-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; align-items: start; }
}
.toc { font-size: var(--fs-small); }
@media (min-width: 960px) { .toc { position: sticky; top: 24px; } }
.toc h2 { font-size: var(--fs-eyebrow); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 6px 0; color: var(--tx-2); text-decoration: none; }
.toc a::before { content: counter(toc); min-width: 1.4em; color: var(--acc); font-weight: 800; }
.toc a:hover { color: var(--tx); }
@media (max-width: 959px) {
  .toc { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surf); }
}

.prose { max-width: var(--max-text); }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  margin-top: 2.6em;
  padding-top: 0.4em;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .num { color: var(--acc); margin-inline-end: 0.4em; }
.prose p, .prose li { color: var(--tx-2); }
.prose strong { color: var(--tx); }
.prose ul { padding-inline-start: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--acc); }

.summary {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--glow), transparent 70%), var(--card);
  box-shadow: inset 0 0 0 1px var(--acc-bdr);
}
.summary h2 { margin: 0; padding: 0; font-family: var(--font-text); font-size: var(--fs-eyebrow); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); }
.summary ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.summary li { display: flex; gap: 10px; color: var(--tx); font-weight: 600; }
.summary li svg { width: 18px; height: 18px; margin-top: 4px; color: var(--acc); }

/* rules */
.table-wrap { overflow-x: auto; }
.rules-table {
  width: 100%;
  max-width: 34rem;
  border-collapse: collapse;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.rules-table th, .rules-table td { padding: 9px 14px; text-align: start; border-bottom: 1px solid var(--card-bdr); }
.rules-table thead th {
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc);
  border-bottom-color: var(--acc-bdr);
}
.rules-table tbody th { font-weight: 600; color: var(--tx); }
.rules-table td { color: var(--tx-2); }
.rules-cta {
  margin-top: 3em;
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--glow), transparent 70%), var(--card);
  box-shadow: inset 0 0 0 1px var(--acc-bdr);
}
.prose .rules-cta h2 { margin: 0; padding: 0; font-size: 1.375rem; }
.rules-cta p { margin-top: 10px; }
.rules-cta .btn { margin-top: 18px; }

/* support */
.contact-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-bdr);
}
.contact h2 { font-size: 1.25rem; font-weight: 800; }
.contact p { color: var(--tx-2); }
.contact ul { margin: 0; padding-inline-start: 1.2em; color: var(--tx-2); }
.contact ul li::marker { color: var(--acc); }
.contact .btn { margin-top: auto; align-self: flex-start; }

.faq { display: grid; gap: 10px; max-width: 52rem; }
.faq details {
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--card-bdr);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-right: 2px solid var(--acc);
  border-bottom: 2px solid var(--acc);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary:focus-visible { outline-offset: -2px; border-radius: var(--radius-sm); }
.faq .answer { padding: 0 20px 20px; color: var(--tx-2); }
.faq .answer > * + * { margin-top: 0.7em; }
.faq .answer strong { color: var(--tx); }
