/* ==========================================================================
   Funtrovo site styles
   Colours, fonts and radius come from CSS variables. The render function
   writes the admin's published theme into each page head, after this file,
   so these :root values are only the defaults (kept equal to DEFAULT_THEME
   in functions/src/theme.js; a unit test checks it).
   ========================================================================== */

:root {
  --c-bg: #f6f4fb;
  --c-surface: #ffffff;
  --c-text: #2a1f5c;
  --c-muted: #5f5785;
  --c-primary: #d6245e;
  --c-on-primary: #ffffff;
  --c-accent: #ffd23f;
  --c-link: #b81d50;
  --c-border: #e2dcf2;
  --font-heading: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --btn-radius: 12px;

  /* Fixed: each section of the site has its own colour, used on stickers,
     nav markers and hub headers so visitors learn where they are. */
  --s-quizzes: #d6245e;      --s-quizzes-on: #ffffff;
  --s-tests: #6a3df0;        --s-tests-on: #ffffff;
  --s-zodiac: #3346c9;       --s-zodiac-on: #ffffff;
  --s-calculators: #0b7f78;  --s-calculators-on: #ffffff;
  --s-tools: #ffd23f;        --s-tools-on: #2a1f5c;
  --s-games: #ff7a1a;        --s-games-on: #2a1f5c;
  --s-articles: #2a1f5c;     --s-articles-on: #ffffff;

  --ink: var(--c-text);
  --wrap: 1180px;
  --gutter: 16px;
  --measure: 68ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --c-bg: #17122e; --c-surface: #221b42; --c-text: #f3f0ff; --c-muted: #b9b1dc;
    --c-primary: #ff6b95; --c-on-primary: #17122e; --c-accent: #ffd23f; --c-link: #ff8fb0; --c-border: #3a3166;
    --s-articles: #5a48b8;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --c-bg: #17122e; --c-surface: #221b42; --c-text: #f3f0ff; --c-muted: #b9b1dc;
  --c-primary: #ff6b95; --c-on-primary: #17122e; --c-accent: #ffd23f; --c-link: #ff8fb0; --c-border: #3a3166;
  --s-articles: #5a48b8;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

/* ---------------- base ---------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.15; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 750; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--c-link); text-underline-offset: .16em; text-decoration-thickness: .08em; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding: 0; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--c-text); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--c-surface); padding: .5rem .75rem; border-radius: 8px; }
.skip:focus { left: 8px; }
.lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--c-muted); max-width: 60ch; }
.empty { color: var(--c-muted); padding: 2rem 0; }

/* ---------------- buttons, chips, tags ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  background: var(--c-surface); color: var(--c-text);
  border: 1.5px solid var(--c-border); border-radius: var(--btn-radius);
  font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--c-text); }
.btn-primary {
  background: var(--c-primary); color: var(--c-on-primary);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.btn-primary:hover { border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; }
.chips a {
  display: inline-block; padding: .4rem .9rem; border-radius: 999px;
  background: var(--c-surface); border: 1.5px solid var(--c-border);
  color: var(--c-text); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.chips a:hover { border-color: var(--c-text); }

.tag-link {
  display: inline-block; font-weight: 700; font-size: .95rem; color: var(--c-link); text-decoration: none;
}
.tag-link:hover { text-decoration: underline; }

/* ---------------- header ---------------- */

.site-header { background: var(--c-surface); border-bottom: 1.5px solid var(--c-border); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--c-text); }
.logo-mark { width: 34px; height: 34px; flex: none; overflow: visible; }
.logo-word { font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.035em; }
.theme-toggle {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 1.5px solid var(--c-border); border-radius: 999px; cursor: pointer; color: var(--c-text);
}
.theme-toggle svg { width: 20px; height: 20px; }

