:root { --ink: #1B1430; --ink-2: #4A4160; --gold: #F2B233; --gold-deep: #C9861A; --red: #D9412F; --glass: rgba(255, 249, 240, .86); --line: rgba(27, 20, 48, .12); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120E22; color: var(--ink); }
body { font: 600 16px/1.35 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, .tag, .play, .next, .kicker { font-family: 'Baloo 2', 'Baloo Thambi 2', sans-serif; }
html[lang=ta] h1, html[lang=ta] h2, html[lang=ta] .tag, html[lang=ta] .play, html[lang=ta] .next { font-family: 'Baloo Thambi 2', 'Baloo 2', sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* the same painting, blurred, fills whatever the scene does not */
#back { position: fixed; inset: -40px; background: #120E22 center / cover no-repeat; filter: blur(28px) brightness(.55) saturate(1.2); transition: background-image .8s; }

#stage { position: fixed; inset: 0; }
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .85s cubic-bezier(.6, 0, .2, 1), opacity .7s ease, filter .7s ease; }
.scene.enter { transform: scale(.82); opacity: 0; filter: blur(8px); }
.scene.leave { transform: scale(2.4); opacity: 0; filter: blur(6px); pointer-events: none; }

/* the painting: 3:4, as large as the screen allows, sides may crop slightly on tall phones */
.frame { position: absolute; left: 50%; top: 50%; height: min(100vh, 100vw * 1.6); aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border-radius: 0; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.frame.wide { height: 100vh; aspect-ratio: 2688 / 1152; }
@media (min-aspect-ratio: 1/1) { .frame { border-radius: 24px; height: calc(100vh - 32px); } .frame.wide { height: 100vh; border-radius: 0; } }
.paint { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }

/* every answer is a thing in the painting */
.spot { position: absolute; transform: translate(-50%, -50%); border: 0; background: transparent; padding: 0; }
.spot .ring { position: absolute; inset: 4%; border-radius: 40%; border: 3px solid rgba(255, 255, 255, 0);
  box-shadow: 0 0 0 0 rgba(242, 178, 51, 0); transition: border-color .25s, box-shadow .35s, background .25s; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { background: rgba(255, 240, 200, .10); } }
.spot .tag { position: absolute; left: 50%; bottom: -6px; transform: translate(-50%, 50%); white-space: nowrap;
  padding: 6px 13px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 15px; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .2s, color .2s; }
.spot:active .tag { transform: translate(-50%, 50%) scale(.95); }
.spot.on .ring { border-color: #fff; box-shadow: 0 0 0 6px rgba(242, 178, 51, .7), 0 0 40px 10px rgba(255, 210, 120, .55); animation: none; background: rgba(255, 240, 200, .14); }
.spot.on .tag { background: var(--ink); color: #fff; transform: translate(-50%, 50%) scale(1.06); }
.spot.dim .tag { opacity: .7; }
.scene .spot.on .tag::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }

/* the question sits in the sky at the top of the painting */
.ask { position: absolute; top: max(62px, env(safe-area-inset-top) + 52px); left: 50%; transform: translateX(-50%); width: min(92vw, 560px);
  padding: 12px 18px 12px; border-radius: 20px; text-align: center; background: var(--glass); backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3); }
.part { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
h2 { margin: 2px 0 0; font-size: clamp(21px, 5.4vw, 28px); line-height: 1.12; font-weight: 800; }
.how { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }

.go { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(92vw, 420px); }
.next, .play { display: block; width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #FFC94D, var(--gold));
  font-size: 20px; font-weight: 800; color: var(--ink); box-shadow: 0 4px 0 var(--gold-deep), 0 12px 24px rgba(0, 0, 0, .35); transition: transform .12s, opacity .2s; }
.next:active, .play:active { transform: translateY(3px); }
.next:disabled { opacity: .5; }

.hero { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 440px);
  padding: 20px; border-radius: 24px; text-align: center; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
h1 { margin: 2px 0 6px; font-size: clamp(30px, 8vw, 42px); line-height: 1.02; font-weight: 800; }
.tag { margin: 0 0 12px; font-weight: 600; color: var(--ink-2); }
.note { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.langs { display: inline-flex; padding: 4px; margin: 0 0 12px; border-radius: 99px; background: rgba(27, 20, 48, .08); }
.langs button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 99px; background: transparent; font-weight: 700; }
.langs button.on { background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.row2 { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); text-align: left; font-size: 14px; }
.row2 span { color: var(--ink-2); }
.hero .play { margin-top: 10px; }

#hud { position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; }
#hud[hidden] { display: none; }
.pips { display: flex; gap: 5px; margin-right: auto; padding: 9px 11px; border-radius: 99px; background: rgba(18, 14, 34, .55); backdrop-filter: blur(10px); }
.pips i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); transition: all .4s; }
.pips i.done { background: var(--gold); } .pips i.cur { background: #fff; width: 32px; }
.coins, .hbtn { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 99px; background: rgba(18, 14, 34, .55); color: #fff; font-weight: 800; backdrop-filter: blur(10px); }
.coins img { width: 20px; height: 20px; border-radius: 50%; }
.coins.pop { animation: pop .45s cubic-bezier(.34, 1.56, .64, 1); } @keyframes pop { 50% { transform: scale(1.2); } }
#toast { position: fixed; z-index: 6; left: 50%; bottom: 90px; transform: translate(-50%, 10px); opacity: 0; padding: 9px 16px; border-radius: 99px; background: rgba(217, 65, 47, .92); color: #fff; font-size: 14px; font-weight: 800; transition: all .3s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .scene { transition-duration: .01s; } }
