/* karambola.app. Each page sets --g-bg / --g-ink / --g-accent on <html> (the game's colours,
   or the house colours on privacy/terms); site.js swaps them on the home page. */
:root {
  --g-bg: #111318;
  --g-ink: #f1f3f7;
  --g-accent: #ffd84d;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --line: color-mix(in srgb, var(--g-ink) 14%, transparent);
  --tint: color-mix(in srgb, var(--g-ink) 7%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--g-bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background: var(--g-bg); color: var(--g-ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background-color .7s var(--ease), color .7s var(--ease);
}
a { color: inherit; }
img { max-width: 100%; }

.glow {
  position: fixed; top: -20vmax; right: -20vmax; width: 70vmax; height: 70vmax; pointer-events: none; z-index: 0; opacity: .7;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--g-accent) 28%, transparent), transparent);
}
header.site, main, footer.site { position: relative; z-index: 1; }

/* Header */
header.site { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 16px; max-width: 1120px; width: 100%; margin: 0 auto; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .02em; text-decoration: none; }
.brand span { color: var(--g-accent); transition: color .7s var(--ease); }
header.site nav { display: flex; gap: 16px; font-size: 14px; }
header.site nav a { text-decoration: none; opacity: .72; }
header.site nav a:hover { opacity: 1; }

main { flex: 1; min-width: 0; max-width: 1120px; width: 100%; margin: 0 auto; padding: 4px 16px 32px; }
.intro { font-size: 15px; font-weight: 400; line-height: 1.5; opacity: .75; margin: 0 0 14px; max-width: 46ch; }

/* Game dock */
.dock { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.dock::-webkit-scrollbar { display: none; }
.tab {
  flex: none; scroll-snap-align: center; position: relative;
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 22px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--g-ink) 6%, transparent);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .3s, border-color .3s, color .3s, transform .2s;
}
.tab img { width: 40px; height: 40px; border-radius: 11px; display: block; }
.tab:hover { transform: translateY(-1px); }
.tab[aria-current], .tab[aria-selected="true"] { background: var(--g-ink); color: var(--g-bg); border-color: var(--g-ink); }
.tab:focus-visible { outline: 3px solid var(--g-accent); outline-offset: 2px; }
.tab .bar { position: absolute; left: 14px; right: 14px; bottom: -6px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--g-ink) 15%, transparent); overflow: hidden; opacity: 0; }
.auto .tab[aria-selected="true"] .bar { opacity: 1; }
.tab .bar i { display: block; height: 100%; width: 0; background: var(--g-accent); }
.auto .tab[aria-selected="true"] .bar i { animation: fill var(--dwell, 9s) linear forwards; }
@keyframes fill { to { width: 100%; } }

/* Spotlight: real gameplay capture in a phone + the game's copy */
.spot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 22px; align-items: center; scroll-margin-top: 16px; }
@media (min-width: 860px) { .spot { grid-template-columns: 360px minmax(0, 1fr); gap: 56px; margin-top: 36px; } }
.home .spots .spot + .spot { margin-top: 64px; }
.js .home .spot { display: none; }
.js .home .spot.on { display: grid; }
.js .home .spot + .spot { margin-top: 22px; }
@media (min-width: 860px) { .js .home .spot + .spot { margin-top: 36px; } }

.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 250px; aspect-ratio: 540 / 1200; box-sizing: content-box; border-radius: 40px; padding: 10px;
  background: #0b0c10; position: relative;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08) inset;
}
@media (min-width: 860px) { .phone { width: 300px; } }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 64px; height: 18px; border-radius: 12px; background: #0b0c10; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: color-mix(in srgb, var(--g-bg) 80%, #000); }
.screen img { display: block; width: 100%; height: 100%; object-fit: cover; }