.site-nav ul {
  display: flex; gap: .25rem; list-style: none;
  overflow-x: auto; scrollbar-width: none; padding-block: 0 .6rem;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  min-height: 40px; padding: .35rem .75rem; border-radius: 999px;
  color: var(--c-text); text-decoration: none; font-weight: 650;
}
.site-nav a::before {
  content: ""; width: .6rem; height: .6rem; border-radius: 3px; flex: none;
  background: var(--s, var(--c-border)); box-shadow: 0 0 0 1.5px var(--ink); transform: rotate(-8deg);
}
.site-nav a:hover { background: var(--c-bg); }
.site-nav a[aria-current="page"] { background: var(--c-bg); box-shadow: inset 0 0 0 1.5px var(--c-text); }

[data-section="quizzes"] { --s: var(--s-quizzes); --s-on: var(--s-quizzes-on); }
[data-section="tests"] { --s: var(--s-tests); --s-on: var(--s-tests-on); }
[data-section="zodiac"] { --s: var(--s-zodiac); --s-on: var(--s-zodiac-on); }
[data-section="calculators"] { --s: var(--s-calculators); --s-on: var(--s-calculators-on); }
[data-section="tools"] { --s: var(--s-tools); --s-on: var(--s-tools-on); }
[data-section="games"] { --s: var(--s-games); --s-on: var(--s-games-on); }
[data-section="articles"] { --s: var(--s-articles); --s-on: var(--s-articles-on); }

/* ---------------- home hero + stickers (the signature element) ---------------- */

.hero {
  display: grid; gap: 2rem; align-items: center;
  padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(2rem, 1rem + 3vw, 3.5rem);
}
.hero h1 {
  font-size: clamp(2.3rem, 1.3rem + 4.2vw, 4.4rem);
  line-height: 1.02; letter-spacing: -0.03em; max-width: 15ch;
}
.hero .lead { margin-top: 1.1rem; }
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 3rem; }
}

