:root { --red: #c8102e; --ink: #0f1720; --panel: rgba(15, 23, 32, .86); --line: rgba(255, 255, 255, .14); --gold: #ffc400; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1720; font-family: "Segoe UI", Roboto, system-ui, sans-serif; color: #fff; user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud #ride { pointer-events: auto; }
#loc { position: absolute; left: 14px; top: calc(12px + env(safe-area-inset-top)); text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
#loc-comm { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
#loc-street { font-size: 14px; opacity: .9; }
#objective { position: absolute; left: 14px; top: calc(70px + env(safe-area-inset-top)); max-width: min(380px, 60vw); background: var(--panel); border-left: 4px solid var(--gold); border-radius: 8px; padding: 9px 12px; }
.obj-title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; }
.obj-text { font-size: 15px; font-weight: 600; margin-top: 2px; }
.obj-dist { font-size: 12px; opacity: .8; margin-top: 3px; }
#topright { position: absolute; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#minimap { width: 170px; height: 170px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 4px 16px rgba(0, 0, 0, .45); background: #ddd; }
#stats { display: flex; gap: 8px; }
#stats span { background: var(--panel); padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; }
#money { color: #8fe39b; }
#speed { background: var(--panel); padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 20px; }
#prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: var(--panel); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid var(--line); white-space: nowrap; }
#buttons { position: absolute; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, auto); gap: 10px; align-items: end; }
.btn-round { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); background: rgba(15, 23, 32, .6); font-size: 22px; display: grid; place-items: center; }
.btn-round.big { width: 66px; height: 66px; font-size: 28px; }
.btn-round:active { background: rgba(200, 16, 46, .7); }
body:not(.touch) #buttons [data-hold] { display: none; }
#stick { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); display: none; left: 30px; bottom: 40px; }
#stick.on { display: block; }
#knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
#ride { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: var(--panel); border-radius: 12px; padding: 12px 16px; text-align: center; border: 1px solid var(--line); }
#ride-text { font-weight: 600; margin-bottom: 8px; }
#ride button { background: var(--red); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; }
#found { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); background: linear-gradient(90deg, #c8102e, #8a0a1f); padding: 10px 18px; border-radius: 10px; font-weight: 800; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }

/* dialog and cards */
#dialog { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(680px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; z-index: 20; backdrop-filter: blur(6px); }
#dialog .who { color: var(--gold); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
#dialog .text { font-size: 17px; line-height: 1.45; margin: 6px 0 10px; }
.next { float: right; background: var(--red); border: 0; border-radius: 8px; padding: 9px 18px; font-weight: 700; }
#card, #quiz { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 10, 15, .55); z-index: 30; }
.card-in { width: min(560px, 94vw); max-height: 88vh; overflow: auto; background: #fbfaf7; color: #1b2430; border-radius: 16px; padding: 20px 22px 18px; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); user-select: text; -webkit-user-select: text; }
.card-tag { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; }
.card-in h2 { margin: 10px 0 8px; font-size: 22px; line-height: 1.2; }
.card-body { font-size: 16px; line-height: 1.55; }
.card-body ul { padding-left: 20px; margin: 8px 0; }
.card-body li { margin: 4px 0; }
.card-body b { color: #a00b24; }
.card-src { font-size: 12px; color: #5b6573; margin-top: 12px; border-top: 1px solid #e3ded3; padding-top: 8px; }
.card-src a { color: #1d4f91; }
.opts { display: grid; gap: 8px; margin: 10px 0; }
.opts button { text-align: left; background: #fff; border: 2px solid #d9d3c6; border-radius: 10px; padding: 11px 14px; color: #1b2430; font-size: 16px; }
.opts button.right { border-color: #1e9e4a; background: #e7f7ec; }
.opts button.wrong { border-color: #c8102e; background: #fde8eb; }
.explain { font-size: 15px; line-height: 1.5; color: #364152; }

/* phone */
#phone { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 10, 15, .5); z-index: 25; }
.phone-in { width: min(380px, 94vw); height: min(700px, 90vh); background: #f3f1ec; color: #1b2430; border-radius: 28px; border: 8px solid #10161d; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.phone-top { background: #10161d; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.phone-top button { background: none; border: 0; font-size: 18px; }
.phone-title { font-weight: 700; }
.phone-body { flex: 1; overflow: auto; padding: 14px; user-select: text; -webkit-user-select: text; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.app { background: none; border: 0; color: #1b2430; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.app i { font-style: normal; width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.p-h { font-size: 18px; font-weight: 800; margin: 2px 0 10px; }
.p-list { display: grid; gap: 8px; }
.p-item { background: #fff; border-radius: 12px; padding: 10px 12px; border: 1px solid #e2ddd2; text-align: left; color: #1b2430; width: 100%; }
.p-item b { display: block; font-size: 15px; }
.p-item small { color: #5b6573; }
.p-btn { width: 100%; background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 12px; font-weight: 700; margin-top: 10px; font-size: 15px; }
.p-btn.alt { background: #e4e0d6; color: #1b2430; }
.p-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-big a, .p-big button { background: #fff; border: 2px solid #c8102e; border-radius: 12px; padding: 10px; text-decoration: none; color: #1b2430; text-align: left; }
.p-big b { display: block; color: #c8102e; font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid #c9c2b4; background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 13px; color: #1b2430; }
.chip.on { background: #1b2430; color: #fff; border-color: #1b2430; }
.photo { height: 150px; border-radius: 12px; background: repeating-linear-gradient(45deg, #444 0 10px, #3a3a3a 10px 20px); display: grid; place-items: center; color: #ddd; font-weight: 700; }
.shop-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid #e2ddd2; }
.shop-row button { background: #1b2430; color: #fff; border: 0; border-radius: 8px; width: 34px; height: 34px; font-size: 18px; }
.shop-row .q { width: 26px; text-align: center; font-weight: 700; }

/* big map */
#bigmap { position: fixed; inset: 0; background: #e9e5da; z-index: 22; }
#bigmap-c { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.bm-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--panel); }
.bm-hint { opacity: .8; font-size: 13px; flex: 1; }
.bm-x { background: var(--red); border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 700; }
.bm-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .9); color: #222; border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.6; }
.bm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

#toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%) translateY(-20px); background: var(--panel); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .3s; z-index: 40; font-weight: 600; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* title */
#title { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, rgba(200, 16, 46, .35), rgba(15, 23, 32, .92) 60%), #0f1720; overflow: auto; }
.title-in { width: min(560px, 92vw); text-align: center; padding: 30px 0; }
.logo { font-size: clamp(54px, 13vw, 96px); font-weight: 900; letter-spacing: -.02em; line-height: .9; }
.logo span { color: var(--red); -webkit-text-stroke: 2px #fff; }
.sub { font-size: 18px; letter-spacing: .3em; text-transform: uppercase; margin-top: 10px; opacity: .85; }
.blurb { font-size: 16px; line-height: 1.5; opacity: .9; margin: 18px auto; max-width: 460px; }
.pick { display: flex; gap: 12px; justify-content: center; margin: 14px 0; }
.who-btn { background: rgba(255, 255, 255, .06); border: 2px solid var(--line); border-radius: 12px; padding: 10px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.who-btn.on { border-color: var(--gold); background: rgba(255, 196, 0, .12); }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-block; }
.av-a { background: linear-gradient(#15100d 30%, #b07a52 30% 65%, #1f6fd1 65%); }
.av-z { background: linear-gradient(#15100d 38%, #b98260 38% 65%, #c8326b 65%); }
.start-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 10px; }
.start-btns button { width: min(320px, 80vw); padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: rgba(255, 255, 255, .06); font-weight: 800; font-size: 17px; }
.start-btns button.primary { background: var(--red); border-color: var(--red); }
.start-btns button:disabled { opacity: .45; }
#loading { margin-top: 12px; font-size: 14px; opacity: .8; }
.credits { margin-top: 22px; font-size: 12px; opacity: .75; line-height: 1.6; }
.credits b { font-size: 14px; opacity: 1; }
.controls-help { margin-top: 10px; font-size: 12px; opacity: .55; }
body.touch .controls-help { display: none; }
@media (max-width: 600px) { #minimap { width: 120px; height: 120px; } #loc-comm { font-size: 18px; } .btn-round { width: 48px; height: 48px; } .btn-round.big { width: 58px; height: 58px; } }

/* Google Maps attribution (photo mode): logo text bottom left, data credits bottom right */
#gattr-logo, #gattr-data { display: none; }
body.photo #gattr-logo { display: block; position: absolute; left: 10px; bottom: calc(6px + env(safe-area-inset-bottom)); font: 600 15px Roboto, Arial, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; letter-spacing: .01em; }
body.photo #gattr-data { display: block; position: absolute; right: 8px; bottom: calc(4px + env(safe-area-inset-bottom)); max-width: 60vw; font: 11px Roboto, Arial, sans-serif; color: #fff; text-shadow: 0 0 3px #000; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.photo #buttons { bottom: calc(30px + env(safe-area-inset-bottom)); }
.key-in { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #c9c2b4; font: inherit; margin-top: 6px; }

/* real street photo */
#realbtn { position: absolute; left: 50%; top: calc(22% + 20px); transform: translateX(-50%); background: #0b7a75; border: 2px solid #fff; border-radius: 999px; padding: 10px 18px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.4); pointer-events: auto; }
#real { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(5,10,15,.75); }
.real-in { width: min(680px, 96vw); background: #10161d; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.real-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.real-top button { background: none; border: 0; font-size: 20px; }
.real-photo { position: relative; background: #000; aspect-ratio: 1.6; display: grid; place-items: center; }
.real-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.real-photo button { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); font-size: 20px; }
.real-l { left: 10px; } .real-r { right: 10px; }
.real-msg { position: absolute; color: #ddd; font-weight: 600; text-align: center; padding: 20px; }
.real-foot { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; font: 12px Roboto, Arial, sans-serif; color: #ccc; }
.real-g { font-weight: 700; color: #fff; }
.real-note { margin: 0; padding: 4px 14px 14px; font-size: 14px; opacity: .85; }
/* light grade: warm wash and soft vignette over the 3D view (keeps the scene feeling lit by one sun) */
#grade { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 70% 0%, rgba(255,214,150,.13), transparent 55%), radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(0,0,0,.30) 100%); }
.btn-round.on { background: rgba(200, 16, 46, .75); border-color: #fff; }
.btn-round.off { opacity: .45; }

/* intro: Calgary Insight presents -> title -> language -> who you play */
.intro-screen { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; }
#intro-presents { background: #000; }
.presents { font-size: clamp(20px, 4.5vw, 34px); letter-spacing: .32em; text-transform: uppercase; color: #e9eef5; opacity: 0; animation: presents 3.6s ease forwards; text-align: center; padding: 0 20px; }
@keyframes presents { 0% { opacity: 0; letter-spacing: .5em; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; letter-spacing: .28em; } }
#intro-title .title-in, #intro-lang .title-in, #intro-who .title-in { animation: fadeUp .7s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.logo2 { font-size: .42em; letter-spacing: .5em; font-weight: 800; color: var(--gold); -webkit-text-stroke: 0; }
.logo.small { font-size: clamp(30px, 7vw, 44px); }
.tagline { margin-top: 18px; font-size: 16px; opacity: .85; }
.tap { margin-top: 34px; padding: 14px 34px; border-radius: 40px; border: 2px solid var(--gold); background: rgba(255, 196, 0, .12); color: #fff; font-weight: 800; font-size: 18px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); box-shadow: 0 0 24px rgba(255, 196, 0, .35); } }
.pick-h { font-size: 15px; font-weight: 600; opacity: .85; margin: 18px 0 14px; line-height: 1.6; }
.langs { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 10px; }
.langs button { padding: 16px 10px; border-radius: 12px; border: 2px solid var(--line); background: rgba(255, 255, 255, .06); color: #fff; font-size: 20px; font-weight: 800; }
.langs button:hover, .langs button:focus { border-color: var(--gold); }
.title-in.wide { width: min(760px, 94vw); }
.chars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 640px) { .chars { grid-template-columns: repeat(3, 1fr); } }
.char-btn { background: rgba(255, 255, 255, .06); border: 2px solid var(--line); border-radius: 14px; padding: 12px 8px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.char-btn.on { border-color: var(--gold); background: rgba(255, 196, 0, .14); }
.char-btn b { font-size: 18px; }
.char-btn small { font-size: 12px; opacity: .85; }
.char-av { width: 54px; height: 54px; border-radius: 50%; }
.char-blurb { min-height: 48px; font-size: 15px; line-height: 1.5; opacity: .9; margin: 14px auto 6px; max-width: 600px; }
.start-btns button.link { background: none; border: 0; opacity: .7; font-size: 14px; padding: 4px; }
.lang-note { font-size: 12px; opacity: .65; margin: 6px 0 0; }
[dir=rtl] .char-blurb, [dir=rtl] .tagline { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Segoe UI", sans-serif; }

#btn-menu { position: absolute; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); pointer-events: auto; background: rgba(15, 23, 32, .72); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 18px; padding: 6px 14px; font-weight: 700; font-size: 14px; z-index: 5; }
#intro-presents .tap { margin: 0; }

#btn-music { display: block; margin: 6px 0 0 auto; pointer-events: auto; background: rgba(15, 23, 32, .75); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 16px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
#btn-music.off { opacity: .7; text-decoration: line-through; }

.ci-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ci-logo { width: clamp(110px, 26vw, 170px); height: auto; border-radius: 28px; box-shadow: 0 10px 40px rgba(14, 165, 233, .25); animation: fadeUp .8s ease both; }
.ci-name { font-size: clamp(22px, 5vw, 30px); font-weight: 800; letter-spacing: .04em; color: #e9eef5; animation: fadeUp .8s .15s ease both; }
#intro-presents .presents { margin-top: 4px; }

/* cutscenes: letterbox bars, subtitles, no controls */
#cine { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
#cine .cine-bar { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform .6s ease; }
#cine .cine-bar.top { top: 0; } #cine .cine-bar.bot { bottom: 0; }
#cine .cine-sub { position: absolute; left: 50%; bottom: calc(2vh + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(820px, 94vw); text-align: center; pointer-events: auto; cursor: pointer; text-shadow: 0 2px 4px #000; }
#cine .cine-sub .who { color: var(--gold); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
#cine .cine-sub .text { color: #fff; font-size: clamp(16px, 2.3vw, 21px); line-height: 1.4; margin-top: 2px; }
#cine .cine-sub small { color: #9aa; font-size: 11px; }
body.cine #buttons, body.cine #stick, body.cine #objective, body.cine #topright, body.cine #btn-menu, body.cine #prompt, body.cine #loc { visibility: hidden; }

/* camera zoom */
#zoombtns { display: flex; gap: 6px; pointer-events: auto; }
#zoombtns button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(15, 23, 32, .6); color: #fff; font-size: 22px; font-weight: 800; line-height: 1; display: grid; place-items: center; }
#zoombtns button:active { background: rgba(255, 210, 74, .55); }
body.cine #zoombtns { display: none; }

/* the "Beyond the Mask" music video at the end of Natalia's story, and the end of the game */
#mv { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#mv .mv-fade { position: absolute; inset: 0; background: #000; opacity: 1; }
#mv .mv-lyric { position: absolute; left: 50%; bottom: calc(13vh + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(900px, 94vw); text-align: center; color: #fff; font-weight: 800; font-size: clamp(18px, 3vw, 30px); line-height: 1.3; text-shadow: 0 2px 6px #000, 0 0 2px #000; letter-spacing: .01em; }
#mv .mv-lyric:empty { opacity: 0; }
#mv .mv-lyric.in { animation: mvIn .35s ease-out forwards; }
@keyframes mvIn { from { transform: translateX(-50%) translateY(8px); } }
#mv .mv-skip { position: absolute; right: 14px; top: calc(12vh + env(safe-area-inset-top)); pointer-events: auto; background: rgba(0,0,0,.45); color: #ddd; border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 6px 14px; font-size: 13px; }
#mv .mv-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; background: var(--gold, #f2b705); color: #111; border: 0; border-radius: 28px; padding: 14px 26px; font-size: 18px; font-weight: 800; }
#mv.done { pointer-events: auto; }
#mv.done .mv-fade { opacity: 1 !important; }
#mv .mv-end { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; color: #fff; animation: mvEnd 1.4s ease-out; }
@keyframes mvEnd { from { opacity: 0; } to { opacity: 1; } }
#mv .mv-the-end { font-size: clamp(40px, 9vw, 84px); font-weight: 900; letter-spacing: .04em; }
#mv .mv-song { font-size: clamp(20px, 4vw, 32px); font-weight: 800; color: var(--gold, #f2b705); margin-top: 6px; }
#mv .mv-by { font-size: 14px; color: #bbb; margin-top: 2px; }
#mv .mv-sum { max-width: 620px; margin: 22px auto 0; font-size: 16px; line-height: 1.5; color: #ddd; }
#mv .mv-btns { margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#mv .mv-btns button { pointer-events: auto; border: 0; border-radius: 22px; padding: 11px 22px; font-size: 16px; font-weight: 700; background: #c8102e; color: #fff; }
#mv .mv-btns .mv-free { background: rgba(255,255,255,.14); }
/* concert sing-along lyrics */
#lyrics { position: fixed; left: 50%; bottom: 36%; transform: translateX(-50%); width: min(64vw, 640px); text-align: center; pointer-events: none; z-index: 30; transition: opacity .4s; text-shadow: 0 2px 6px rgba(0, 0, 0, .85), 0 0 2px #000; }
#lyrics .lyr-now { display: inline-block; background: rgba(10, 14, 22, .45); border-radius: 12px; padding: 4px 14px; color: #fff; font-weight: 800; font-size: clamp(17px, 3.4vw, 30px); line-height: 1.25; }
#lyrics .lyr-next { background: none; padding: 0; border: 0; color: rgba(255, 255, 255, .62); font-weight: 600; font-size: clamp(13px, 2.4vw, 20px); margin-top: 6px; }
#lyrics .lyr-now.pop { animation: lyrpop .35s ease-out; }
@keyframes lyrpop { from { transform: translateY(8px); opacity: .2; } to { transform: none; opacity: 1; } }
body.cine #lyrics { display: none; }

/* online play */
#mpbar { position: fixed; left: 10px; top: 46%; z-index: 25; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#mpbar > button { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(15, 23, 32, .6); font-size: 20px; }
#mpbar > button.on { background: rgba(46, 160, 90, .75); }
#mp-talk.on { background: rgba(200, 16, 46, .8) !important; transform: scale(1.12); }
#mp-feed { position: fixed; left: 62px; top: 46%; max-width: min(60vw, 360px); font: 600 13px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; }
#mp-feed div { background: rgba(10, 16, 26, .5); border-radius: 8px; padding: 3px 8px; margin-bottom: 4px; transition: opacity 1s; }
#mp-feed div.old { opacity: 0; }
#mp-form { position: fixed; left: 50%; bottom: 40%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; z-index: 40; }
#mp-form input { width: min(70vw, 380px); padding: 10px 12px; border-radius: 10px; border: 0; font-size: 16px; }
#mp-form button { padding: 10px 14px; border-radius: 10px; border: 0; background: #ffc400; font-weight: 800; }
body.cine #mpbar { display: none; }
/* in-game question box */
#ask { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(5, 10, 18, .55); }
#ask[hidden] { display: none; }
#ask .ask-in { width: min(88vw, 420px); background: #101a26; color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font: 500 16px system-ui, sans-serif; }
#ask .ask-q { margin: 0 0 14px; line-height: 1.4; }
#ask .ask-i { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .3); background: #0a121c; color: #fff; font: inherit; margin-bottom: 14px; }
#ask .ask-b { display: flex; gap: 10px; justify-content: flex-end; }
#ask button { padding: 9px 18px; border-radius: 10px; border: 0; font: 700 15px system-ui, sans-serif; cursor: pointer; }
#ask .ask-no { background: rgba(255, 255, 255, .14); color: #fff; }
#ask .ask-ok { background: #c8102e; color: #fff; }
/* health */
#hpbar { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%) translateY(44px); display: flex; align-items: center; gap: 6px; z-index: 20; pointer-events: none; font: 700 14px system-ui, sans-serif; color: #ff5a6a; text-shadow: 0 1px 2px #000; }
#hpbar .hp-in { width: 120px; height: 9px; border-radius: 6px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .5); overflow: hidden; }
#hpbar .hp-fill { height: 100%; width: 100%; transition: width .2s; }
body.hurt #game, body.hurt canvas { filter: saturate(1.6) brightness(1.15) sepia(.35) hue-rotate(-30deg); }
/* free-roam games */
#gamebar { position: fixed; left: 10px; top: calc(46% + 160px); z-index: 25; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px; pointer-events: none; max-width: 300px; }
#gamebar > button { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(15, 23, 32, .6); font-size: 20px; }
#gamebar > button.on { background: rgba(46, 160, 90, .75); }
#gamebar > button.blink { animation: gblink .6s infinite alternate; }
@keyframes gblink { to { background: rgba(255, 200, 0, .85); transform: scale(1.12); } }
#g-score { pointer-events: none; font: 800 18px system-ui, sans-serif; color: #ffe14a; text-shadow: 0 1px 3px #000; background: rgba(15, 23, 32, .55); padding: 4px 10px; border-radius: 12px; }
#g-board { flex-basis: 100%; pointer-events: none; font: 600 12px system-ui, sans-serif; color: #fff; background: rgba(15, 23, 32, .55); border-radius: 10px; padding: 6px 8px; min-width: 130px; }
#g-board div { display: flex; justify-content: space-between; gap: 10px; } #g-board .me { color: #ffe14a; }
#g-board[hidden] { display: none; }
.g-pop { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 30; font: 800 18px system-ui, sans-serif; text-shadow: 0 2px 6px #000; pointer-events: none; animation: gpop 1.1s ease-out forwards; }
@keyframes gpop { from { opacity: 1; transform: translate(-50%, 0) scale(1.2); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
#g-count { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 30; font: 900 72px system-ui, sans-serif; color: #fff; text-shadow: 0 3px 10px #000; pointer-events: none; }
.start-btns .online { background: #1f7ae0; color: #fff; }
body.cine #gamebar, body.cine #hpbar, body.cine #mpbar { display: none; }
#g-chinfo { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 26; background: rgba(15, 23, 32, .82); color: #fff; font: 600 14px system-ui, sans-serif; padding: 6px 14px; border-radius: 16px; border: 1px solid rgba(255, 210, 74, .6); white-space: nowrap; pointer-events: none; }
body.cine #g-chinfo { display: none; }
#dead { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 40; background: rgba(20, 10, 18, .82); color: #fff; font: 800 22px system-ui, sans-serif; padding: 16px 26px; border-radius: 18px; border: 2px solid #ff5a7a; pointer-events: none; text-align: center; }
body.hurt #dead { border-color: #fff; }
.g-team-r { color: #ff5a5a !important; } .g-team-b { color: #5aa8ff !important; }
#g-ride { background: #2ad06a !important; }
#g-board .g-round { font-size: 11px; opacity: .85; margin-bottom: 2px; }
#g-crew.off { opacity: .45; }
/* phones: smaller buttons, and the less-used game buttons tucked behind ⋯ */
#g-more { display: none; }
@media (max-width: 600px), (pointer: coarse) and (max-width: 900px) {
  .btn-round { width: 42px !important; height: 42px !important; font-size: 18px !important; border-width: 1.5px; }
  .btn-round.big { width: 52px !important; height: 52px !important; font-size: 23px !important; }
  #gamebar { top: calc(46% + 126px); gap: 5px; max-width: 220px; }
  #gamebar > button { width: 36px; height: 36px; font-size: 16px; border-width: 1.5px; }
  #gamebar #g-score { font-size: 13px; padding: 3px 8px; }
  #g-more { display: block; }
  #gamebar:not(.more) > .g-x { display: none; }
  #gamebar #g-board { font-size: 11px; max-width: 170px; min-width: 120px; }
  #mpbar > button { width: 36px; height: 36px; font-size: 16px; }
  #hpbar { transform: translateX(-50%) translateY(46px) scale(.85); }
  #g-board > div:nth-child(n+5) { display: none; }
  #buttons { grid-template-columns: repeat(4, auto); gap: 6px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
}

#g-more { display: block; }
#gamebar:not(.more) > .g-x { display: none; }
/* peaceful free roam: no weapons, crews or scoreboard */
#gamebar.peace #g-weapon, #gamebar.peace #g-fire, #gamebar.peace #g-team, #gamebar.peace #g-board, #gamebar.peace #g-score { display: none !important; }
/* frame rate counter (Settings) */
#fps { position: fixed; left: 8px; bottom: 6px; z-index: 30; background: rgba(10,16,26,.7); color: #b8ffb0; font: 600 12px/1 ui-monospace, monospace; padding: 5px 9px; border-radius: 8px; pointer-events: none; }
/* hero powers (earned with good deeds): fly 🦸 and web line 🕸️, with the power left */
#gamebar > button.pw-btn { position: relative; border-color: rgba(255, 214, 90, .85); background: rgba(60, 40, 110, .7); }
#gamebar > button.pw-btn.on { background: rgba(200, 140, 20, .85); }
#gamebar > button.pw-btn small { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); font: 700 10px/1 system-ui, sans-serif; color: #ffe08a; text-shadow: 0 1px 2px #000; white-space: nowrap; }