.copy { min-width: 0; }
.js .home .spot.on .copy > * { animation: rise .5s var(--ease) both; }
.js .home .spot.on .copy > :nth-child(2) { animation-delay: .04s; }
.js .home .spot.on .copy > :nth-child(3) { animation-delay: .08s; }
.js .home .spot.on .copy > :nth-child(4) { animation-delay: .12s; }
.js .home .spot.on .copy > :nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-accent); margin: 0 0 4px; }
.copy h1, .copy h2 { font-size: clamp(32px, 7vw, 52px); line-height: 1.05; margin: 0 0 8px; letter-spacing: -.01em; }
.tagline { font-size: clamp(18px, 3.4vw, 22px); font-weight: 600; margin: 0 0 12px; opacity: .92; }
.blurb { margin: 0 0 16px; opacity: .82; max-width: 56ch; }
.feats { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.feats li { font-size: 14px; padding: 8px 10px; border-radius: 12px; background: var(--tint); display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.feats li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--g-accent); }

.badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; align-items: center; }
.store {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px 0 12px; border-radius: 10px;
  background: #000; color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25);
}
.store.off { opacity: .45; filter: grayscale(1); cursor: default; }
.store svg { width: 22px; height: 22px; fill: #fff; }
.store small { display: block; font-size: 9.5px; line-height: 1; opacity: .8; }
.store b { display: block; font-size: 16px; line-height: 1.15; font-weight: 600; }
.soon { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--g-accent); color: var(--g-bg); }

.facts { padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--line); display: grid; gap: 4px; }
.facts div { display: flex; gap: 8px; }
.facts span:first-child { opacity: .6; width: 18px; flex: none; text-align: center; }
.facts a { font-weight: 600; }
.more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 15px; color: var(--g-accent); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Game page */
.shots { display: flex; gap: 14px; overflow-x: auto; margin: 48px -16px 0; padding: 4px 16px 12px; scroll-snap-type: x mandatory; }
.shots img { flex: none; width: 200px; height: auto; aspect-ratio: 540 / 1200; border-radius: 22px; scroll-snap-align: start; box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .6); border: 1px solid var(--line); }
@media (min-width: 860px) { .shots { justify-content: center; } .shots img { width: 240px; } }
.info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 36px; }
@media (min-width: 700px) { .info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { padding: 18px 20px; border-radius: 18px; background: var(--tint); border: 1px solid var(--line); }
.card h2 { font-size: 18px; margin: 0 0 6px; }
.card p { margin: 0; font-size: 15px; opacity: .88; }

/* Privacy, terms, 404 */
.doc { max-width: 760px; padding-top: 24px; padding-bottom: 64px; }
.doc h1 { font-size: clamp(28px, 6vw, 38px); line-height: 1.15; margin: 0 0 6px; }
.doc h2 { font-size: 21px; margin: 36px 0 8px; scroll-margin-top: 16px; }
.doc h3 { font-size: 17px; margin: 22px 0 4px; }
.doc p, .doc li { opacity: .9; }
.doc li { margin: 4px 0; }
.doc a { color: var(--g-accent); }
.doc .meta { font-size: 14px; opacity: .65; margin: 0 0 20px; }
.doc .lead { font-size: 18px; opacity: .8; }
.doc .summary { padding: 16px 18px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); margin: 20px 0; }
.doc .summary ul { margin: 6px 0 0; padding-left: 20px; }
.doc .toc { columns: 2; column-gap: 24px; font-size: 14.5px; padding-left: 20px; }
@media (max-width: 520px) { .doc .toc { columns: 1; } }
.table { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { opacity: .7; font-weight: 600; }

/* Footer */
footer.site { border-top: 1px solid color-mix(in srgb, var(--g-ink) 12%, transparent); padding: 18px 16px; font-size: 13px; }
footer.site .in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; opacity: .75; }
footer.site .promise { width: 100%; opacity: .85; }

@media (max-width: 420px) {
  .feats { grid-template-columns: minmax(0, 1fr); }
  header.site nav { gap: 12px; }
}
.instant, .instant * { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
