/* TNChatZone public website. Mobile first; light and dark themes. */
:root {
  --bg: #fffaf5; --card: #fff; --soft: #fff1e6; --text: #1d2033; --muted: #5f6478; --line: #f0e3d6;
  --primary: #e8590c; --primary-2: #c2255c; --ink-on-primary: #fff; --ok: #2b8a3e;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14131a; --card: #1e1c26; --soft: #2a1f24; --text: #efeef5; --muted: #a3a7bb; --line: #2e2b3a; --primary: #ff7a3d; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", "Nirmala UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; }
.inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.big-emoji { font-size: 64px; }
.links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Header */
.site-top { border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 20; }
.site-top .inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--primary); }
.main-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.main-nav a:hover, .main-nav a.on { color: var(--text); background: var(--soft); }
@media (max-width: 640px) {
  .site-top .inner { flex-wrap: wrap; gap: 0 10px; padding-top: 8px; }
  .site-top .btn.small { margin-left: auto; }
  .main-nav { order: 3; flex: 0 0 100%; padding: 2px 0 6px; }
  .main-nav a { padding: 6px 10px 6px 0; margin-right: 6px; }
}

/* Buttons */
.btn { display: inline-block; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--ink-on-primary); text-decoration: none;
  border: 0; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.big { padding: 14px 28px; font-size: 18px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

/* Home */
.hero { padding: 64px 0 48px; text-align: center; background: radial-gradient(circle at 50% 0, rgba(232, 89, 12, .14), transparent 60%); }
.eyebrow { color: var(--primary); font-weight: 600; margin: 0 0 8px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); margin: 0 0 16px; }
.hero h1 span { color: var(--primary); }
.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.note { color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding-bottom: 32px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature b { font-size: 32px; }
.feature h2 { font-size: 18px; margin: 8px 0 6px; }
.feature p { margin: 0; color: var(--muted); }
.block { padding-bottom: 36px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.block-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.quiz-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(232, 89, 12, .12), rgba(194, 37, 92, .12)); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; margin-bottom: 36px; }
.quiz-band h2 { margin: 0 0 4px; }
.quiz-band p { margin: 0; color: var(--muted); }

/* Generic page */
.page { padding-top: 16px; padding-bottom: 48px; }
.page h1 { font-size: clamp(26px, 5vw, 38px); margin: 8px 0 8px; }
.page h1 .ta { display: block; font-size: .6em; color: var(--muted); font-weight: 600; }
.lead-sm { color: var(--muted); margin: 0 0 22px; max-width: 680px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs b { font-weight: 500; color: var(--text); }
.crumbs span { margin: 0 4px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; margin-top: 8px; }
.side { position: sticky; top: 76px; display: grid; gap: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .side { position: static; } }

/* Readable article text */
.prose { font-size: 17px; line-height: 1.75; max-width: 720px; }
.prose h2 { font-size: 24px; margin: 1.8em 0 .5em; scroll-margin-top: 80px; }
.prose h3 { font-size: 19px; margin: 1.4em 0 .4em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--primary); background: var(--soft); border-radius: 0 10px 10px 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose img { border-radius: 12px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px; text-align: left; }
.prose:lang(ta), .article:lang(ta) .prose { line-height: 1.9; }
.article { max-width: 760px; }
.article h1 { font-size: clamp(28px, 5vw, 40px); }
.post-meta { color: var(--muted); font-size: 14px; }
.post-meta a { color: var(--muted); }
.cover { border-radius: var(--radius); margin: 8px 0 12px; width: 100%; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 1.2em 0; font-size: 15px; }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; }
.toc a { text-decoration: none; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 28px 0; font-size: 14px; }
.share a, .share button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--text); background: var(--card); font: inherit; cursor: pointer; }

