/*
VOICE  festive, loud-but-warm — a shaadi sangeet at night
IDEA   a decorated living-room TV during a Diwali party: toran garland, rangoli, diya glow
PICTURE marigold toran across the top of every screen, rangoli medallion behind the lobby
COLOUR deep maroon-magenta ground, marigold + saffron lead, peacock teal and rani pink accents
TYPE   Baloo 2 for everything shouted, Mukta for small print
*/
@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Mukta:wght@400;600&display=swap");
:root {
  --bg: #3a0824; --bg2: #521035; --card: #661841; --card2: #7a2050; --line: #9a3366;
  --marigold: #ffb81c; --saffron: #ff7a1a; --rani: #ff4f9a; --teal: #17b2a8; --green: #3fcf6e; --red: #ff4d4d;
  --ink: #fff4e0; --muted: #f3c4d6;
  --display: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; min-width: 0; }
html, body { height: 100%; }
body { font-family: "Mukta", system-ui, sans-serif; background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, button, .brand, .big { font-family: var(--display); }
button { font: inherit; font-family: var(--display); cursor: pointer; border: 0; border-radius: 14px; color: #3a0824; background: var(--marigold); font-weight: 800; padding: 12px 18px; box-shadow: 0 4px 0 #b9790a; transition: transform .08s, box-shadow .08s; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9790a; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
button.ghost { background: transparent; color: var(--muted); border: 2px solid var(--line); box-shadow: none; }
.muted { color: var(--muted); }
.brand { font-weight: 800; }
.brand span { color: var(--marigold); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 600; }
.chip.off { opacity: .4; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.off .dot { background: var(--red); box-shadow: none; }
.timer { height: 12px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.timer > div { height: 100%; background: linear-gradient(90deg, var(--saffron), var(--marigold)); width: 100%; transition: width .25s linear; }
.score-row { display: flex; justify-content: space-between; padding: 7px 14px; border-radius: 12px; background: var(--card); margin-bottom: 7px; font-weight: 600; }
.score-row:first-child { background: linear-gradient(90deg, #8a5a00, var(--card)); }
.score-row span:last-child { font-variant-numeric: tabular-nums; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 70% { transform: scale(1.06) } 100% { transform: scale(1); opacity: 1 } }
.pop { animation: pop .45s ease-out both; }
@keyframes sway { 0%,100% { transform: rotate(-1.2deg) } 50% { transform: rotate(1.2deg) } }
@media (prefers-reduced-motion: reduce) { .pop, .toran g.strand { animation: none !important; } }
.role-raja { --rc: #ffb81c; } .role-mantri { --rc: #17b2a8; } .role-chor { --rc: #ff4d4d; } .role-sipahi { --rc: #7fb0ff; }

/* ---------- Toran (marigold garland) ---------- */
.toran { display: block; width: 100%; height: 100%; pointer-events: none; }
.toran g.strand { transform-origin: top center; transform-box: fill-box; animation: sway 4s ease-in-out infinite; }

/* ---------- TV (fixed 1280×720 stage, scaled to fit) ---------- */
.tv-fit { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; }
.tv { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; font-size: 20px; overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, #7a1a4e 0%, var(--bg) 60%), var(--bg); }
.tv .tv-toran { position: absolute; left: 0; right: 0; top: 0; height: 78px; z-index: 2; }
.tv .rangoli { position: absolute; right: -150px; bottom: -170px; width: 560px; opacity: .16; z-index: 0; }
.tv .app { position: relative; z-index: 1; height: 100%; padding: 96px 56px 24px; display: flex; flex-direction: column; gap: 16px; }
.tv header { display: flex; justify-content: space-between; align-items: center; }
.tv header .brand { font-size: 38px; }
.tv .code { font-size: 22px; } .tv .code b { color: var(--marigold); letter-spacing: 4px; font-size: 30px; font-family: var(--display); }
.tv main { flex: 1; min-height: 0; display: flex; gap: 36px; }
.tv .col { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tv .center { align-items: center; justify-content: center; text-align: center; }
.tv h1 { font-size: 52px; line-height: 1.05; text-wrap: balance; }
.tv h2 { font-size: 32px; line-height: 1.1; }
.tv .qrbox { background: #fff; padding: 12px; border-radius: 20px; width: 300px; border: 6px solid var(--marigold); box-shadow: 0 0 0 6px var(--rani); }
.tv .qrbox img { width: 100%; display: block; }
.tv .games { display: grid; gap: 12px; }
.tv .game { display: flex; gap: 18px; align-items: center; background: var(--card); border: 3px solid var(--line); border-radius: 20px; padding: 7px 18px; text-align: left; color: var(--ink); font-weight: 500; box-shadow: none; }
.tv .game:hover { border-color: var(--marigold); }
.tv .game .ic { font-size: 38px; width: 56px; text-align: center; }
.tv .game h3 { font-size: 26px; line-height: 1.1; } .tv .game p { color: var(--muted); font-size: 16px; font-family: "Mukta"; }
.tv .players { display: flex; flex-wrap: wrap; gap: 8px; }
.tv .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tv .opt { display: flex; gap: 12px; align-items: center; padding: 14px 20px; font-size: 24px; border-radius: 40px; background: var(--card); border: 3px solid var(--marigold); font-weight: 600; }
.tv .opt b { color: var(--marigold); font-family: var(--display); }
.tv .opt.right { background: #127a3e; border-color: var(--green); }
.tv .opt.wrong { opacity: .4; }
.tv .card4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; }
.tv .rcard { background: var(--card); border: 4px solid var(--rc, var(--line)); border-radius: 22px; padding: 18px 10px; }
.tv .rcard .em { font-size: 56px; }
.tv .rcard .rn { color: var(--rc); font-size: 26px; font-weight: 800; font-family: var(--display); }
.tv .big { font-size: 96px; font-weight: 800; color: var(--marigold); line-height: 1; }
.tv .teams { display: flex; gap: 28px; width: 100%; }
.tv .team { flex: 1; background: var(--card); border: 4px solid var(--line); border-radius: 22px; padding: 14px 20px; }
.tv .team.on { border-color: var(--marigold); box-shadow: 0 0 40px #ffb81c55; }
.tv .team .pts { font-size: 60px; font-weight: 800; color: var(--marigold); font-family: var(--display); line-height: 1; }
.tv .foot { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.tv .foot button { font-size: 15px; padding: 6px 14px; }
.tv .toast { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); background: var(--red); padding: 10px 22px; border-radius: 14px; font-weight: 700; z-index: 5; }

/* ---------- Phone controller ---------- */
.phone { font-size: 18px; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; min-height: 100%; position: relative;
  background: radial-gradient(ellipse at 50% 0%, #6e1746 0%, var(--bg) 55%), var(--bg); }
.phone .ph-toran { height: 48px; flex: none; }
.phone .ph-app { flex: 1; padding: 10px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.phone .ph-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.phone .ph-main { flex: 1; display: flex; flex-direction: column; gap: 12px; justify-content: center; text-align: center; }
.phone h1 { font-size: 28px; line-height: 1.1; } .phone h2 { font-size: 21px; }
.phone .hero { font-size: 64px; line-height: 1.1; }
.phone .err { color: var(--red); font-weight: 700; min-height: 1em; }
.phone .big-btn { font-size: 21px; padding: 16px; width: 100%; }
.phone .menu { display: grid; gap: 10px; }
.phone .menu button { background: var(--card); color: var(--ink); border: 2px solid var(--line); text-align: left; display: flex; gap: 12px; align-items: center; box-shadow: none; }
.phone .menu .ic { font-size: 28px; }
.phone .menu small { font-family: "Mukta"; font-weight: 400; color: var(--muted); }
.phone .rolecard { border-radius: 24px; padding: 24px 14px; background: var(--card); border: 4px solid var(--rc, var(--line)); min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.phone .rolecard .em { font-size: 72px; line-height: 1.1; }
.phone .rolecard .rn { font-size: 32px; font-weight: 800; color: var(--rc); font-family: var(--display); }
.phone .covered { cursor: pointer; background: repeating-conic-gradient(from 0deg at 50% 50%, var(--card) 0 15deg, var(--card2) 15deg 30deg); }
.phone .ans { display: grid; gap: 10px; }
.phone .ans button { font-size: 19px; padding: 16px; text-align: left; display: flex; gap: 12px; align-items: center; color: #fff; }
.phone .ans .A { background: #e8663d; box-shadow: 0 4px 0 #9c3a1c; } .phone .ans .B { background: #1f8fb5; box-shadow: 0 4px 0 #11586f; }
.phone .ans .C { background: #2a9d5a; box-shadow: 0 4px 0 #17603a; } .phone .ans .D { background: #b14bd1; box-shadow: 0 4px 0 #6d2a82; }
.phone .ans button.picked { outline: 4px solid var(--marigold); }
.phone .ans button.gone { visibility: hidden; }
.phone .movie { background: var(--card); border: 4px dashed var(--marigold); border-radius: 22px; padding: 22px 12px; }
.phone .movie .t { font-size: 32px; font-weight: 800; line-height: 1.1; font-family: var(--display); }
.phone .row { display: flex; gap: 10px; } .phone .row button { flex: 1; font-size: 20px; padding: 16px; }
.phone .green { background: var(--green); box-shadow: 0 4px 0 #1f7a3e; } .phone .red { background: var(--red); color: #fff; box-shadow: 0 4px 0 #a32020; }
.phone .vipbar { display: flex; justify-content: center; } .phone .vipbar button { font-size: 14px; padding: 6px 14px; }
.phone input { font: inherit; font-size: 21px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); width: 100%; text-align: center; }
.phone input.code { letter-spacing: 8px; text-transform: uppercase; font-weight: 800; }
.phone input:focus-visible { outline: 3px solid var(--marigold); }

/* ---------- Race ---------- */
.tv .race-wrap { position: relative; flex: 1; border-radius: 18px; overflow: hidden; border: 4px solid var(--marigold); }
.tv .race-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tv .race-hud { position: absolute; left: 196px; top: 140px; background: #000a; border-radius: 12px; padding: 6px 10px; font-size: 15px; min-width: 190px; }
.tv .race-hud div { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.tv .race-hud b { width: 22px; height: 22px; border-radius: 6px; color: #111; display: grid; place-items: center; font-family: var(--display); }
.tv .race-hud span { margin-left: auto; color: var(--muted); }
.tv .race-feed { position: absolute; left: 770px; top: 160px; width: 260px; text-align: left; font-size: 18px; font-weight: 600; }
.tv .race-feed div { background: #000a; border-radius: 10px; padding: 2px 12px; margin-top: 4px; }
.tv .race-res { position: absolute; inset: 40px 260px; background: #2a061bf2; border: 3px solid var(--marigold); border-radius: 20px; padding: 20px 28px; text-align: center; }
.tv .race-res h1 { font-size: 40px; margin-bottom: 10px; }
.tv .race-res .score-row i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.phone .race-pad { display: flex; flex-direction: column; gap: 12px; }
.phone .race-top { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 16px; padding: 8px 14px; border-left: 10px solid var(--car, var(--marigold)); }
.phone .rpos { font-family: var(--display); font-weight: 800; font-size: 38px; color: var(--marigold); line-height: 1; }
.phone .rlap { font-weight: 600; text-align: right; }
.phone .nmeter { height: 14px; border-radius: 9px; background: var(--bg2); overflow: hidden; }
.phone .nmeter div { height: 100%; background: linear-gradient(90deg, #ff4d4d, #ff7a1a, #ffe066); transition: width .3s; }
.phone .pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phone [data-hold] { touch-action: none; -webkit-touch-callout: none; user-select: none; }
.phone .pads button { height: 150px; font-size: 54px; background: var(--card2); color: var(--ink); box-shadow: 0 6px 0 #3a0824; border: 3px solid var(--line); }
.phone [data-hold].down { transform: translateY(4px); box-shadow: 0 2px 0 #3a0824; border-color: var(--marigold); }
.phone .nitro { background: linear-gradient(90deg, #ff4d4d, #ff7a1a); color: #fff; font-size: 24px; flex: 2 !important; }
.phone .nitro.down { box-shadow: 0 0 24px #ff7a1a; }
.phone .spun { color: var(--marigold); font-weight: 700; min-height: 1.4em; }

/* ---------- Meme reactions ---------- */
.meme { position: absolute; inset: 0; z-index: 20; pointer-events: none; display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; transition: opacity .35s; }
.meme.out { opacity: 0; }
.meme-big { align-items: center; padding-top: 0; }
.meme-card { background: #fff4e0; color: #3a0824; border: 5px solid var(--marigold); box-shadow: 0 0 0 5px var(--rani), 0 20px 50px #000a; border-radius: 22px; padding: 12px 18px; text-align: center; max-width: 88%; animation: pop .45s ease-out both; transform: rotate(-2deg); }
.meme-big .meme-card { padding: 22px 40px; max-width: 760px; }
.meme-emoji { font-size: 60px; line-height: 1.1; display: inline-block; }
.meme-big .meme-emoji { font-size: 120px; }
.meme-line { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; text-wrap: balance; }
.meme-big .meme-line { font-size: 46px; }
.meme-who { font-weight: 600; color: #8a1a52; margin-top: 2px; }
.meme-big .meme-who { font-size: 22px; }
.meme-rain { position: absolute; inset: 0; overflow: hidden; }
.meme-rain i { position: absolute; top: -60px; font-style: normal; font-size: 28px; animation: fall linear both; }
.meme-big .meme-rain i { font-size: 44px; }
@keyframes fall { to { transform: translateY(820px) rotate(200deg); } }
.a-bounce { animation: bounce .6s ease-in-out infinite alternate; }
@keyframes bounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-14px) scale(1.1); } }
.a-shake { animation: shake .25s linear infinite; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-8px) rotate(-6deg) } 75% { transform: translateX(8px) rotate(6deg) } }
.a-spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.a-droop { animation: droop 1.2s ease-in-out infinite alternate; }
@keyframes droop { from { transform: translateY(0) rotate(0); } to { transform: translateY(8px) rotate(-12deg); } }
@media (prefers-reduced-motion: reduce) { .meme-rain, .a-bounce, .a-shake, .a-spin, .a-droop, .meme-card { animation: none !important; } }
.meme-gif { display: block; height: 130px; max-width: 100%; margin: 0 auto 6px; border-radius: 12px; object-fit: cover; }
.meme-big .meme-gif { height: 260px; }
.giphy { font-size: 10px; color: #8a1a52; margin: -4px 0 4px; }
.meme-big .giphy { font-size: 13px; }
.roast { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.roast button { padding: 6px 14px; font-size: 15px; background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.roast button.on { background: var(--marigold); color: #3a0824; border-color: var(--marigold); }

/* ---------- Dadi mascot ---------- */
.brand-row { display: flex; align-items: center; gap: 10px; }
.tv .dadi-mini { width: 58px; height: 66px; margin: -10px 0 -6px; }
.tv .qrwrap { position: relative; }
.tv .dadi-qr { position: absolute; width: 150px; height: 170px; left: -118px; bottom: -14px; filter: drop-shadow(0 8px 12px #0007); }
.phone .dadi-phone { width: 150px; height: 170px; align-self: center; filter: drop-shadow(0 8px 12px #0007); }
