/* KheloAdda — design tokens */
:root {
  --ink: #1E1546;
  --ink-2: #3B3166;
  --ink-soft: #6A6290;
  --paper: #F5F6FB;
  --card: #FFFFFF;
  --marigold: #FFB627;
  --rose: #EC3F74;
  --peacock: #0B8A8F;
  --leaf: #3BAA4A;
  --sky: #2D7FF9;
  --line: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-lg: 6px 6px 0 var(--ink);
  --r-tile: 18px;
  --r-btn: 14px;
  --r-panel: 24px;
  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Hind", "Segoe UI", system-ui, sans-serif;
  --wrap: 1240px;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--marigold); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 700; z-index: 100; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

/* ---------- Header ---------- */
.top {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 40;
}
.top-row { display: flex; align-items: center; gap: 14px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-mark { width: 40px; height: 40px; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; color: #fff; padding-top: 4px; }
.logo-word b { color: var(--marigold); font-weight: 800; }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 44px; border-radius: 999px; border: 2px solid transparent;
  background: var(--ink-2); color: #fff; padding: 0 16px 0 44px; font: inherit; font-size: 16px;
}
.search input::placeholder { color: #B9B3DA; }
.search input:focus { outline: none; border-color: var(--marigold); background: #2A2058; }
.search svg { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; color: #B9B3DA; pointer-events: none; }
.suggest {
  position: absolute; top: 52px; left: 0; right: 0; background: var(--card); color: var(--ink);
  border: var(--line); border-radius: var(--r-btn); box-shadow: var(--pop); padding: 6px; list-style: none; margin: 0; display: none;
}
.suggest.open { display: block; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: #FFF1CF; }
.suggest .mini { width: 52px; height: 39px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 2px solid var(--ink); }
.suggest .empty { padding: 10px; color: var(--ink-soft); }

/* Truck-art fringe (jhalar) — the signature element */
.jhalar {
  height: 16px;
  background:
    linear-gradient(135deg, var(--ink) 25%, transparent 25%) 0 0 / 32px 16px,
    linear-gradient(225deg, var(--ink) 25%, transparent 25%) 0 0 / 32px 16px,
    repeating-linear-gradient(90deg, var(--rose) 0 32px, var(--marigold) 32px 64px, var(--peacock) 64px 96px, var(--leaf) 96px 128px);
}

/* Category rail */
.rail { background: var(--card); border-bottom: 2px solid #E3E1EF; }
.rail-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.rail-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 40px; padding: 0 16px 0 10px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--card); text-decoration: none; font-weight: 600; font-size: 15.5px; white-space: nowrap;
}
.chip svg { width: 22px; height: 22px; }
.chip:hover { background: #FFF1CF; }
.chip[aria-current="page"] { background: var(--ink); color: #fff; }
.chip[aria-current="page"] svg { color: var(--marigold); }

/* ---------- Home hero ---------- */
.hero { padding-top: 26px; padding-bottom: 8px; }
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.hero-main {
  position: relative; display: block; border: var(--line); border-radius: var(--r-panel); overflow: hidden;
  box-shadow: var(--pop-lg); text-decoration: none; background: var(--ink); aspect-ratio: 4 / 3;
}
.hero-main .art { position: absolute; inset: 0; }
.hero-main .art svg, .hero-main .art img { width: 100%; height: 100%; object-fit: cover; }
.hero-main .caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 24px 22px;
  background: linear-gradient(to top, rgba(30,21,70,.95) 30%, rgba(30,21,70,0));
  color: #fff;
}
.hero-main h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.hero-main p { margin: 6px 0 14px; max-width: 46ch; color: #E6E2FA; font-size: 1.05rem; }
.hero-side { display: grid; gap: 18px; grid-template-rows: 1fr 1fr; }
.hero-side .tile { height: 100%; }
.hero-side .tile .thumb { aspect-ratio: auto; height: 100%; }
.hero-side { min-height: 0; }
.hero-side .tile { min-height: 0; }
.hero-side .tile .thumb > img { position: absolute; inset: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: var(--r-btn); border: var(--line);
  background: var(--marigold); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  text-decoration: none; cursor: pointer; box-shadow: var(--pop); transition: transform .12s, box-shadow .12s;
}
.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 svg { width: 20px; height: 20px; }
.btn.ghost { background: var(--card); }
.btn.green { background: #25D366; }

/* ---------- Sections & tiles ---------- */
.section { padding-top: 26px; padding-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head a { font-weight: 600; color: var(--ink-soft); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.section-head a:hover { color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.grid.big-first > .tile:first-child { grid-column: span 2; grid-row: span 2; }
.grid.big-first > .tile:first-child h3 { font-size: 1.5rem; }

.tile { position: relative; display: block; text-decoration: none; border-radius: var(--r-tile); }
.tile .thumb {
  position: relative; aspect-ratio: 4 / 3; border: var(--line); border-radius: var(--r-tile); overflow: hidden;
  background: #fff; box-shadow: var(--pop); transition: transform .14s ease, box-shadow .14s ease;
}
.tile .thumb > svg, .tile .thumb > img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover .thumb, .tile:focus-visible .thumb { transform: translate(-2px, -3px); box-shadow: 6px 7px 0 var(--ink); }
.tile .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(30,21,70,.92), rgba(30,21,70,0)); color: #fff;
}
.tile .name h3 { font-size: 1.08rem; }
.tile .tag {
  position: absolute; top: 10px; left: 10px; z-index: 2; font-family: var(--font-display); font-weight: 800; font-size: 13px;
  padding: 3px 10px 1px; border-radius: 999px; border: 2px solid var(--ink); background: var(--marigold); color: var(--ink);
}
.tile .tag.soon { background: #fff; }

.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 16px; overflow-x: auto; padding: 4px 8px 12px 2px; scrollbar-width: thin; }

/* ---------- Ads ---------- */
.ad { width: 100%; max-width: calc(var(--wrap) - 2 * var(--gutter)); margin: 22px auto; text-align: center; }
.wrap .ad { max-width: none; }
main > .ad { width: calc(100% - 2 * var(--gutter)); }
.ad.side { width: 300px; margin: 0; }
.ad small { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.ad .dev-ad {
  display: grid; place-items: center; min-height: 100px; border: 2px dashed #B9B3DA; border-radius: 12px; color: var(--ink-soft);
  font-size: 14px; background: repeating-linear-gradient(45deg, #fff 0 10px, #F7F6FC 10px 20px);
}
.ad.side .dev-ad { min-height: 600px; }

/* ---------- Game page ---------- */
.crumbs { font-size: 14.5px; color: var(--ink-soft); padding: 16px 0 10px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: inherit; text-underline-offset: 3px; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.stage {
  position: relative; border: var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--ink);
  box-shadow: var(--pop-lg); aspect-ratio: 16 / 9;
}
.stage.portrait { aspect-ratio: auto; height: min(78vh, 760px); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage .cover { position: absolute; inset: 0; display: grid; place-items: center; }
.stage .cover .bg { position: absolute; inset: 0; }
.stage .cover .bg svg, .stage .cover .bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px) saturate(1.1); transform: scale(1.06); }
.stage .cover::after { content: ""; position: absolute; inset: 0; background: rgba(30,21,70,.45); }
.stage .cover-inner { position: relative; z-index: 2; text-align: center; color: #fff; padding: 20px; display: grid; justify-items: center; gap: 14px; }
.stage .cover-thumb { width: 168px; aspect-ratio: 4/3; border: var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--pop); background: #fff; }
.stage .cover-thumb svg, .stage .cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stage .cover-title { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.05; font-size: clamp(1.7rem, 4vw, 2.6rem); text-shadow: 0 2px 0 var(--ink); }
.stage .play-btn { height: 60px; padding: 0 34px; font-size: 1.35rem; }
.stage .soon-note { max-width: 40ch; color: #EFEBFF; margin: 0; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.stage-bar .title { margin-right: auto; }
.stage-bar .title h1, .stage-bar .title h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.stage-bar .title p { margin: 2px 0 0; color: var(--ink-soft); }
.stage-bar .btn { height: 44px; font-size: 1rem; padding: 0 16px; box-shadow: 3px 3px 0 var(--ink); }
.stage:fullscreen { border: 0; border-radius: 0; }

/* Full-screen game on phones */
.stage.immersive {
  position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh;
  aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; margin: 0;
}
html.game-open, html.game-open body { overflow: hidden; overscroll-behavior: none; }
.exit-game {
  position: fixed; z-index: 1001; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px;
  border: 2px solid rgba(255,255,255,.85); border-radius: 999px; background: rgba(30,21,70,.72); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.exit-game svg { width: 14px; height: 14px; }

.modes { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.mode {
  display: grid; gap: 2px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: var(--r-btn); background: var(--card);
  text-decoration: none; min-width: 150px;
}
.mode strong { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; }
.mode span { font-size: 14px; color: var(--ink-soft); line-height: 1.35; }
.mode:hover { background: #FFF1CF; }
.mode[aria-current="page"] { background: var(--ink); color: #fff; }
.mode[aria-current="page"] span { color: #D8D3F2; }

.about { margin-top: 28px; display: grid; gap: 26px; }
.panel { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-panel); padding: 24px; }
.panel h2 { margin-bottom: 12px; }
.prose > p, .prose > ol { max-width: 70ch; }
.steps { margin: 0; padding-left: 1.4em; }
.steps li { margin-bottom: 8px; padding-left: 4px; }
.steps li::marker { font-family: var(--font-display); font-weight: 800; color: var(--rose); }
.controls { width: 100%; border-collapse: collapse; }
.controls th, .controls td { text-align: left; padding: 10px 0; border-bottom: 2px solid #ECEAF5; vertical-align: top; }
.controls th { font-weight: 600; width: 42%; padding-right: 16px; }
.controls tr:last-child th, .controls tr:last-child td { border-bottom: 0; }
.faq details { border-bottom: 2px solid #ECEAF5; padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; line-height: 1; color: var(--rose); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tags a { font-size: 14.5px; padding: 4px 12px; border-radius: 999px; background: #ECEAF5; text-decoration: none; font-weight: 600; }
.tags a:hover { background: #FFF1CF; }

.side-col { position: sticky; top: 90px; display: grid; gap: 18px; }
.side-col h2 { font-size: 1.25rem; }
.side-list { display: grid; gap: 12px; }
.side-list a { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; text-decoration: none; font-weight: 600; line-height: 1.25; }
.side-list .mini { aspect-ratio: 4/3; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.side-list .mini svg, .side-list .mini img { width: 100%; height: 100%; object-fit: cover; }
.side-list small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.side-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Category / content pages ---------- */
.page-head { padding-top: 30px; padding-bottom: 8px; }
.page-head p { max-width: 62ch; color: var(--ink-2); margin-top: 10px; font-size: 1.08rem; }
.content { padding-top: 30px; padding-bottom: 40px; }
.content .prose h2 { margin: 28px 0 10px; font-size: 1.4rem; }
.content .prose a { text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.foot { margin-top: 48px; background: var(--ink); color: #D8D3F2; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 34px 0 20px; }
.foot h2 { font-size: 1.1rem; color: #fff; margin-bottom: 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot .fine { border-top: 1px solid var(--ink-2); padding: 16px 0 26px; font-size: 14px; color: #A9A2CF; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .game-layout { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .ad.side { display: none; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .hero-side .tile .thumb { aspect-ratio: 4/3; height: auto; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  /* Tall game box on phones, so the cover and the game aren't squashed into a thin strip */
  .stage, .stage.portrait { aspect-ratio: auto; height: min(68svh, 600px); min-height: 420px; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .top-row { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero-main { aspect-ratio: auto; min-height: 320px; }
  .hero-main .caption { padding: 60px 16px 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .grid.big-first > .tile:first-child { grid-row: span 1; }
  .tile .name h3 { font-size: 1rem; }
  .stage { border-radius: 18px; }
  .stage.portrait { height: 74vh; }
  .stage .cover-thumb { width: 130px; }
  .panel { padding: 18px; border-radius: 18px; }
  .stage-bar .title { flex-basis: 100%; }
  .ad-gameTop { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