/* Cards and grids */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.game-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.game-icon { font-size: 40px; line-height: 1.1; }
.game-card small { color: var(--muted); font-size: 13px; line-height: 1.4; flex: 1; }
.game-card .play { color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 6px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.post-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: border-color .15s; }
.post-card:hover { border-color: var(--primary); }
.post-card img { border-radius: 10px; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card b { font-size: 18px; line-height: 1.35; }
.post-card small { color: var(--muted); font-size: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  color: var(--text); text-decoration: none; font-size: 15px; }
.chip-link:hover { border-color: var(--primary); }
.chips-row.big .chip-link { padding: 10px 16px; font-weight: 600; }
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.room-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: left; }
.room-card > span { font-size: 28px; }
.room-card b { display: block; }
.room-card small { color: var(--muted); font-size: 13px; }
.tabs-row { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 4px; }
.tabs-row a { white-space: nowrap; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.tabs-row a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 24px; }

/* Game embed */
.game-frame { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #15121f; max-width: 480px; margin: 8px 0 8px; }
.game-frame iframe { display: block; width: 100%; height: min(760px, 82vh); border: 0; }
.game-links { font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.game-links span { color: var(--muted); }

/* Quiz Q&A list */
.qa { padding-left: 1.4em; }
.qa > li { margin: 0 0 18px; }
.qa .opts { list-style: none; padding: 0; margin: 6px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px 16px; color: var(--muted); font-size: 15px; }
.qa details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; }
.qa details p { margin: 4px 0; font-weight: 600; }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Call to action */
.app-cta { margin-top: 32px; padding: 24px; border-radius: 18px; text-align: center;
  background: linear-gradient(135deg, rgba(232, 89, 12, .12), rgba(194, 37, 92, .12)); border: 1px solid var(--line); }
.app-cta h2 { margin-top: 0; }
.app-cta p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.app-cta.small { margin: 0; padding: 18px; text-align: left; }
.app-cta.small b { display: block; margin-bottom: 6px; }
.app-cta.small p { margin: 6px 0 12px; font-size: 15px; }
.app-cta .room-card { margin-bottom: 8px; }
.ad { margin: 24px 0; min-height: 90px; text-align: center; }

/* Legal pages and forms */
.doc { padding-top: 32px; padding-bottom: 48px; max-width: 760px; }
.doc h1 { font-size: 32px; margin-bottom: 4px; }
.doc h2 { font-size: 20px; margin-top: 32px; }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form label { display: block; margin-bottom: 14px; font-weight: 600; }
.form input, .form textarea { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.hp { position: absolute; left: -9999px; }
.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.notice.ok { background: #d3f9d8; color: #1b4d26; }
.notice.err { background: #ffe3e3; color: #7a1c1c; }
.notice.warn { background: #fff3bf; color: #5c4400; }
.safety p { color: var(--muted); }
.games-page { padding-top: 16px; padding-bottom: 48px; }
.games-page h1 { font-size: clamp(28px, 5vw, 40px); margin: 8px 0 6px; }

/* "Install the app" banner on Android */
.app-banner { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 30; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.app-banner[hidden] { display: none; }
.app-banner > span { font-size: 28px; }
.app-banner div { flex: 1; line-height: 1.25; }
.app-banner small { display: block; color: var(--muted); font-size: 13px; }
.app-banner button { border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 4px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 80px; font-size: 14px; color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 16px; }
.foot-cols b { display: block; color: var(--text); margin-bottom: 6px; }
.foot-cols a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.foot-cols a:hover { color: var(--primary); }
.qa details p.explain { font-weight: 400; color: var(--muted); font-size: 15px; }

/* More apps (/more-apps) */
.more-section { margin: 8px 0 28px; }
.more-section h2 { font-size: 22px; margin: 0 0 12px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.more-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; min-width: 0; }
.more-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.more-icon { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--soft); display: grid; place-items: center; font-size: 30px; overflow: hidden; }
.more-icon img { width: 100%; height: 100%; object-fit: cover; }
.more-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.more-body b { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.more-body small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.more-body .go { color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 4px; }
.more-badge { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--primary); color: var(--ink-on-primary); }
