@import url('https://fonts.googleapis.com/css2?family=Tiro+Devanagari+Marathi&family=Mukta:wght@400;500;600;700;800&display=swap');

:root {
  --maroon: #6e1111; --maroon-2: #4a0b0b; --maroon-3: #2a0606;
  --saffron: #f2771a; --saffron-2: #c2410c; --gold: #f7c548; --gold-2: #e7a92b;
  --cream: #fff8ee; --cream-2: #fdecd2; --ink: #3a1a0c; --muted: #8a6a55; --line: #f0d9b8;
  --green: #1f9d55; --red: #d92d20;
  --radius: 18px; --shadow: 0 10px 30px -12px rgba(110, 17, 17, .35);
  --font: 'Mukta', 'Noto Sans', system-ui, sans-serif; --display: 'Tiro Devanagari Marathi', 'Mukta', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--saffron-2); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0 0 .4em; }
.container { width: min(1200px, 92vw); margin: 0 auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: 600 15px var(--font);
  padding: 11px 22px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--saffron), var(--saffron-2));
  box-shadow: 0 6px 18px -6px rgba(194, 65, 12, .7); transition: transform .15s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(194, 65, 12, .8); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.gold { background: linear-gradient(135deg, #ffd978, var(--gold-2)); color: var(--maroon-2); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.dark { background: var(--maroon); }
.btn.green { background: linear-gradient(135deg, #2bb673, var(--green)); box-shadow: none; }
.btn.red { background: linear-gradient(135deg, #f04438, var(--red)); box-shadow: none; }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn.xs { padding: 4px 10px; font-size: 12.5px; box-shadow: none; }
.btn.lg { padding: 15px 30px; font-size: 17px; }
input, select, textarea { font: 16px var(--font); color: var(--ink); width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(242, 119, 26, .15); }
input[type=checkbox] { width: auto; accent-color: var(--saffron-2); transform: scale(1.15); }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- header ---------- */
#site-header { position: sticky; top: 0; z-index: 50; background: rgba(42, 6, 6, .88); backdrop-filter: blur(12px); color: #ffe9c2; border-bottom: 1px solid rgba(247, 197, 72, .2); }
.nav-inner { width: min(1200px, 94vw); margin: 0 auto; display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: #ffe9c2; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 23px; display: block; line-height: 1; color: var(--gold); }
.brand small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; opacity: .65; }
.brand.small b { font-size: 18px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-links > a:not(.btn) { color: #ffe9c2; font-weight: 500; opacity: .85; }
.nav-links > a.active, .nav-links > a:hover { opacity: 1; color: var(--gold); }
.lang-select { width: auto; padding: 6px 30px 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #ffe9c2; border: 1px solid rgba(247, 197, 72, .35); font-size: 14px; }
.lang-select option { color: var(--ink); }
.user-chip { font-size: 14px; opacity: .9; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--gold); font-size: 26px; cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #ffeccc; padding: 90px 0 110px;
  background: radial-gradient(ellipse at 70% 30%, #a3261a 0%, transparent 55%), radial-gradient(ellipse at 20% 90%, #7a1d0a 0%, transparent 50%), linear-gradient(160deg, var(--maroon) 0%, var(--maroon-3) 100%); }
.hero .mandala { position: absolute; right: -180px; top: 50%; width: 720px; height: 720px; transform: translateY(-50%); opacity: .22; animation: spin 120s linear infinite; }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.2vw, 64px); color: #fff3d6; text-shadow: 0 4px 30px rgba(247, 197, 72, .25); }
.hero h1 .gold { color: var(--gold); }
.hero p.lead { font-size: 19px; opacity: .88; max-width: 560px; margin-bottom: 30px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  background: rgba(247, 197, 72, .1); border: 1px solid rgba(247, 197, 72, .3); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero-card { position: relative; border-radius: 26px; padding: 14px; background: linear-gradient(145deg, rgba(247, 197, 72, .35), rgba(247, 197, 72, .05)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.hero-card .screen { aspect-ratio: 16/10; border-radius: 16px; overflow: hidden; background: #160303; position: relative; display: grid; place-items: center; }
.hero-card .screen video { width: 100%; height: 100%; object-fit: cover; }
.diya-glow { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, rgba(255, 170, 60, .45), transparent 55%); }
.diya { width: 110px; filter: drop-shadow(0 0 30px rgba(255, 180, 60, .8)); }
.flame { transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, .94) rotate(2deg); } }
.toran { position: absolute; left: 0; right: 0; bottom: -1px; height: 40px; background: var(--cream);
  -webkit-mask: radial-gradient(22px at 50% 0, transparent 98%, #000) 50% / 44px 100%; mask: radial-gradient(22px at 50% 0, transparent 98%, #000) 50% / 44px 100%; }

/* ---------- sections & cards ---------- */
section.block { padding: 70px 0 30px; }
.section-head { display: flex; align-items: end; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); color: var(--maroon); margin: 0; }
.section-head .orn { height: 2px; flex: 1; background: linear-gradient(90deg, var(--gold), transparent); margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.card.pad { padding: 22px; }
.stream-card { display: block; color: inherit; transition: transform .2s, box-shadow .2s; }
.stream-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -18px rgba(110, 17, 17, .5); }
.thumb { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--maroon), #a3261a 60%, var(--saffron)); display: grid; place-items: center; overflow: hidden; }
.thumb img.poster { width: 100%; height: 100%; object-fit: cover; }
.thumb .temple-icon { width: 70px; opacity: .9; }
.thumb .badge { position: absolute; top: 12px; left: 12px; }
.thumb .count { position: absolute; bottom: 10px; right: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.stream-card .info { padding: 14px 18px 18px; }
.stream-card h3 { font-size: 20px; margin: 0 0 2px; color: var(--maroon); }
.stream-card .meta { font-size: 14px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: #eee; color: #555; }
.badge.live { background: var(--red); color: #fff; }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.badge.starting, .badge.waiting { background: #fff3cd; color: #8a5a00; }
.badge.error { background: #fde2e1; color: var(--red); }
.badge.ready { background: #dcf5e7; color: var(--green); }
.badge.processing { background: #e7eefc; color: #2759c4; }
@keyframes pulse { 50% { opacity: .3; } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .5); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { padding: 26px 22px; border-radius: var(--radius); background: linear-gradient(180deg, #fff, var(--cream-2)); border: 1px solid var(--line); }
.feature .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(135deg, var(--maroon), #a3261a); margin-bottom: 14px; box-shadow: 0 8px 18px -8px var(--maroon); }
.feature h3 { font-size: 20px; color: var(--maroon); }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }
.cta-band { margin: 60px auto; padding: 40px; border-radius: 28px; color: #ffecc8; background: linear-gradient(120deg, var(--maroon), #9c2a12); display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band h2 { color: var(--gold); margin: 0; }

#site-footer { background: var(--maroon-3); color: #d9bfa0; padding: 30px 0; margin-top: 50px; }
.foot-inner { width: min(1200px, 92vw); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.foot-inner p { margin: 0; font-size: 14px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #ffecc8; padding: 60px; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(circle at 30% 70%, rgba(255, 160, 60, .35), transparent 50%), linear-gradient(160deg, var(--maroon), var(--maroon-3)); }
.auth-art .mandala { position: absolute; width: 560px; left: -160px; bottom: -200px; opacity: .2; animation: spin2 140s linear infinite; }
@keyframes spin2 { to { transform: rotate(360deg); } }
.auth-art h2 { font-size: 42px; color: var(--gold); position: relative; }
.auth-art p { position: relative; font-size: 18px; opacity: .85; max-width: 420px; }
.auth-form { display: grid; place-items: center; padding: 40px 20px; }
.auth-form form { width: min(440px, 100%); }
.auth-form h1 { font-size: 34px; color: var(--maroon); }
.form-error { background: #fde2e1; color: var(--red); padding: 10px 14px; border-radius: 10px; margin-top: 14px; font-size: 14.5px; }

/* ---------- watch ---------- */
body.theater { background: #140404; color: #f5e2c8; }
body.theater #site-footer { margin-top: 0; }
.watch-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; padding: 22px 0 40px; }
.player-shell { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 16/9; box-shadow: 0 30px 70px -30px #000; }
.player-shell video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.player-shell.grid-mode { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 3px; background: #111; }
.player-shell.grid-mode .tile { position: relative; cursor: pointer; }
.player-shell.grid-mode .tile video { object-fit: cover; }
.tile .tile-label { position: absolute; left: 8px; bottom: 8px; font-size: 13px; background: rgba(0, 0, 0, .6); padding: 2px 10px; border-radius: 999px; color: #fff; }
.overlay-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 5; pointer-events: none; }
.overlay-top > * { pointer-events: auto; }
.chip { background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; padding: 4px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
.captions-overlay { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); max-width: 88%; text-align: center; z-index: 6; pointer-events: none; }
.captions-overlay span { display: inline; background: rgba(0, 0, 0, .72); color: #fff; font-size: clamp(15px, 2.1vw, 24px); line-height: 1.6; padding: 3px 12px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.captions-overlay span.interim { opacity: .75; }
.center-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; z-index: 4;
  background: radial-gradient(circle at 50% 55%, rgba(255, 150, 50, .25), transparent 55%), #1a0505; color: #ffe2b8; }
.center-msg .diya { width: 90px; margin-bottom: 14px; }
.unmute { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 7; }
.controls-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.controls-bar select { width: auto; background: #2a0b0b; color: #f5e2c8; border-color: #5a2020; padding: 8px 12px; font-size: 14px; }
.ctl-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.watch-title h1 { font-size: clamp(24px, 3vw, 34px); color: var(--gold); margin: 18px 0 4px; }
.side-panel { background: #220707; border: 1px solid #4a1515; border-radius: 18px; padding: 18px; align-self: start; }
.side-panel h3 { font-size: 18px; color: var(--gold); }
.cam-list { display: grid; gap: 10px; margin-bottom: 18px; }
.cam-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid #4a1515; cursor: pointer; background: #2d0a0a; color: #f5e2c8; text-align: left; font: inherit; }
.cam-item.active { border-color: var(--gold); background: #3d1208; }
.cam-item .mini { width: 92px; aspect-ratio: 16/9; border-radius: 8px; background: linear-gradient(135deg, #5a1414, #a3261a); display: grid; place-items: center; font-size: 22px; overflow: hidden; flex-shrink: 0; }
.cam-item .mini img { width: 100%; height: 100%; object-fit: cover; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row .btn { flex: 1; }
.btn.wa { background: #25d366; box-shadow: none; }
.reactions { display: flex; gap: 6px; margin-top: 16px; }
.reactions button { font-size: 22px; background: #2d0a0a; border: 1px solid #4a1515; border-radius: 12px; padding: 6px 10px; cursor: pointer; transition: transform .1s; }
.reactions button:active { transform: scale(1.3); }
.float-emoji { position: absolute; bottom: 60px; font-size: 30px; z-index: 8; pointer-events: none; animation: floatUp 3s ease-out forwards; }
@keyframes floatUp { to { transform: translateY(-260px) scale(1.4); opacity: 0; } }
.video-cards .stream-card { background: #220707; border-color: #4a1515; }
.video-cards .stream-card h3 { color: var(--gold); }

/* ---------- admin ---------- */
.admin-wrap { padding: 28px 0 60px; }
.admin-wrap h1 { color: var(--maroon); font-size: 34px; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin: 10px 0 22px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; font: 600 15.5px var(--font); color: var(--muted); padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.active { color: var(--maroon); border-color: var(--saffron); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { padding: 18px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 30px; color: var(--maroon); line-height: 1.1; }
.stat span { font-size: 13.5px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--cream); position: sticky; top: 0; }
tr:hover td { background: #fffaf2; }
.table-wrap { max-height: 560px; overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.studio-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.channel-list { display: grid; gap: 8px; }
.channel-btn { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.channel-btn.active { border-color: var(--saffron); background: #fff4e6; }
.channel-btn b { display: block; color: var(--maroon); }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.source-card { padding: 0; }
.source-card .preview { aspect-ratio: 16/9; background: #1a0505; position: relative; }
.source-card .preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.source-card .preview .badge { position: absolute; top: 10px; left: 10px; }
.source-card .preview .main-flag { position: absolute; top: 10px; right: 10px; background: var(--gold); color: var(--maroon-2); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.source-card .body { padding: 14px 16px; display: grid; gap: 10px; }
.source-card .body select { padding: 7px 10px; font-size: 14px; }
.source-card h4 { margin: 0; font-size: 16.5px; color: var(--maroon); }
.kv { font-size: 13px; background: var(--cream); border: 1px dashed var(--line); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
.kv code { font-size: 12.5px; }
.add-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(30, 5, 5, .6); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 20px; padding: 26px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px -20px #000; }
.modal h3 { color: var(--maroon); font-size: 24px; }
.progress { height: 8px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), var(--gold)); width: 0; transition: width .3s; }
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-group label { margin: 0; display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; background: #fff; font-weight: 500; }
.pill-group label:has(input:checked) { border-color: var(--saffron); background: #fff4e6; }
.result-list { max-height: 280px; overflow: auto; font-size: 14px; }
.result-list .r { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.caption-box { padding: 10px 14px; background: #1a0505; color: #fff; border-radius: 12px; min-height: 46px; font-size: 15px; }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--maroon-2); color: #ffe9c2; padding: 11px 20px; border-radius: 999px; box-shadow: 0 10px 30px -10px #000; transition: opacity .4s, transform .4s; font-weight: 500; }
.toast.err { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .auth-wrap, .watch-layout, .studio-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .auth-art { display: none; }
  .hero { padding: 60px 0 90px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 18px; gap: 14px; background: var(--maroon-3); border-bottom: 1px solid rgba(247, 197, 72, .3); }
  body.nav-open .nav-links { display: flex; }
  .features { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .player-shell { border-radius: 0; margin: 0 -4vw; }
  .watch-layout { padding-top: 0; }
}
