/* ==========================================================
   Shared styles: tokens, toolbar, buttons, modal, portal page
   ========================================================== */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --ink: #1a1f3d;
  --muted: #545a80;
  --line: #cfd3ec;
  --accent: #c2185b;       /* rani pink */
  --accent-ink: #ffffff;
  --gold: #f2b01e;         /* turmeric */
  --indigo: #2a3a8f;

  --c-red: #e0443e;
  --c-green: #2e9e57;
  --c-yellow: #f2b81c;
  --c-blue: #2f6fe0;
  --c-red-soft: #f8cfcc;
  --c-green-soft: #cdebd7;
  --c-yellow-soft: #fbe9ae;
  --c-blue-soft: #cddffa;

  --board-bg: #ffffff;
  --cell: #ffffff;
  --grid: #aeb4de;

  --font-display: 'Baloo Tammudu 2', 'Baloo 2', 'Nirmala UI', 'Noto Sans Telugu', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-body: 'Hind Guntur', 'Hind', 'Nirmala UI', 'Noto Sans Telugu', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1230;
  --surface: #161c46;
  --ink: #eef0ff;
  --muted: #a6acdc;
  --line: #2d3578;
  --accent: #ff5c9a;
  --accent-ink: #1a0610;
  --gold: #ffcf4a;
  --indigo: #8fa0ff;

  --c-red: #ef5a54;
  --c-green: #43b96e;
  --c-yellow: #f7c93a;
  --c-blue: #5b93f2;
  --c-red-soft: #4d2540;
  --c-green-soft: #1d4040;
  --c-yellow-soft: #4a4430;
  --c-blue-soft: #243a78;

  --board-bg: #1b2255;
  --cell: #263070;
  --grid: #3f4aa0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; }

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

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem clamp(.75rem, 3vw, 2rem);
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  text-decoration: none; margin-right: auto; color: var(--ink);
}
.backlink {
  font-weight: 600; text-decoration: none; padding: .25rem .6rem;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--bg);
  white-space: nowrap;
}
.backlink:hover { background: var(--gold); color: #1a1f3d; }
.tools { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.tools select, .iconbtn {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 2px solid var(--ink); border-radius: 10px;
  padding: .25rem .5rem; min-height: 40px; cursor: pointer;
}
.iconbtn { min-width: 42px; font-size: 1.15rem; line-height: 1; }
.tools select:hover, .iconbtn:hover { background: var(--gold); color: #1a1f3d; }

/* thin kolam-style border under the top bar */
.kolam {
  height: 12px;
  background:
    linear-gradient(135deg, var(--accent) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(225deg, var(--accent) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(315deg, var(--gold) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, var(--gold) 25%, transparent 25%) 0 0 / 12px 12px;
  background-color: var(--indigo);
  border-bottom: 2px solid var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  display: inline-block; text-decoration: none; cursor: pointer;
  padding: .65rem 1.4rem; border-radius: 12px;
  border: 2px solid var(--ink); color: var(--accent-ink); background: var(--accent);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.alt { background: var(--surface); color: var(--ink); }
.btn.small { padding: .35rem .9rem; font-size: .95rem; box-shadow: 3px 3px 0 var(--ink); }

/* segmented toggle buttons */
.seg-group { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg {
  font: inherit; font-weight: 600; color: var(--ink); background: transparent;
  border: 0; padding: .35rem .85rem; min-height: 40px; cursor: pointer;
}
.seg + .seg { border-left: 2px solid var(--ink); }
.seg.on { background: var(--ink); color: var(--bg); }
.seg:not(.on):hover { background: var(--gold); color: #1a1f3d; }

/* colour dots */
.dot { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.c-red { --pc: var(--c-red); } .c-green { --pc: var(--c-green); }
.c-yellow { --pc: var(--c-yellow); } .c-blue { --pc: var(--c-blue); }
.dot { background: var(--pc); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(8, 10, 30, .62);
}
.modal-box {
  width: min(440px, 100%); background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink);
  padding: 1.4rem 1.4rem 1.2rem;
}
.modal-box h2 { font-size: 1.9rem; margin-bottom: .6rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

/* ==========================================================
   Portal page
   ========================================================== */
.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }

.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1rem, 4vw, 3rem);
  align-items: center; padding-block: clamp(1.8rem, 5vw, 4rem);
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.9rem); letter-spacing: -.01em; margin-bottom: 1rem; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34rem; margin-bottom: 1.6rem; }
.hero-art { display: block; width: 100%; height: auto; max-width: 440px; justify-self: center; }
.hero-art .grid-line { stroke: var(--grid); stroke-width: .05; }

.section-title { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 1.1rem; }
.games { padding-bottom: clamp(1.5rem, 4vw, 3rem); }

.feature {
  display: grid; grid-template-columns: 170px 1fr; gap: 1.2rem; align-items: center;
  text-decoration: none; background: var(--surface);
  border: 2px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink);
  padding: 1rem; margin-bottom: 1.8rem;
  transition: transform .1s, box-shadow .1s;
}
.feature:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.feature-art {
  aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 14px; display: grid; place-items: center;
  font-size: 3.6rem;
  background: conic-gradient(var(--c-red) 0 25%, var(--c-green) 0 50%, var(--c-yellow) 0 75%, var(--c-blue) 0 100%);
}
.feature-art span { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: .1em .22em; line-height: 1.1; }
.feature h3 { font-size: 1.7rem; margin-bottom: .25rem; }
.feature p { color: var(--muted); margin-bottom: .8rem; }
.feature .meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.badge {
  font-size: .95rem; font-weight: 600; padding: .1rem .7rem; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--gold); color: #1a1f3d;
}

.soon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.soon {
  display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem;
  border: 2px dashed var(--muted); border-radius: 14px; background: transparent;
}
.soon .ico { font-size: 1.9rem; line-height: 1.1; }
.soon h3 { font-size: 1.2rem; }
.soon p { color: var(--muted); font-size: .98rem; margin: .15rem 0 .3rem; line-height: 1.4; }
.soon .tag { font-size: .88rem; font-weight: 600; color: var(--accent); }

.about { background: var(--surface); border-block: 2px solid var(--ink); padding-block: clamp(1.8rem, 4vw, 3rem); }
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(1rem, 4vw, 3rem); align-items: start; }
.about h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.about p { max-width: 60ch; }

.footer { padding: 1.4rem 0 2rem; color: var(--muted); font-size: .98rem; text-align: center; }

/* ---------- cookie banner ---------- */
.cc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  padding: .7rem clamp(.75rem, 3vw, 2rem) calc(.7rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface); color: var(--ink); border-top: 2px solid var(--ink);
}
.cc-text { flex: 1 1 280px; margin: 0; font-size: .95rem; line-height: 1.4; }
.cc-text a { font-weight: 600; }
.cc-actions { display: flex; gap: .5rem; }

/* ---------- footer links + privacy page ---------- */
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin: .4rem 0 0; }
.foot-links a, .linkbtn { color: var(--muted); font: inherit; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.foot-links a:hover, .linkbtn:hover { color: var(--accent); }
.doc { max-width: 70ch; padding-block: clamp(1.2rem, 4vw, 2.5rem); }
.doc h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: .3rem; }
.doc h2 { font-size: 1.4rem; margin: 1.6rem 0 .4rem; }
.doc .updated { color: var(--muted); margin-bottom: 1rem; }
.doc a { color: var(--accent); }

@media (max-width: 520px) {
  .topbar { padding: .35rem .6rem; gap: .4rem; }
  .hide-sm { display: none; }
  .tools select, .iconbtn { min-height: 36px; padding: .1rem .4rem; }
  .iconbtn { min-width: 38px; }
  .backlink { padding: .1rem .65rem; font-size: .95rem; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; order: -1; }
  .feature { grid-template-columns: 1fr; }
  .feature-art { aspect-ratio: 2.2; font-size: 2.8rem; }
  .about-grid { grid-template-columns: 1fr; }
  .brand { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
