/* Full game additions on top of pilot/pilot.css */
.bar { flex: 1; height: 10px; margin-right: auto; max-width: 260px; border-radius: 99px; background: rgba(18, 14, 34, .55); backdrop-filter: blur(10px); overflow: hidden; }
.bar i { display: block; height: 100%; width: 4%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #FFD978); transition: width .5s ease; }

.go { display: flex; gap: 8px; }
.go .next { flex: 1; }
.backb, .skipb { flex: none; min-height: 54px; min-width: 54px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--glass); color: var(--ink);
  font: 800 20px/1 'Baloo 2', sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, .18), 0 12px 24px rgba(0, 0, 0, .3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.skipb { font-size: 17px; }
.backb:active, .skipb:active { transform: translateY(3px); }

/* a board of choices, used until a scene is painted */
.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -42%); width: min(92vw, 560px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.board .spot.card { position: relative; transform: none; min-height: 58px; padding: 10px 12px; border-radius: 16px; background: var(--glass); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-align: left; }
.board .spot.card .tag { position: static; transform: none; padding: 0; background: none; box-shadow: none; white-space: normal; backdrop-filter: none; font-size: 15px; line-height: 1.2; }
.board .spot.card.on { background: var(--ink); }
.board .spot.card.on .tag { color: #fff; transform: none; }

/* glass panels for typing */
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -38%); width: min(92vw, 520px); padding: 14px; border-radius: 20px; background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.panel input, .panel textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 600 16px/1.35 Inter, system-ui, sans-serif; padding: 12px 14px; }
.panel textarea { resize: none; min-height: 96px; }
.panel .pre { margin: 0 0 8px; font: 800 18px/1.25 'Baloo 2', 'Baloo Thambi 2', sans-serif; color: var(--ink); }
.panel textarea + .pre { margin: 8px 0 0; }
.areap { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; }
.alist { overflow: auto; min-height: 120px; max-height: 34vh; padding-right: 4px; }
.grp { margin: 6px 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; border-radius: 99px; padding: 8px 12px; background: rgba(27, 20, 48, .07); font-weight: 700; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; }
.none { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.telrow { display: flex; align-items: center; gap: 8px; }
.telrow span { font: 800 20px/1 Inter, sans-serif; color: var(--ink-2); }
.telrow input { font-size: 22px; letter-spacing: .04em; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.perks { margin: 12px 0 0; padding: 0 0 0 18px; font-size: 14px; color: var(--ink-2); }
.err { margin: 8px 0 0; color: var(--red); font-weight: 800; font-size: 14px; }

/* the Voice Card */
.voice { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 460px); max-height: calc(100vh - 32px); overflow: auto;
  padding: 18px; border-radius: 24px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.voice .stamp { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.voice .eyebrow { margin: 0; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.voice h1 { margin: 0 0 4px; font-size: clamp(28px, 7.4vw, 38px); }
.voice .blurb { margin: 0 0 10px; font-weight: 600; color: var(--ink-2); }
.voice .rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.voice .rows span, .voice .quote span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-deep); }
.voice .rows b { font-size: 14px; }
.voice .quote { margin: 10px 0 0; font: 700 16px/1.3 'Baloo 2', 'Baloo Thambi 2', sans-serif; }
.voice .share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.voice .share .play { grid-column: 1 / -1; text-align: center; line-height: 54px; text-decoration: none; }
.voice .share button { min-height: 46px; border: 0; border-radius: 14px; background: rgba(27, 20, 48, .08); font-weight: 800; }
.voice .note { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); text-align: center; }

@media (min-aspect-ratio: 1/1) { .panel, .board { transform: translate(-50%, -40%); } }

/* scenes with many answers: smaller labels that wrap onto two lines instead of colliding */
.scene.many .spot .tag { white-space: normal; width: max-content; max-width: 9.5em; text-align: center; font-size: 13px; line-height: 1.15; padding: 5px 10px; }
@media (max-width: 480px) { .scene.many .spot .tag { font-size: 12px; max-width: 8.5em; } }
html[lang=ta] .scene.many .spot .tag { font-size: 11px; line-height: 1.12; max-width: 8.2em; padding: 4px 8px; }
/* Tamil answers run long: wrap onto two lines everywhere */
html[lang=ta] .scene .spot .tag { white-space: normal; width: max-content; max-width: 10.5em; text-align: center; line-height: 1.15; font-size: 13px; }

/* picked answers: no ring, the answer itself lifts out of the painting */
.scene .spot .ring { display: none; }
.life .sel-cut { position: absolute; display: block; background-repeat: no-repeat; opacity: 0; transform-origin: 50% 90%;
  transform: scale(1); transition: opacity .22s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1), filter .3s ease; z-index: 3; }
