/* Stakemate shared design layer — loaded by EVERY page (home, tutorial, download, legal, delete).
   Class-scoped on purpose (plus :root tokens and `a`), so it can sit on top of the homepage
   and tutorial's own inline styles without breaking them. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

:root {
  /* Surfaces */
  --bg: #080a16;
  --bg2: #10142a;
  --bg3: #171c38;
  --border: #232a4d;
  --line: #232a4d;
  /* Text */
  --text: #eef1fa;
  --muted: #98a3c2;
  --link: #8db1ff;
  /* Actions & meaning. Green is reserved for winning results; red for losing / danger. */
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --green: #9afe43;
  --danger: #ff6b81;
  --danger-bg: rgba(255,107,129,.10);
  --ok: #4ade80;
  --purple: #7c3aed;
  --radius: 14px;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #8db1ff; outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: #000; padding: 10px 16px; border-radius: 8px; font-weight: 700; z-index: 400; }
.skip-link:focus { left: 8px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ───────────── HEADER ───────────── */
.site-nav {
  position: sticky; top: 0; z-index: 300; width: 100%;
  background: rgba(8,10,22,.82);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-nav .nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px; height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
}
.site-nav .nav-brand { display: block; flex: none; }
.site-nav .nav-brand img { height: 40px; width: auto; display: block; }
.site-nav .nav-links { display: flex; gap: 6px; list-style: none; margin: 0 auto 0 12px; padding: 0; }
.site-nav .nav-links a {
  display: block; color: var(--muted); font-size: 14.5px; font-weight: 600; padding: 8px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.site-nav .nav-links a:hover { color: var(--text); background: rgba(255,255,255,.05); text-decoration: none; }
.site-nav .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,.07); }
.site-nav .nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.site-nav .nav-links + .nav-actions { margin-left: 0; }
.nav-badges { display: flex; align-items: center; gap: 12px; }
.nav-badges .badge-apple img { height: 36px; }
.nav-badges .badge-google img { height: 54px; margin: -9px; }
.nav-menu-badges { display: none; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.06); }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; content: ""; position: relative; transition: transform .2s, top .2s, opacity .2s;
}
.nav-toggle .bars::before { position: absolute; top: -6px; }
.nav-toggle .bars::after { position: absolute; top: 6px; }
.site-nav.open .nav-toggle .bars { background: transparent; }
.site-nav.open .nav-toggle .bars::before { top: 0; transform: rotate(45deg); }
.site-nav.open .nav-toggle .bars::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .site-nav .nav-inner { padding: 0 16px; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .nav-badges { display: none; }
  .site-nav .nav-actions { margin-left: auto; }
  .site-nav .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; gap: 2px; margin: 0; padding: 10px 16px 16px;
    background: var(--bg2); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px rgba(0,0,0,.45);
  }
  .site-nav.open .nav-links { display: flex; }
  .site-nav .nav-links a { padding: 14px 12px; font-size: 16px; }
  .nav-menu-badges { display: block; padding: 14px 0 6px; }
  .nav-menu-badges .store-badges { flex-wrap: nowrap; gap: 14px; }
}

/* ───────────── BUTTONS ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 16px; border-radius: 14px; padding: 14px 26px; min-height: 48px;
  text-decoration: none; transition: transform .15s, background .15s, opacity .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-light { background: var(--text); color: #05060f; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue2); color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid #3a4374; }
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }

/* ───────────── OFFICIAL STORE BADGES ─────────────
   Artwork in /assets/badges is unmodified. The Google PNG carries built-in clear space, sized here so
   its visible badge matches the Apple badge height (48px). Unavailable = dimmed + labelled, never a dead link. */
.store-badges { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; }
.store-item { display: flex; flex-direction: column; align-items: flex-start; }
.badge { display: inline-block; line-height: 0; border-radius: 9px; }
.badge:hover { text-decoration: none; }
.badge img { display: block; width: auto; }
.badge-apple img { height: 48px; }
.badge-google { margin: 0; }
.badge-google img { height: 71px; margin: -12px; }
.badge.is-unavailable { cursor: pointer; }
.badge-note { font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 8px; }
a.badge[href]:hover img { filter: brightness(1.12); }

/* ───────────── FOOTER ───────────── */
.site-footer { border-top: 1px solid var(--line); background: #0a0d1f; padding: 56px 0 40px; margin-top: 48px; }
.site-footer .footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand > img { height: 40px; width: auto; display: block; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 34ch; margin: 0 0 20px; line-height: 1.6; }
.footer-col h2 { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 14px; letter-spacing: .2px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 10px; }
.footer-col a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: #7482a6; font-size: 12.5px; line-height: 1.7; }
.footer-legal p { margin: 0 0 6px; max-width: 90ch; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .site-footer { padding: 44px 0 32px; } .site-footer .footer-inner { padding: 0 20px; } .footer-grid { gap: 32px 20px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* Message shown when the Google Play badge is tapped before the listing is live */
.store-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 500; max-width: min(92vw, 420px);
  background: var(--text); color: #05060f; padding: 14px 20px; border-radius: 14px; font-size: 15px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.store-toast.show { opacity: 1; transform: translate(-50%, 0); }