.stickers {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (min-width: 560px) { .stickers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sticker {
  display: flex; flex-direction: column; justify-content: space-between; gap: .35rem;
  min-height: 104px; height: 100%; padding: .85rem 1rem;
  background: var(--s); color: var(--s-on);
  border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none; transform: rotate(var(--tilt, 0deg));
  transition: transform .18s ease, box-shadow .18s ease;
}
.sticker-label { font-family: var(--font-heading); font-weight: 800; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.02em; }
.sticker-blurb { font-size: .9rem; line-height: 1.3; font-weight: 550; opacity: .92; }
.sticker:hover, .sticker:focus-visible { transform: rotate(0deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.stickers li:nth-child(7n+1) { --tilt: -2deg; }
.stickers li:nth-child(7n+2) { --tilt: 1.5deg; }
.stickers li:nth-child(7n+3) { --tilt: -1deg; }
.stickers li:nth-child(7n+4) { --tilt: 2deg; }
.stickers li:nth-child(7n+5) { --tilt: -1.5deg; }
.stickers li:nth-child(7n+6) { --tilt: 1deg; }
.stickers li:nth-child(7n+7) { --tilt: -2.5deg; }

/* One orchestrated moment: the stickers land when the home page opens. */
@media (prefers-reduced-motion: no-preference) {
  .page-home .stickers li { animation: land .45s cubic-bezier(.2, .9, .3, 1.25) both; }
  .page-home .stickers li:nth-child(2) { animation-delay: .05s; }
  .page-home .stickers li:nth-child(3) { animation-delay: .1s; }
  .page-home .stickers li:nth-child(4) { animation-delay: .15s; }
  .page-home .stickers li:nth-child(5) { animation-delay: .2s; }
  .page-home .stickers li:nth-child(6) { animation-delay: .25s; }
  .page-home .stickers li:nth-child(7) { animation-delay: .3s; }
}
@keyframes land { from { opacity: 0; transform: translateY(14px) scale(.94); } }

/* ---------------- blocks + cards ---------------- */

.block { padding-block: 1.5rem 2.5rem; }
.block > h2, .block-head h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem); }
.block > h2 { margin-bottom: 1rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.more { font-weight: 650; white-space: nowrap; }

.card { position: relative; display: flex; flex-direction: column; gap: .4rem; }
.card-link { display: flex; flex-direction: column; gap: .4rem; color: inherit; text-decoration: none; }
.card-media { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--c-border); margin-bottom: .35rem; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-empty {
  background:
    radial-gradient(circle at 78% 30%, var(--c-accent) 0 14%, transparent 15%),
    linear-gradient(135deg, var(--c-primary), var(--s-tests));
}
.card-topic { font-size: .875rem; font-weight: 700; color: var(--c-link); }
.card-title { font-size: 1.15rem; line-height: 1.22; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .15em; }
.card-summary { color: var(--c-muted); font-size: .97rem; line-height: 1.45; }
.card-date { color: var(--c-muted); font-size: .85rem; font-weight: 500; }

.card-grid {
  display: grid; gap: 2rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.latest { display: grid; gap: 2rem; }
.card-lead .card-title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.12; }
.card-lead .card-summary { font-size: 1.05rem; }
.latest-list { display: grid; gap: 1.25rem; align-content: start; }
.latest-list .card-link { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto auto 1fr; column-gap: .9rem; row-gap: .2rem; align-items: start; }
.latest-list .card-media { grid-row: 1 / span 3; margin: 0; aspect-ratio: 4 / 3; }
.latest-list .card-title { font-size: 1.02rem; }
.latest-list .card-summary { display: none; }
@media (min-width: 900px) {
  .latest { grid-template-columns: 1.6fr 1fr; gap: 2.5rem; }
}

/* ---------------- hubs ---------------- */

.hub-head { padding-block: 1rem 2rem; display: grid; gap: 1rem; }
.hub-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.025em; }
.hub-head h1::after {
  content: ""; display: block; width: 3.5rem; height: .5rem; margin-top: .9rem;
  background: var(--s, var(--c-primary)); border: 2px solid var(--ink); border-radius: 999px; transform: rotate(-2deg);
}

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-block: 2.5rem 1rem; }
.pager > :last-child { justify-self: end; }
.pager-now { color: var(--c-muted); font-size: .95rem; }

/* ---------------- breadcrumbs ---------------- */

.crumbs { padding-top: 1.25rem; font-size: .9rem; color: var(--c-muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: .35rem; opacity: .6; }
.crumbs a { color: var(--c-muted); }
.crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }

/* ---------------- article page ---------------- */

.post-layout { display: grid; gap: 0 3rem; }
.post-layout > .crumbs { grid-column: 1 / -1; }
@media (min-width: 1040px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .related { position: sticky; top: 1.5rem; align-self: start; }
}
.post { max-width: 760px; padding-block: 1.25rem 2rem; }
.post-head { display: grid; gap: .9rem; margin-bottom: 1.75rem; }
.post-title { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.25rem); line-height: 1.06; letter-spacing: -0.028em; }
.post-summary { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3rem); line-height: 1.45; color: var(--c-muted); }
.byline { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .93rem; color: var(--c-muted); }
.byline a { color: var(--c-text); font-weight: 650; }
.post-media { margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--c-border); }
.post-media img { width: 100%; height: 100%; object-fit: cover; }

.prose { font-size: 1.125rem; line-height: 1.7; max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-inline: 0; padding: .2em 0 .2em 1.1em; border-left: 4px solid var(--c-accent); font-size: 1.15em; }
.prose img, .prose iframe { border-radius: var(--radius); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose figcaption { font-size: .9rem; color: var(--c-muted); margin-top: .5rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.prose th, .prose td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--c-border); }
.prose mark { background: var(--c-accent); color: #2a1f5c; padding: 0 .15em; border-radius: 3px; }
.prose hr { border: 0; border-top: 1.5px solid var(--c-border); margin-block: 2em; }

.post-sources { margin-top: 2.5rem; padding: 1rem 1.25rem; background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius); }
.post-sources h2 { font-size: 1rem; margin-bottom: .5rem; }
.post-sources ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .95rem; }

.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.post-tags li { padding: .25rem .7rem; border-radius: 999px; background: var(--c-surface); border: 1.5px solid var(--c-border); font-size: .88rem; color: var(--c-muted); }

.share { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }

.related { padding-block: 1.25rem 2rem; }
.related h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }
.related-list { display: grid; gap: 1.5rem; }
@media (min-width: 640px) and (max-width: 1039px) { .related-list { grid-template-columns: 1fr 1fr; } }
.related .card-summary { display: none; }
.related .card-title { font-size: 1.05rem; }

