/* Ngaji pages. Tokens in base.css; see docs/DESIGN.md. */
body { min-height: 100%; height: auto; }
.center { text-align: center; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.tag.dark { background: rgb(0 0 0 / 55%); color: #fff; }
.tag.host { background: var(--brand); color: #fff; }

header.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.search { max-width: 460px; margin: 0 auto; }
.search .input { min-height: 38px; border-radius: 99px; }
@media (max-width: 600px) { .brand span { display: none; } }

.avatar {
  --c: var(--brand); display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 700; font-size: 14px;
}
.avatar.big { width: 72px; height: 72px; font-size: 30px; }

main.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 28px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; font-size: 14px; }
.chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.scard { display: grid; gap: 10px; color: inherit; text-decoration: none; }
.sthumb {
  --c: var(--brand); position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 120% at 20% 10%, color-mix(in srgb, var(--c) 85%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 40%, #000) 100%);
  transition: transform .15s;
}
.scard:hover .sthumb { transform: translateY(-2px); }
.sbadges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.smode { position: absolute; right: 12px; bottom: 6px; font-size: 40px; opacity: .9; }
.smeta { align-items: flex-start; }
.stitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.smeta .grow { display: grid; gap: 2px; }

.channels { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.chan { display: grid; justify-items: center; gap: 6px; min-width: 96px; text-decoration: none; color: inherit; text-align: center; font-size: 13px; font-weight: 600; }
.chan .avatar { width: 64px; height: 64px; font-size: 26px; }
.chan.live .avatar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--live); }

.hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero .grow { display: grid; gap: 4px; }

/* Watch page: a dark stage, the side panel beside it (or under it on a phone). */
body.watch { background: #0d0d12; color: #ececf1; color-scheme: dark; }
body.watch header.top { background: rgb(13 13 18 / 92%); border-color: #26262e; }
body.watch .brand { color: #fff; }
body.watch .input, body.watch .btn:not(.primary):not(.live) { background: #1b1b22; border-color: #33333d; color: #ececf1; }
body.watch .muted { color: #a3a3ae; }
body.watch .card { background: #16161c; border-color: #26262e; }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; max-width: 1600px; margin: 0 auto; padding: 16px; }
.stage { display: grid; gap: 14px; align-content: start; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.screen iframe, .screen canvas, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen .over { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c, #4f46e5) 45%, #000), #000 75%); }
.screen .over h2 { font-size: 24px; color: #fff; }
.screen .badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; z-index: 2; pointer-events: none; }
.floaters { position: absolute; right: 18px; bottom: 60px; width: 60px; height: 70%; pointer-events: none; z-index: 2; }
.floaters span { position: absolute; bottom: 0; font-size: 28px; animation: rise 2.4s ease-out forwards; }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1); } 100% { transform: translateY(-320px) translateX(var(--dx, 0)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .floaters { display: none; } }
.pinned-product { position: absolute; left: 12px; bottom: 12px; z-index: 2; max-width: min(360px, 70%); display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgb(255 255 255 / 95%); color: #111; box-shadow: 0 6px 20px rgb(0 0 0 / 35%); }
.pinned-product img, .pthumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #eee; flex: none; display: grid; place-items: center; font-size: 22px; }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.reacts button { min-height: 40px; min-width: 48px; border-radius: 99px; border: 1px solid #33333d; background: #1b1b22; color: #fff; font-size: 18px; cursor: pointer; }
.reacts button:active { transform: scale(.92); }
.reacts small { font-size: 12px; color: #a3a3ae; margin-left: 4px; }

.panel { display: grid; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 90px); position: sticky; top: 74px; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid #26262e; }
.tabs button { flex: 1; min-height: 44px; background: none; border: 0; border-bottom: 2px solid transparent; color: #a3a3ae; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { color: #fff; border-color: var(--brand); }
.tabs button .tag { margin-left: 4px; }
.tabbody { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.scroll { overflow-y: auto; padding: 12px; display: grid; gap: 8px; align-content: start; }
.msg { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.msg b { margin-right: 6px; }
.msg.host b { color: var(--brand); }
.msg .tag { font-size: 10px; padding: 0 6px; margin-right: 4px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #26262e; }
.composer .input { min-height: 40px; }
.notice { padding: 10px 12px; font-size: 13px; color: #a3a3ae; border-top: 1px solid #26262e; }

.product { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: #1b1b22; }
.product.pinned { outline: 2px solid var(--brand); }
.q { padding: 10px; border-radius: 10px; background: #1b1b22; display: flex; gap: 10px; }
.q.pinned { outline: 2px solid var(--brand); }
.q.answered { opacity: .6; }
.vote { min-width: 44px; display: grid; justify-items: center; border-radius: 8px; border: 1px solid #33333d; background: none; color: inherit; cursor: pointer; padding: 4px; }
.vote[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.prog { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.prog.now { background: var(--live-soft); color: #fff; outline: 1px solid var(--live); }
.prog time { min-width: 48px; font-family: var(--mono); color: #a3a3ae; }

@media (max-width: 900px) {
  .watch-grid { grid-template-columns: 1fr; padding: 0 0 16px; gap: 0; }
  .screen { border-radius: 0; }
  .stage > :not(.screen) { padding: 0 14px; }
  .stage { gap: 12px; }
  .panel { position: static; height: 70dvh; margin: 12px 14px 0; }
}

/* Studio */
.studio { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.studio-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.room { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.room .screen { border-radius: 12px; }
.room .panel { height: calc(100dvh - 160px); top: 70px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.room .tabs, .room .composer, .room .notice { border-color: var(--line); }
.room .tabs button { color: var(--ink-2); }
.room .tabs button[aria-selected="true"] { color: var(--ink); }
.room .product, .room .q { background: var(--paper); }
.room .vote { border-color: var(--line-2); }
.room .prog.now { background: var(--live-soft); color: var(--ink); }
.msg.hidden-msg { opacity: .45; text-decoration: line-through; }
.msg .acts { display: none; gap: 4px; margin-left: 6px; }
.msg:hover .acts, .msg:focus-within .acts { display: inline-flex; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.keybox { display: grid; gap: 8px; }
.copy { display: flex; gap: 6px; }
.copy .input { font-family: var(--mono); font-size: 13px; }
@media (max-width: 1000px) { .room { grid-template-columns: 1fr; } .room .panel { position: static; height: 70dvh; } }