.life .sel-cut.on { opacity: 1; transform: scale(1.05);
  filter: drop-shadow(0 0 .35em rgba(255, 214, 120, .95)) drop-shadow(0 0 .9em rgba(242, 178, 51, .6)) drop-shadow(0 .45em .5em rgba(20, 10, 30, .45)); }
.life .lf-spr.sel-hide { visibility: hidden; }
.scene .spot.on .tag { z-index: 4; }
@media (prefers-reduced-motion: reduce) { .life .sel-cut { transition: none; } .life .sel-cut.on { transform: scale(1.04); } }

/* the event's own questions: a close-up of that event behind the cards */
.frame.zoom .paint { transform: scale(2.3); filter: saturate(1.1) brightness(.78) blur(1px); }
/* area: each area's painting cross-fades in behind the list */
.areaf .next-paint { opacity: 0; transition: opacity .5s ease; }
.areaf .next-paint.in { opacity: 1; }
.hero .lbl { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .areaf .next-paint { transition: none; } }
.scene.many13 .spot .tag { max-width: 6.6em; font-size: 11.5px; padding: 4px 8px; }
html[lang=ta] .scene.many13 .spot .tag { max-width: 6.8em; font-size: 10.5px; }
@media (min-width: 900px) { .scene.many13 .spot .tag { max-width: 8em; font-size: 12.5px; } }
.ask { pointer-events: none; }
/* boards and panels are placed by fitBox() in the band between the question card and the bar */
.board { overflow: auto; align-content: start; }
.areap { max-height: none; }
.areap .alist { max-height: none; flex: 1; min-height: 80px; }
/* answer cards with their own picture (Raja 18 Oct) */
.board .spot.card { display: flex; align-items: center; gap: 10px; }
.board .spot.card .el { flex: none; width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(20, 10, 30, .25));
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.board .spot.card.on .el { transform: scale(1.14) rotate(-3deg); }
.board .spot.card .el + .tag { flex: 1; min-width: 0; }
@media (max-width: 380px) { .board .spot.card .el { width: 50px; height: 50px; } .board .spot.card { gap: 8px; padding: 8px 10px; } }
/* phones: picture above the words, so long Tamil words get the whole card width (20 Oct) */
@media (max-width: 440px) { .board .spot.card { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 6px; text-align: center; }
  .board .spot.card .el { width: 44px; height: 44px; } .board .spot.card .el + .tag { flex: none; width: 100%; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .board .spot.card .el { transition: none; } }
/* the event you built (Raja 18 Oct 10:42 pm) */
.myev .glow { position: absolute; left: 50%; top: 62%; width: 88%; height: 28%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 120, .55), rgba(255, 214, 120, 0)); pointer-events: none; }
.myev .piece { position: absolute; height: auto; transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
  filter: drop-shadow(0 .6em .5em rgba(20, 10, 30, .45)); animation: evdrop .7s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.myev .piece.main { z-index: 2; } .myev .piece.crowd { z-index: 3; } .myev .piece.fix { z-index: 4; }
.myev .piece.fx { animation-name: evpop; filter: none; mix-blend-mode: screen; }
@keyframes evdrop { from { opacity: 0; transform: translate(-50%, -110%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes evpop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 60% { opacity: 1; } 100% { opacity: .9; transform: translate(-50%, -50%) scale(1); } }
.myev-ask .fixed { color: var(--gold-deep); font-weight: 800; }
.share-ev { font-size: 16px; padding: 0 18px; }
@media (prefers-reduced-motion: reduce) { .myev .piece { animation: none; opacity: 1; } }
.frame.myev { border-radius: 22px; }
/* 19 Oct: one whole painted event scene; dream picks shown on its LED screen */
.myev.whole .paint { object-fit: cover; }
.myev .led { position: absolute; display: flex; align-items: center; justify-content: space-evenly; gap: 2%; padding: 0 2%;
  background: linear-gradient(#2A1F4D, #120C26); box-shadow: 0 0 14px rgba(255, 214, 120, .55); border-radius: 2px; overflow: hidden; z-index: 2; }
.myev .led img { height: 86%; width: auto; max-width: 32%; object-fit: contain; opacity: 0; animation: ledin .6s ease-out forwards; }
@keyframes ledin { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .myev .led img { animation: none; opacity: 1; } }
/* Raja 20 Oct: the card describes their own event */
.voice .story { margin: 6px 0 4px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.voice .story .slbl { display: block; margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-deep); }
.voice .story p:not(.slbl) { margin: 0 0 6px; font-weight: 600; font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.voice .story p:nth-of-type(2) { font-size: 18px; color: var(--ink, #1b1530); font-weight: 700; }

/* 20 Oct: Rockfort start screen, full bleed at every size, the rock kept in view */
.frame.titlebg { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
.frame.titlebg .paint { object-position: 50% 12%; }
/* 20 Oct: BY TRICHY, FOR TRICHY is the title (Raja), the quest name is the kicker */
.hero .kicker { color: var(--ink-2); letter-spacing: .12em; }
.hero .btft-logo { display: block; width: min(64vw, 34vh, 280px); aspect-ratio: 1016 / 889; height: auto; margin: calc(-1 * min(22vw, 12vh, 96px)) auto 4px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); }
.hero h1.btft { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[lang=ta] .hero h1.btft { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin: 0 0 2px; color: var(--red); font-size: clamp(18px, 5.2vw, 26px); line-height: 1.3; }
.hero .btft-logo + h1.btft + .kicker { margin-bottom: 4px; }
html[lang=ta] .hero .tag { font-size: 14px; line-height: 1.5; }
@media (max-height: 700px) { html[lang=ta] .hero h1.btft { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
/* four-jar price scenes (DK 21 Oct): every price sits on one line on its jar's plaque, Tamil included */
html[lang=ta] .scene.fill .spot .tag { white-space: nowrap; max-width: none; }

/* DK 21 Oct: FULL SCREEN on desktop and laptop, like a real game. html.wide = landscape screen at least 900px wide.
   Painted tap scenes get class .side from fitWide(): the wide painting (.ext) fills the screen, the portrait frame
   with the tap spots sits on its centre third with no border or shadow, the question card floats on the left
   and Back/Next on the right, always inside the screen. */
.scene .ext { position: absolute; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.scene.side .frame { border-radius: 0; box-shadow: none; }
.scene.side .ask { left: 20px; top: 66px; transform: none; width: min(400px, calc(var(--side) - 40px)); text-align: left; padding: 16px 20px; }
.scene.side .ask h2 { font-size: clamp(24px, 2.1vw, 32px); }
.scene.side .ask .how { font-size: 14px; }
.scene.side .go { left: auto; right: 20px; bottom: 20px; transform: none; width: min(400px, calc(var(--side) - 40px)); }
html.wide .scene.side .spot .tag { font-size: 16px; }
html.wide[lang=ta] .scene.side .spot .tag { font-size: 14px; }
html.wide .scene.side.many .spot .tag { font-size: 14px; }
html.wide[lang=ta] .scene.side.many .spot .tag { font-size: 12.5px; }
/* scene changes on a big screen: a cross-fade with a slight settle, never a shrunken framed card with a blurred border */
html.wide .scene.enter { transform: scale(1.04); filter: none; }
html.wide .scene.leave { filter: none; }
/* backdrops behind cards (event close-up, Voice Card art) cover the whole screen */
html.wide .frame.zoom, html.wide .voicebg { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
html.wide .frame.zoom .paint { transform: scale(1.6); }
/* the start screen: the card sits beside the Rockfort, larger and crisp */
html.wide .hero { left: max(32px, 6vw); top: 50%; bottom: auto; transform: translateY(-50%); width: min(460px, 36vw); padding: 26px 28px; }
html.wide .hero .btft-logo { width: min(300px, 30vh); margin: calc(-1 * min(14vh, 110px)) auto 6px; }
html.wide .hero .tag { font-size: 17px; line-height: 1.45; }
html.wide .hero .kicker { font-size: 14px; }
/* wide screens: an ending without its own wide painting stands as a poster over the full-screen Rockfort */
.frame.endbg .paint { filter: brightness(.82) saturate(1.05); }
html.wide .frame.myev { box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }

/* DK 21 Oct (evening): DESKTOP SIDE PANEL. html.desk = landscape screen at least 1024px wide (set in play.js).
   The stage is the screen minus a glass panel on the right (--pw). fitPanel() fits the painting and its tap spots
   on the stage; the panel carries the progress bar, coins and language (HUD), the chapter and question, typing
   (area list, write-in, WhatsApp number) and Back/Next. Answer boards sit on the stage. Phones never get it. */
html.desk .scene::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: var(--pw); z-index: 1;
  background: rgba(255, 249, 240, .84); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-left: 1px solid rgba(255, 255, 255, .55); box-shadow: -18px 0 50px rgba(18, 14, 34, .28); pointer-events: none; }
html.desk .scene.title::before, html.desk .scene.vc::before { display: none; }
html.desk .scene.enter, html.desk .scene.leave { transform: none; filter: none; }
html.desk .scene.paneled .frame:not(.myev) { border-radius: 0; box-shadow: none; }
html.desk #hud { left: auto; right: 0; width: var(--pw); padding: 0 28px; top: 22px; }
html.desk #hud .bar { max-width: none; }
html.desk .scene .ask, html.desk .scene.side .ask { z-index: 2; left: auto; right: 0; top: 78px; transform: none; width: var(--pw);
  padding: 6px 28px 0; text-align: left; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
html.desk .scene .ask .part { font-size: 12px; }
html.desk .scene .ask h2 { margin-top: 8px; font-size: clamp(26px, 2.3vw, 36px); line-height: 1.12; }
html.desk[lang=ta] .scene .ask h2 { font-size: clamp(23px, 2vw, 31px); line-height: 1.3; }
html.desk .scene .ask .how { margin-top: 8px; font-size: 15px; }
html.desk .scene .go, html.desk .scene.side .go { z-index: 2; left: auto; right: 28px; bottom: 28px; transform: none; width: calc(var(--pw) - 56px); }
html.desk .scene .panel { z-index: 2; left: calc(100vw - var(--pw) / 2); width: calc(var(--pw) - 56px); padding: 0; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
html.desk .scene .panel textarea { min-height: 140px; }
html.desk .scene .board { left: calc((100vw - var(--pw)) / 2); width: min(640px, calc(100vw - var(--pw) - 64px)); }
html.desk .board .spot.card { min-height: 72px; }
html.desk .board .spot.card .tag { font-size: 16px; }
html.desk #toast { left: calc((100vw - var(--pw)) / 2); }
/* the Voice Card is the panel itself, the person's type painting fills the rest */
html.desk .scene .voice { z-index: 2; left: auto; right: 0; top: 0; bottom: 0; transform: none; width: var(--pw); max-height: none;
  border-radius: 0; padding: 34px 28px 28px; overflow: auto; background: rgba(255, 249, 240, .9); border-left: 1px solid rgba(255, 255, 255, .55);
  box-shadow: -18px 0 50px rgba(18, 14, 34, .28); }
html.desk .voicebg .paint { object-position: 35% 50%; }
html.desk .frame.voicebg { width: calc(100vw - var(--pw)); }
html.desk #stage, html.desk .scene { overflow: hidden; }
html.desk .scene.paneled .spot .tag { font-size: 16px; }
html.desk[lang=ta] .scene.paneled .spot .tag { font-size: 14px; }
html.desk .scene.paneled.many .spot .tag { font-size: 14px; }
html.desk[lang=ta] .scene.paneled.many .spot .tag { font-size: 12.5px; }

/* DK 22 Oct: desktop landscape scenes (play.js landGeo/placeLand): the painting is placed in px from the top left */
html.desk .scene .frame.land { position: absolute; transform: none; aspect-ratio: auto; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }
html.desk .scene .frame.land .paint { width: 100%; height: 100%; object-fit: cover; }
html.desk .scene.landed .spot .tag { font-size: 17px; }
html.desk[lang=ta] .scene.landed .spot .tag { font-size: 15px; }
html.desk .scene.landed.many13 .spot .tag { font-size: 13.5px; max-width: 9em; }
html.desk .scene .frame.land.lb { -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 78%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 78%, transparent 100%); }
/* Raja 13 Nov: Voice Card first, then this button opens the event they built */
.voice .seeev { display: block; width: 100%; margin-top: 12px; min-height: 64px; padding: 10px 16px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #3A2A66, #1B1430); color: #FFF7E8; text-align: center; border: 1.5px solid var(--gold);
  box-shadow: 0 8px 22px rgba(201, 134, 26, .35); animation: seeevPulse 2.4s ease-in-out 1.2s infinite; }
.voice .seeev b { display: block; font: 800 19px/1.2 'Baloo 2', 'Baloo Thambi 2', sans-serif; color: #FFD978; }
.voice .seeev span { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: #FFF7E8; opacity: .85; }
.voice .seeev:active { transform: scale(.97); }
@keyframes seeevPulse { 0%, 100% { box-shadow: 0 8px 22px rgba(201, 134, 26, .35); } 50% { box-shadow: 0 8px 30px rgba(242, 178, 51, .65); } }
@media (prefers-reduced-motion: reduce) { .voice .seeev { animation: none; } }