/* ---------------- 404 ---------------- */

.notfound { padding-block: 3rem 4rem; display: grid; gap: 1.5rem; }
.notfound h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }

/* ---------------- footer ---------------- */

.site-footer { margin-top: 3rem; background: var(--c-surface); border-top: 1.5px solid var(--c-border); padding-block: 2.25rem 1.5rem; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr auto; align-items: start; } }
.footer-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.footer-tagline { color: var(--c-muted); margin-top: .25rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.footer-links a { color: var(--c-text); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-copy { margin-top: 1.75rem; font-size: .85rem; color: var(--c-muted); }

/* ---------------- header extras ---------------- */

.header-actions { display: flex; align-items: center; gap: .5rem; }
.saved-link { font-weight: 650; color: var(--c-text); text-decoration: none; padding: .4rem .75rem; border-radius: 999px; border: 1.5px solid var(--c-border); }
.logo-img { display: block; }

/* ---------------- shared bits ---------------- */

.kind-tag {
  display: inline-block; justify-self: start; align-self: start; font-weight: 750; font-size: .9rem; line-height: 1.2;
  padding: .3rem .7rem; border-radius: 10px; background: var(--s, var(--c-primary)); color: var(--s-on, #fff);
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-1.5deg);
}
.btn-lg { min-height: 54px; padding: .8rem 1.6rem; font-size: 1.1rem; border-radius: calc(var(--btn-radius) + 2px); }
.btn-sm { min-height: 34px; padding: .25rem .7rem; font-size: .9rem; }
.chip-btn { font: inherit; cursor: pointer; padding: .4rem .9rem; border-radius: 999px; background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-text); font-weight: 600; font-size: .95rem; }
.chip-btn[aria-pressed="true"] { background: var(--c-text); color: var(--c-bg); border-color: var(--c-text); }
.fav-btn { display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer; background: var(--c-surface); color: var(--c-text); border: 1.5px solid var(--c-border); border-radius: 999px; padding: .3rem .8rem; min-height: 36px; }
.fav-btn[aria-pressed="true"] { border-color: var(--c-text); }
.fav-btn[aria-pressed="true"] .fav-star { color: var(--c-primary); }
.disclaimer { font-size: .9rem; color: var(--c-muted); border-left: 3px solid var(--c-accent); padding: .2rem 0 .2rem .9rem; margin-block: 1.5rem; max-width: var(--measure); }
.credit { font-size: .82rem; color: var(--c-muted); margin-top: .5rem; }
.post-figure { margin: 0 0 2rem; }
.post-figure .post-media { margin: 0; }
.two-col { display: grid; gap: 1rem 2rem; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }
.trait-list { padding-left: 1.2em; }
.help { font-size: .88rem; color: var(--c-muted); }
.muted { color: var(--c-muted); }

/* ---------------- tiles (quizzes, tools, signs) ---------------- */

.tile-grid { display: grid; gap: 1.75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tile-grid-side { grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) and (max-width: 1039px) { .tile-grid-side { grid-template-columns: 1fr 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; gap: .35rem; }
.tile[hidden] { display: none; }
.tile-link { display: flex; flex-direction: column; gap: .35rem; color: inherit; text-decoration: none; }
.tile-media { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--c-border); margin-bottom: .35rem; border: 2px solid var(--ink); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-media-icon { display: grid; place-items: center; background: var(--s, var(--c-primary)); color: var(--s-on, #fff); }
.tile-media-icon span { font-size: 2.6rem; line-height: 1; font-family: var(--font-heading); font-weight: 800; }
.tile-badge { position: absolute; top: .55rem; left: .55rem; background: var(--c-accent); color: #2a1f5c; font-size: .78rem; font-weight: 750; padding: .15rem .55rem; border-radius: 999px; border: 1.5px solid #2a1f5c; }
.tile-kind { font-size: .84rem; font-weight: 700; color: var(--c-link); }
.tile-title { font-size: 1.1rem; line-height: 1.22; }
.tile-link:hover .tile-title { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .15em; }
.tile-blurb { color: var(--c-muted); font-size: .94rem; line-height: 1.45; }
/* Phones: tiles without a picture become compact rows (icon left, text right). */
@media (max-width: 559px) {
  .tile-grid { gap: 1.1rem; }
  .tile:has(.tile-media-icon) { display: grid; grid-template-columns: 5.25rem 1fr; column-gap: .9rem; row-gap: .2rem; align-content: start; }
  .tile:has(.tile-media-icon) .tile-link { display: contents; }
  .tile:has(.tile-media-icon) .tile-media { grid-column: 1; grid-row: 1 / span 4; aspect-ratio: 1; margin: 0; align-self: start; }
  .tile:has(.tile-media-icon) .tile-media span { font-size: 2rem; }
  .tile:has(.tile-media-icon) > :not(.tile-link), .tile:has(.tile-media-icon) .tile-link > :not(.tile-media):not(.tile-badge) { grid-column: 2; }
  .tile:has(.tile-media-icon) .tile-badge { top: 4.45rem; left: .25rem; font-size: .7rem; }
}

/* ---------------- home extras ---------------- */

.coming ul { list-style: none; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1rem; }
.coming a { display: flex; align-items: baseline; gap: .5rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-text); text-decoration: none; }
.coming a:hover { border-color: var(--c-text); }
.coming-days { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: var(--c-primary); white-space: nowrap; }
.coming-name { font-weight: 600; }
.corner { background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.corner h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.corner-sign { font-weight: 650; margin-bottom: .5rem; }
.corner-note { font-size: .85rem; color: var(--c-muted); margin-top: .5rem; }
.saved-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.saved-list a { display: inline-flex; gap: .45rem; align-items: baseline; padding: .4rem .85rem; border-radius: 999px; background: var(--c-bg); border: 1.5px solid var(--c-border); color: var(--c-text); text-decoration: none; font-weight: 600; }
.saved-kind { font-size: .78rem; color: var(--c-muted); font-weight: 650; }
.saved-page { padding-block: 2rem 3rem; display: grid; gap: 1rem; }

/* ---------------- quiz ---------------- */

.quiz-layout, .tool-layout { display: grid; gap: 0 3rem; }
.quiz-layout > .crumbs, .tool-layout > .crumbs { grid-column: 1 / -1; }
@media (min-width: 1040px) {
  .quiz-layout, .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
.quiz, .tool { padding-block: 1.25rem 2rem; min-width: 0; }
.quiz-head, .tool-head { display: grid; gap: .8rem; margin-bottom: 1.5rem; }
.quiz-head h1, .tool-head h1 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.1rem); line-height: 1.06; letter-spacing: -0.028em; }
.quiz-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; color: var(--c-muted); font-size: .95rem; }
.quiz-cover { margin: 0 0 1.5rem; }
.quiz-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.quiz-cover figcaption { font-size: .82rem; color: var(--c-muted); margin-top: .4rem; }
.quiz-app { background: var(--c-surface); border: 2px solid var(--ink); border-radius: calc(var(--radius) + 4px); box-shadow: 5px 5px 0 var(--ink); padding: clamp(1.25rem, 1rem + 2vw, 2rem); min-height: 140px; display: grid; place-items: center; scroll-margin-top: 1rem; }
.quiz-app.playing, .quiz-app:has(.q-result) { place-items: stretch; }
.q-card, .q-result { display: grid; gap: 1rem; width: 100%; }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 650; color: var(--c-muted); font-size: .92rem; }
.q-progress { height: 8px; background: var(--c-border); border-radius: 999px; overflow: hidden; }
.q-progress > span { display: block; height: 100%; background: var(--s, var(--c-primary)); transition: width .25s ease; }
.q-timer { display: flex; align-items: center; gap: .5rem; }
.q-timer-bar { width: 90px; height: 8px; background: var(--c-border); border-radius: 999px; overflow: hidden; }
.q-timer-bar > span { display: block; height: 100%; background: var(--c-accent); }
.q-image { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--radius); background: var(--c-bg); }
.q-text { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.75rem); line-height: 1.2; outline: none; }
.q-answers { display: grid; gap: .65rem; }
.q-answers-tf { grid-template-columns: 1fr 1fr; }
.q-answers-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.q-answer {
  font: inherit; font-size: 1.05rem; font-weight: 600; text-align: left; cursor: pointer; color: var(--c-text);
  background: var(--c-bg); border: 2px solid var(--c-border); border-radius: var(--btn-radius); padding: .85rem 1rem; min-height: 54px;
  display: flex; align-items: center; gap: .75rem; transition: border-color .12s ease, transform .12s ease;
}
.q-answer:hover:not(:disabled) { border-color: var(--c-text); transform: translateY(-1px); }
.q-answer:disabled { cursor: default; }
.q-answers-tf .q-answer { justify-content: center; text-align: center; font-size: 1.2rem; }
.q-answer-img { flex-direction: column; align-items: stretch; text-align: center; padding: .5rem; }
.q-answer-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--c-bg); border-radius: calc(var(--btn-radius) - 4px); }
.q-review-img { display: inline-block; width: 64px; height: auto; vertical-align: middle; border-radius: 4px; }
.q-answer.is-picked { border-color: var(--s, var(--c-primary)); background: color-mix(in srgb, var(--s, var(--c-primary)) 12%, var(--c-surface)); }
.q-answer.is-correct { border-color: #0b7f78; background: color-mix(in srgb, #0b7f78 14%, var(--c-surface)); }
.q-answer.is-wrong { border-color: #c0262d; background: color-mix(in srgb, #c0262d 12%, var(--c-surface)); }
.q-feedback { display: grid; gap: .6rem; justify-items: start; }
.q-verdict { font-weight: 800; font-size: 1.15rem; }
.q-verdict.ok { color: #0b7f78; }
.q-verdict.no { color: #c0262d; }
:root[data-theme=dark] .q-verdict.ok { color: #4fd1c5; }
.q-result { text-align: center; justify-items: center; outline: none; }
.result-label { font-weight: 700; color: var(--c-muted); }
.q-result-title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; }
.q-result-text { max-width: 56ch; font-size: 1.08rem; }
.q-result-img { width: 100%; max-width: 520px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.q-result .share { justify-content: center; }
.q-review { text-align: left; width: 100%; }
.q-review li { margin-bottom: .6rem; }
.qs-list { margin-top: 2rem; }
.qs-list summary, .faq summary, .embed-box summary { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.qs-list ol { padding-left: 1.25rem; display: grid; gap: 1rem; }
.qs-item { list-style: none; }
.qs-text { font-weight: 650; }
.qs-img { max-width: 320px; border-radius: 10px; margin: .4rem 0; }
.qs-answers { padding-left: 1.2rem; color: var(--c-muted); }
.qs-answers img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.quiz-results { margin-top: 2rem; }
.quiz-results h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.quiz-results ul { list-style: none; display: grid; gap: .85rem; }
.quiz-results li p { color: var(--c-muted); }
.result-page { padding-block: 2.5rem 3rem; display: grid; gap: 1.25rem; justify-items: start; }
.result-card { background: var(--c-surface); border: 2px solid var(--ink); border-radius: calc(var(--radius) + 4px); box-shadow: 5px 5px 0 var(--ink); padding: 1.5rem; display: grid; gap: .6rem; width: 100%; }
.result-card img { width: 100%; border-radius: var(--radius); }
.result-card h2 { font-size: 2rem; }

/* ---------------- tools ---------------- */

.tool-box { background: var(--c-surface); border: 2px solid var(--ink); border-radius: calc(var(--radius) + 4px); box-shadow: 5px 5px 0 var(--ink); padding: clamp(1rem, .8rem + 2vw, 2rem); margin-bottom: 2rem; }
.tool-loading { color: var(--c-muted); }
.tool-content { margin-top: 1rem; }
.faq { margin-top: 2rem; max-width: var(--measure); }
.faq h2 { font-size: 1.4rem; margin-bottom: .5rem; }
.faq details { border-bottom: 1.5px solid var(--c-border); }
.faq-a { padding: 0 0 .9rem; color: var(--c-muted); }
.embed-box { margin-top: 1.5rem; padding: .25rem 1rem .9rem; background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius); }
.embed-code { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; padding: .6rem; border-radius: 8px; border: 1.5px solid var(--c-border); background: var(--c-bg); color: var(--c-text); }
.embed-body { background: var(--c-surface); }
.embed-main { padding: 12px; }
.embed-credit { font-size: .8rem; color: var(--c-muted); margin-top: .75rem; }

/* tool-kit controls used inside modules */
.tk-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tk-field { display: grid; gap: .3rem; }
.tk-field label { font-weight: 650; font-size: .95rem; }
.tk-field input, .tk-field select, .tk-field textarea, .tk-input {
  font: inherit; color: var(--c-text); background: var(--c-bg); border: 2px solid var(--c-border); border-radius: var(--btn-radius);
  padding: .6rem .75rem; min-height: 48px; width: 100%;
}
.tk-field textarea { min-height: 140px; resize: vertical; }
.tk-field input:focus, .tk-field select:focus, .tk-field textarea:focus, .tk-input:focus { outline: none; border-color: var(--c-text); }
.tk-hint { font-size: .85rem; color: var(--c-muted); }
.tk-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.tk-seg { display: inline-flex; border: 2px solid var(--c-border); border-radius: 999px; overflow: hidden; }
.tk-seg-btn { font: inherit; font-weight: 650; border: 0; background: transparent; color: var(--c-text); padding: .4rem .9rem; cursor: pointer; min-height: 40px; }
.tk-seg-btn[aria-pressed="true"] { background: var(--c-text); color: var(--c-bg); }
.tk-result { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--c-bg); border: 2px dashed var(--c-border); }
.tk-result:empty { display: none; }
.tk-big { font-family: var(--font-heading); font-weight: 800; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; }
.tk-label { font-weight: 650; color: var(--c-muted); }
.tk-error { color: #c0262d; font-weight: 650; }
.tk-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.tk-confetti i { position: absolute; width: 9px; height: 13px; border-radius: 2px; animation: tk-pop 1.5s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes tk-pop { to { transform: translate(var(--dx), calc(var(--dy) + 520px)) rotate(var(--r)); opacity: 0; } }

/* ---------------- zodiac ---------------- */

.sign-grid { list-style: none; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 2rem; }
.sign-grid-compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin: 0; }
.sign-tile { display: grid; gap: .1rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-text); text-decoration: none; }
.sign-tile:hover { border-color: var(--c-text); }
.sign-symbol { font-size: 1.6rem; line-height: 1; color: var(--el, var(--s-zodiac)); }
.sign-tile[data-element="fire"] { --el: #e2452f; }
.sign-tile[data-element="earth"] { --el: #2f8f4e; }
.sign-tile[data-element="air"] { --el: #3b7fd6; }
.sign-tile[data-element="water"] { --el: #3346c9; }
:root[data-theme=dark] .sign-tile[data-element="water"] { --el: #8fa2ff; }
.sign-name { font-weight: 750; font-family: var(--font-heading); font-size: 1.1rem; }
.sign-dates { font-size: .82rem; color: var(--c-muted); }
.sign-grid-compact .sign-tile { padding: .55rem .7rem; }
.sign-grid-compact .sign-symbol { font-size: 1.2rem; }
.sign-hero { font-size: 3.2rem; line-height: 1; color: var(--s-zodiac); }
:root[data-theme=dark] .sign-hero { color: #8fa2ff; }
.facts { border-collapse: collapse; margin-bottom: 2rem; width: 100%; max-width: 560px; }
.facts th, .facts td { text-align: left; padding: .55rem .75rem; border-bottom: 1.5px solid var(--c-border); }
.facts th { color: var(--c-muted); font-weight: 650; width: 40%; }
.pair-list { list-style: none; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pair-list a { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: 10px; background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-text); text-decoration: none; font-weight: 600; }
.pair-list .sign-symbol { font-size: 1.1rem; }
.pair-score { margin-left: auto; font-size: .85rem; color: var(--c-muted); }
.compat-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.compat-form label { display: grid; gap: .3rem; font-weight: 650; font-size: .92rem; flex: 1 1 140px; }
.compat-form select { font: inherit; min-height: 46px; padding: .4rem .6rem; border-radius: var(--btn-radius); border: 2px solid var(--c-border); background: var(--c-bg); color: var(--c-text); }
.compat-plus { font-weight: 800; font-size: 1.4rem; padding-bottom: .55rem; }
.related .compat-form { flex-direction: column; align-items: stretch; margin-top: 1.25rem; }
.related .compat-plus { display: none; }
.scores { display: grid; gap: .55rem; max-width: 560px; margin-bottom: 2rem; }
.score-row { display: grid; grid-template-columns: 8.75rem 1fr 3.25rem; align-items: center; gap: .75rem; font-weight: 650; }
.score-bar { height: 12px; background: var(--c-border); border-radius: 999px; overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--s-zodiac), var(--c-primary)); border-radius: 999px; }
.compat-table-wrap { overflow-x: auto; margin-block: 1rem 2rem; }
.compat-table { border-collapse: collapse; font-size: .9rem; }
.compat-table th, .compat-table td { padding: .35rem .45rem; text-align: center; border: 1px solid var(--c-border); }
.compat-table th[scope=row] { text-align: left; white-space: nowrap; }
.compat-table td a { display: block; min-width: 1.6rem; color: var(--c-text); text-decoration: none; font-weight: 650; }
.side-links { list-style: none; display: grid; gap: .35rem; }
.row-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.5rem; }

/* ---------------- authors, static pages ---------------- */

.author-head { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; padding-block: 1.5rem 1rem; }
.author-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); }
.author-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ink); }
.author-bio { max-width: 62ch; margin-block: .5rem 1rem; }
.static-page { max-width: 760px; }

/* ---------------- ads ---------------- */

.ad-slot { min-height: var(--ad-hd, 0px); display: grid; place-items: center; margin-block: 1.5rem; position: relative; }
@media (max-width: 727px) { .ad-slot { min-height: var(--ad-hm, 0px); } }
.ad-slot.ad-empty { min-height: 0; margin: 0; }
.ad-slot.ad-filled::before { content: "Advertisement"; position: absolute; top: -1.1rem; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--c-muted); }
.ad-unit { max-width: 100%; overflow: hidden; }
.ad-top .ad-slot { margin-block: 1rem 0; }
.grid-ad { grid-column: 1 / -1; }
.quiz .ad-slot { margin-block: 2.5rem; }

/* ---------------- consent banner ---------------- */

.consent { position: fixed; inset: auto 0 0 0; z-index: 40; padding: 12px; }
.consent-box {
  max-width: 760px; margin: 0 auto; background: var(--c-surface); color: var(--c-text);
  border: 2px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); padding: 1rem 1.25rem; display: grid; gap: .6rem;
}
.consent-title { font-weight: 800; font-family: var(--font-heading); font-size: 1.1rem; }
.consent-box p { font-size: .95rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }

/* ---------------- motion preferences ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.tk-pair input { width: 6.5rem; min-height: 48px; font: inherit; color: var(--c-text); background: var(--c-bg); border: 2px solid var(--c-border); border-radius: var(--btn-radius); padding: .5rem .6rem; }
.tk-pair input:focus { outline: none; border-color: var(--c-text); }
.tk-pair span { color: var(--c-muted); font-weight: 600; }
.tk-pair[hidden] { display: none; }
.tk-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.tk-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: .75rem; font-size: .78rem; text-align: center; }
.tk-scale span { padding: .35rem .2rem; border-radius: 6px; background: var(--c-border); color: var(--c-text); font-weight: 650; }
.tk-scale span.on { background: var(--c-text); color: var(--c-bg); }
.tk-list { display: grid; gap: .4rem; margin-top: .75rem; padding-left: 1.1rem; }
.tk-stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 1rem; }
.tk-stat { background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: 12px; padding: .7rem .85rem; }
.tk-stat strong { display: block; font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.1; }
.tk-stat span { font-size: .85rem; color: var(--c-muted); font-weight: 600; }
