/* ==========================================================================
   Maiwar Game Studio — shared studio styles (every page loads this first)
   Header, game bar, footer, buttons, store badges, support + privacy pages.
   Shared classes start with "st-" so the game pages' own CSS never clashes.
   ========================================================================== */

:root {
  --st-night: #0e1a2b;
  --st-night-2: #16273f;
  --st-teal: #2ec4b6;
  --st-teal-deep: #0b7d75;
  --st-river: #1e6fd9;
  --st-sun: #ff8a3d;
  --st-pink: #f0508e;
  --st-cream: #fff8ee;
  --st-head: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --st-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* page theme (overridden by .t-sudoku / .t-block) */
  --bg: var(--st-cream);
  --ink: var(--st-night);
  --muted: #51607a;
  --accent: var(--st-teal-deep);
  --accent-on: #fff;
  --accent-shadow: rgba(11, 125, 117, .3);
  --link: var(--st-teal-deep);
  --font-head: var(--st-head);
  --font-body: var(--st-body);
  --hero-bg: linear-gradient(135deg, #34c9bb 0%, #149b91 100%);
  --hero-ink: var(--st-night);
  --hero-muted: rgba(14, 26, 43, .75);
  --doc-head: var(--st-night);
  --doc-link: var(--st-teal-deep);
  --doc-tint: #e8f8f6;
}

.t-sudoku {
  --bg: #f6f9ff;
  --ink: #102043;
  --muted: #55627d;
  --accent: #1565e8;
  --accent-on: #fff;
  --accent-shadow: rgba(21, 101, 232, .3);
  --link: #1565e8;
  --font-head: 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --hero-bg: radial-gradient(900px 400px at 85% 0%, #4f8ff5 0%, transparent 60%), linear-gradient(135deg, #1565e8 0%, #0b3fa8 100%);
  --hero-ink: #fff;
  --hero-muted: rgba(255, 255, 255, .85);
  --doc-head: #102043;
  --doc-link: #1565e8;
  --doc-tint: #fff4d1;
}

.t-block {
  --bg: #1b0f45;
  --ink: #fff;
  --muted: #cfc6f2;
  --accent: #ff4f7e;
  --accent-on: #fff;
  --accent-shadow: rgba(255, 79, 126, .35);
  --link: #ffd66b;
  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Fredoka', system-ui, sans-serif;
  --hero-bg: radial-gradient(900px 420px at 80% -10%, rgba(255, 79, 126, .35), transparent 60%), linear-gradient(135deg, #3a1f8f 0%, #1b0f45 100%);
  --hero-ink: #fff;
  --hero-muted: #cfc6f2;
  --doc-head: #2a1570;
  --doc-link: #c2185b;
  --doc-tint: #fff6d8;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
.t-block {
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 79, 126, .16), transparent 60%),
    linear-gradient(180deg, #1b0f45 0%, #2a1570 55%, #1b0f45 100%);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
.st-wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.st-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: var(--st-night); padding: 8px 14px; border-radius: 8px; font-weight: 800; }
.st-skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--st-teal); outline-offset: 2px; }

/* ---------- studio header (same on every page) ---------- */
.st-hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(14, 26, 43, .96);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  backdrop-filter: saturate(150%) blur(10px);
  box-shadow: inset 0 -3px 0 var(--st-teal);
  font-family: var(--st-body);
}
.st-hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.st-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.st-brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 4px 12px rgba(0, 0, 0, .3); }
.st-brand__name { display: flex; flex-direction: column; font-family: var(--st-head); font-weight: 800; font-size: 23px; line-height: .95; letter-spacing: .2px; color: #fff; }
.st-brand__name small { font-family: var(--st-body); font-size: 11.5px; font-weight: 800; letter-spacing: 2.4px; text-transform: uppercase; color: var(--st-teal); margin-top: 3px; }
.st-nav { display: flex; align-items: center; gap: 6px; }
.st-nav a {
  font-family: var(--st-body); font-weight: 800; font-size: 15.5px;
  color: #cfdbea; text-decoration: none;
  padding: 8px 16px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.st-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.st-nav a[aria-current="page"] { color: var(--st-night); background: var(--st-teal); }
.st-menu { display: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .08); cursor: pointer; }
.st-menu span { display: block; height: 3px; margin: 4px 0; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
.st-menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.st-menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.st-menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- game bar (under the header on game pages) ---------- */
.st-gamebar { font-family: var(--font-head); border-bottom: 1px solid transparent; }
.st-gamebar__in { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.st-gamebar__game { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; }
.st-gamebar__game img { width: 34px; height: 34px; border-radius: 9px; }
.st-gamebar__nav { display: flex; gap: 4px; }
.st-gamebar__nav a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.st-gamebar--sudoku { background: #fff; border-color: #e3ecfb; }
.st-gamebar--sudoku .st-gamebar__game { color: #102043; }
.st-gamebar--sudoku .st-gamebar__nav a { color: #55627d; }
.st-gamebar--sudoku .st-gamebar__nav a:hover { color: #1565e8; background: #f1f6ff; }
.st-gamebar--sudoku .st-gamebar__nav a[aria-current="page"] { color: #fff; background: #1565e8; }
.st-gamebar--block { background: #241259; border-color: rgba(255, 255, 255, .1); }
.st-gamebar--block .st-gamebar__game { color: #fff; font-weight: 600; }
.st-gamebar--block .st-gamebar__nav a { color: #cfc6f2; font-weight: 500; }
.st-gamebar--block .st-gamebar__nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.st-gamebar--block .st-gamebar__nav a[aria-current="page"] { color: #fff; background: #ff4f7e; }

/* ---------- buttons + store badges ---------- */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 800; font-size: 17px; line-height: 1.2;
  color: var(--accent-on); background: var(--accent);
  padding: 13px 26px; border-radius: 999px; border: 0; text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 20px var(--accent-shadow);
  transition: transform .15s, filter .15s;
}
.st-btn:hover { transform: translateY(-2px); filter: brightness(1.07); color: var(--accent-on); }
.st-btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.st-btn--ghost:hover { color: inherit; }
.st-btn--night { --accent: var(--st-night); --accent-on: #fff; --accent-shadow: rgba(14, 26, 43, .25); }
.st-stores { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.st-stores a { display: inline-block; border-radius: 10px; transition: transform .15s; }
.st-stores a:hover { transform: translateY(-2px); }
.st-stores img { height: 50px; width: auto; }
.st-stores img.st-gp { height: 74px; margin: -12px -10px; }
.st-stores--center { justify-content: center; }

/* ---------- page hero (support / privacy / download / 404) ---------- */
.st-pagehero { background: var(--hero-bg); color: var(--hero-ink); padding: 52px 0 88px; text-align: center; }
.st-pagehero__icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 20px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.st-pagehero h1 { font-family: var(--font-head); font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.12; font-weight: 800; margin: 0 0 8px; }
.t-sudoku .st-pagehero h1 { font-weight: 900; }
.t-block .st-pagehero h1 { font-weight: 700; }
.st-pagehero p { margin: 0 auto; max-width: 620px; color: var(--hero-muted); font-size: 1.08rem; }

/* ---------- document card (privacy / support) ---------- */
.st-doc {
  position: relative;
  max-width: 840px; margin: -56px auto 0;
  background: #fff; color: #2b3550;
  border-radius: 24px; padding: 36px 40px 40px;
  box-shadow: 0 20px 50px rgba(16, 32, 67, .14);
  font-family: 'Nunito', system-ui, sans-serif; font-size: 16.5px;
}
.t-block .st-doc { color: #2b2350; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.st-doc h2 { font-family: var(--font-head); color: var(--doc-head); font-size: 1.45rem; line-height: 1.25; font-weight: 800; margin: 34px 0 10px; }
.t-block .st-doc h2 { font-weight: 600; }
.st-doc h2:first-child { margin-top: 0; }
.st-doc h3 { font-size: 1.06rem; font-weight: 800; color: var(--doc-head); margin: 20px 0 6px; }
.st-doc p { margin: 0 0 12px; }
.st-doc ul { margin: 0 0 14px; padding-left: 22px; }
.st-doc li { margin: 5px 0; }
.st-doc a { color: var(--doc-link); font-weight: 700; }
.st-doc code { background: var(--doc-tint); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.st-doc table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 15px; }
.st-doc th, .st-doc td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid #e7e9f2; }
.st-doc th { background: #f5f7fc; }
.st-doc .st-meta { color: #6b7590; font-size: 15px; margin-bottom: 22px; }
.st-summary { background: var(--doc-tint); border-radius: 16px; padding: 16px 20px; margin: 0 0 8px; }
.st-summary strong { display: block; font-size: 1.05rem; color: var(--doc-head); margin-bottom: 2px; }
.st-summary ul { margin: 6px 0 0; }
.st-contact { background: #f5f7fc; border-radius: 16px; padding: 16px 20px; }
.st-contact p { margin: 0; }
.st-docwrap { padding-bottom: 72px; }

/* support page parts */
.st-help { text-align: center; padding: 6px 0 10px; }
.st-help p { color: #5b6580; margin: 14px 0 0; }
.st-topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 14px 0 6px; }
.st-topic { background: #f5f7fc; border-radius: 16px; padding: 16px 18px; }
.st-topic h3 { margin: 0 0 4px; }
.st-topic p { margin: 0; color: #5b6580; font-size: 15.5px; }
.st-faq details { border-bottom: 1px solid #e7e9f2; }
.st-faq summary { list-style: none; cursor: pointer; position: relative; padding: 14px 34px 14px 0; font-weight: 800; color: var(--doc-head); }
.st-faq summary::-webkit-details-marker { display: none; }
.st-faq summary::after { content: '+'; position: absolute; right: 4px; top: 8px; font-size: 26px; font-weight: 800; color: var(--doc-link); }
.st-faq details[open] summary::after { content: '–'; }
.st-faq details p { margin: 0 0 14px; color: #4a5470; }
.st-storeline { margin-top: 30px; padding: 22px; border-radius: 18px; background: #f5f7fc; text-align: center; }
.st-storeline h2 { margin: 0 0 12px !important; }

/* ---------- studio footer (same on every page) ---------- */
.st-ftr { position: relative; background: var(--st-night); color: #a9b7cc; font-family: var(--st-body); font-size: 15px; line-height: 1.6; }
.st-ftr { margin-top: 34px; }
.st-ftr__river { position: absolute; top: -33px; left: 0; display: block; width: 100%; height: 34px; color: var(--st-night); }
.st-ftr__river path { fill: currentColor; }
.st-ftr__river .st-ftr__line { fill: none; stroke: var(--st-teal); stroke-width: 3; opacity: .9; }
.st-ftr__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 30px; padding-bottom: 34px; }
.st-ftr .st-brand img { width: 52px; height: 52px; }
.st-ftr p { margin: 12px 0 0; max-width: 340px; }
.st-ftr h2 { font-family: var(--st-head); font-size: 17px; font-weight: 800; color: #fff; margin: 4px 0 10px; }
.st-ftr__col a { display: block; color: #d6e1ef; text-decoration: none; font-weight: 700; padding: 3px 0; }
.st-ftr__col a:hover { color: var(--st-teal); }
.st-ftr__mail { display: inline-block; margin-top: 14px; color: var(--st-teal) !important; font-weight: 800; text-decoration: none; word-break: break-all; }
.st-ftr__mail:hover { text-decoration: underline; }
.st-ftr__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 16px; padding-bottom: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; color: #8494ab; }
.st-ftr__legal p { margin: 0; max-width: none; }

/* ---------- screenshot lightbox (Sudoku page) ---------- */
.st-lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 15, 35, .9); }
.st-lightbox.is-open { display: flex; }
.st-lightbox img { max-height: 90vh; width: auto; border-radius: 22px; }
.st-lightbox button { position: absolute; top: 14px; right: 16px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: #fff; color: #102043; font-size: 28px; line-height: 1; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .st-ftr__grid { grid-template-columns: 1fr 1fr; }
  .st-ftr__brandcol { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .st-menu { display: block; }
  .st-nav {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 10px 16px 18px;
    background: var(--st-night);
    box-shadow: 0 18px 30px rgba(0, 0, 0, .35), inset 0 -3px 0 var(--st-teal);
  }
  .st-nav.is-open { display: flex; }
  .st-nav a { padding: 12px 16px; font-size: 17px; border-radius: 14px; }
  .st-doc { padding: 26px 20px 30px; border-radius: 20px; }
  .st-topics { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .st-wrap { padding: 0 16px; }
  .st-brand__name { font-size: 21px; }
  .st-gamebar__in { justify-content: center; }
  .st-gamebar__game { width: 100%; justify-content: center; }
  .st-gamebar__nav { width: 100%; justify-content: space-between; }
  .st-gamebar__nav a { padding: 7px 10px; font-size: 14.5px; }
  .st-pagehero { padding: 38px 0 80px; }
  .st-stores img { height: 46px; }
  .st-stores img.st-gp { height: 68px; }
  .st-ftr__grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.st-help__intro { margin: 0 0 18px !important; }
.st-doc .st-btn, .st-doc .st-btn:hover { color: var(--accent-on); text-decoration: none; }
