/* Night in Lagos: deliberate single dark theme, lantern orange for actions, chore green for progress, thief red. */
:root {
  color-scheme: dark;
  --bg: #0d1018;
  --surface: #171c28;
  --surface-2: #222939;
  --line: #313a4f;
  --text: #f4efe6;
  --muted: #a9b0c2;
  --lantern: #ffb347;
  --green: #2bd47d;
  --red: #ff5d5d;
  --ink: #141008;
  --font-display: "Bungee", Impact, "Arial Black", sans-serif;
  --font-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; line-height: 1.05; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lantern); }
.sr { position: absolute; left: -9999px; }
.btn { min-height: 50px; padding: 12px 20px; border: 0; border-radius: 14px; background: var(--lantern); color: var(--ink); font-weight: 800; font-size: 16px; box-shadow: 0 5px 0 #b36f12; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b36f12; }
.btn[disabled] { background: var(--surface-2); color: #6d7590; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: rgba(23,28,40,.8); color: var(--text); border: 2px solid var(--line); box-shadow: none; }
.btn-red { background: var(--red); box-shadow: 0 5px 0 #a32929; color: #1a0505; }
.btn-green { background: var(--green); box-shadow: 0 5px 0 #168a4e; color: #04150b; }
.btn-sm { min-height: 42px; padding: 8px 14px; font-size: 14.5px; }
.btn-block { width: 100%; }
.field { width: 100%; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); padding: 10px 14px; font-size: 16px; }
.field:focus { border-color: var(--lantern); outline: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.red { color: #ffc4c4; border-color: #6a2b2b; background: #2e1717; }
.chip.green { color: #b9f5d4; border-color: #1f5a3b; background: #13281d; }
.chip.gold { color: var(--ink); background: var(--lantern); border-color: var(--lantern); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Menu with live background ---------- */
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
#bg[hidden] { display: none; }
.menu-shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, rgba(13,16,24,.35) 0%, rgba(13,16,24,.55) 45%, rgba(13,16,24,.9) 100%); }
.menu { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: max(18px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(22px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.logo { text-align: center; padding-top: 6px; }
.logo h1 { font-size: clamp(48px, 16vw, 80px); color: var(--lantern); text-shadow: 0 5px 0 #6b3a06, 0 12px 30px rgba(0,0,0,.6); }
.logo h1 span { color: var(--green); text-shadow: 0 5px 0 #0b4a2a, 0 12px 30px rgba(0,0,0,.6); }
.logo p { margin: 6px 0 0; font-weight: 700; text-shadow: 0 2px 8px #000; }
.me-card { margin-top: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: rgba(23,28,40,.85); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; backdrop-filter: blur(6px); }
.me-card canvas { width: 56px; height: 70px; }
.me-card strong { display: block; font-size: 18px; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 62px; border-radius: 16px; border: 2px solid var(--line); background: rgba(23,28,40,.88); font-weight: 800; font-size: 15px; backdrop-filter: blur(6px); }
.tile:hover { border-color: var(--lantern); }
.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.tile .ico { stroke: var(--lantern); }
.play-btn { min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; }
.play-btn b { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: 1px; line-height: 1; }
.play-btn small { font-size: 13px; font-weight: 700; opacity: .8; }
.foot { text-align: center; }
.linkish { background: none; border: 0; padding: 8px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.sheet { background: rgba(23,28,40,.95); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(8px); }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { font-size: 24px; flex: 1; min-width: 0; }
.back { min-width: 44px; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 18px; display: grid; place-items: center; }
.sim-note { margin: 0; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }

/* Modes */
.mode-card { display: flex; flex-direction: column; gap: 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); padding: 12px; text-align: left; }
.mode-card[aria-pressed="true"] { border-color: var(--lantern); }
.mode-card canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; display: block; }
.mode-card strong { font-family: var(--font-display); font-weight: 400; font-size: 20px; }

/* Servers */
.server-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.server-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; font-size: 14.5px; }
.server-list { display: flex; flex-direction: column; gap: 8px; }
.server { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.server strong { display: block; font-size: 15.5px; line-height: 1.25; }
.server .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.server .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.server-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.count { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.count .ico { width: 16px; height: 16px; }
.count.full { color: var(--red); }
.filter-on { background: var(--lantern) !important; color: var(--ink) !important; border-color: var(--lantern) !important; }
.pick { min-height: 42px; min-width: 52px; padding: 8px 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 14.5px; }
.pick[aria-pressed="true"] { background: var(--lantern); border-color: var(--lantern); color: var(--ink); }
.pick[disabled] { opacity: .35; cursor: not-allowed; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }
.code { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 14px; padding: 8px 14px; }
.code b { font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: 3px; color: var(--lantern); }
.status { text-align: center; font-weight: 700; font-size: 16px; margin: 0; }
.status.go { color: var(--green); font-family: var(--font-display); font-weight: 400; font-size: 22px; }

/* Customize */
.dressing { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; }
.mirror { background: radial-gradient(circle at 50% 70%, #2b3550, #141925 70%); border-radius: 16px; border: 1px solid var(--line); display: grid; place-items: center; height: 170px; }
.mirror canvas { width: 120px; height: 160px; animation: idle 2.4s ease-in-out infinite; }
@keyframes idle { 50% { transform: translateY(-3px); } }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--lantern); border-color: var(--lantern); color: var(--ink); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.2; }
.opt canvas { width: 60px; height: 76px; }
.opt[aria-pressed="true"] { border-color: var(--lantern); background: #3a2f1f; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 42px; height: 42px; border-radius: 50%; border: 3px solid transparent; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); padding: 0; }
.sw[aria-pressed="true"] { border-color: var(--lantern); }
.label { font-weight: 700; font-size: 14px; margin: 0 0 8px; }

/* Friends + settings */
.friend { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.friend:last-child { border-bottom: 0; }
.friend canvas { width: 40px; height: 50px; }
.invite { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.invite input { width: 22px; height: 22px; accent-color: var(--green); }
.xbtn { min-width: 40px; min-height: 40px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--muted); font-weight: 800; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.setting { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.setting-top strong { font-size: 15.5px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--lantern); color: var(--ink); }
.switch { width: 56px; height: 32px; border-radius: 99px; border: 0; background: var(--surface-2); position: relative; flex: 0 0 auto; box-shadow: inset 0 0 0 2px var(--line); }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--green); box-shadow: none; }
.switch[aria-checked="true"]::after { transform: translateX(24px); background: #04150b; }

/* ---------- Game + lobby screens ---------- */
.wrap { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px; }
.lobby-head { display: flex; align-items: center; gap: 10px; }
.lobby-head h2 { font-size: 20px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hud { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.role { padding: 5px 12px; border-radius: 99px; font-weight: 800; font-size: 13px; white-space: nowrap; background: var(--green); color: #04150b; }
.role.thief { background: var(--red); color: #1a0505; }
.role.ghost { background: var(--surface-2); color: var(--muted); }
.taskbar { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.taskbar span { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.taskbar i { display: block; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.taskbar i b { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s; }
.alive { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; line-height: 1.25; }
.stage { position: relative; border-radius: 16px; overflow: hidden; border: 2px solid var(--line); background: #06080d; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { display: block; width: 100%; height: min(62vh, 580px); min-height: 330px; touch-action: none; }
.stage.short canvas { height: min(50vh, 480px); min-height: 300px; }
.toasts { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(13,16,24,.9); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 14px; font-weight: 600; text-align: center; animation: pop .25s ease-out; }
.toast.bad { border-color: var(--red); color: #ffd0d0; }
.toast.good { border-color: var(--green); }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.actions .btn { min-height: 54px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.panel h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--lantern); }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.tasks li { display: flex; gap: 4px 8px; align-items: baseline; flex-wrap: wrap; }
.tasks li::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--lantern); flex: 0 0 auto; align-self: center; }
.tasks li.done { color: var(--muted); text-decoration: line-through; }
.tasks li.done::before { background: var(--green); border-color: var(--green); }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(5,7,12,.85); display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal.wide { max-width: 640px; padding: 14px; gap: 12px; }
.modal-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.modal-head h2 { font-size: 22px; }
.x { background: var(--surface-2); border: 0; border-radius: 10px; min-width: 44px; min-height: 44px; font-size: 20px; font-weight: 800; }
.reveal { text-align: center; align-items: center; }
.reveal .big-role { font-size: 40px; }
.reveal canvas { width: 96px; height: 122px; }
.partners { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.partners figure { margin: 0; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; color: #ffc4c4; }
.partners canvas { width: 56px; height: 70px; }
.how-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

/* Meeting */
.timer { font-family: var(--font-display); font-weight: 400; font-size: 20px; padding: 4px 12px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--red); }
.scene { width: 100%; border-radius: 14px; display: block; aspect-ratio: 440 / 240; height: auto; border: 1px solid var(--line); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 170px; overflow-y: auto; padding-right: 4px; }
.line { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; animation: pop .25s ease-out; }
.dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.line b { display: block; font-size: 12.5px; }
.line p { margin: 0; background: var(--surface-2); border-radius: 4px 12px 12px 12px; padding: 6px 10px; font-size: 14.5px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.vcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 13px; text-align: center; min-height: 96px; }
.vcard canvas { width: 40px; height: 50px; }
.vcard[aria-pressed="true"] { border-color: var(--red); background: #2e1717; }
.vcard[disabled] { opacity: .45; cursor: default; }
.vcard .badge { position: absolute; top: 4px; right: 4px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: var(--green); color: #04150b; }
.vcard .tally { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.result { text-align: center; font-size: 18px; font-weight: 700; margin: 0; }
.end-title { font-size: 40px; text-align: center; }

/* Chore mini-games */
.meter { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter .zone { position: absolute; top: 0; bottom: 0; background: rgba(43,212,125,.45); border-left: 2px solid var(--green); border-right: 2px solid var(--green); }
.meter .needle { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2px; background: var(--lantern); border-radius: 3px; }
.tank { height: 160px; width: 110px; margin: 0 auto; border: 3px solid var(--line); border-radius: 12px 12px 18px 18px; background: var(--surface-2); position: relative; overflow: hidden; }
.tank b { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#5ec8ff, #1f7fd1); }
.battery { height: 70px; width: 200px; max-width: 80%; margin: 10px auto; border: 4px solid var(--line); border-radius: 12px; position: relative; background: var(--surface-2); }
.battery::after { content: ""; position: absolute; right: -14px; top: 22px; width: 10px; height: 18px; background: var(--line); border-radius: 0 4px 4px 0; }
.battery b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #2bd47d, #9cf2c4); }
.tyre { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; background: #1b1b1b; display: grid; place-items: center; transition: transform .1s; border: 6px solid #333; }
.tyre b { width: 60px; height: 60px; border-radius: 50%; background: #9aa; display: grid; place-items: center; color: #111; font-weight: 800; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid button { min-height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 17px; }
.grid button.ok { background: var(--green); color: #04150b; border-color: var(--green); }
.grid button.bad { border-color: var(--red); }
.grid button.sel { border-color: var(--lantern); box-shadow: 0 0 0 3px rgba(255,179,71,.35); }
.grid.small button { font-size: 13.5px; min-height: 52px; padding: 4px; }
.cloth i { display: block; width: 32px; height: 28px; margin: 0 auto; background: var(--c); clip-path: var(--shape, polygon(25% 0, 75% 0, 100% 25%, 85% 40%, 80% 30%, 80% 100%, 20% 100%, 20% 30%, 15% 40%, 0 25%)); }
.grid button.cloth.ok { background: var(--surface); border-color: var(--green); }
.cloth.ok i { opacity: .3; }
.wires { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.wires div { display: flex; flex-direction: column; gap: 6px; }
.wire { min-height: 42px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 10px; font-weight: 700; font-size: 14.5px; }
.wire i { width: 24px; height: 10px; border-radius: 5px; background: var(--c); flex: 0 0 auto; }
.wire.sel { border-color: var(--lantern); }
.wire.ok { border-color: var(--green); background: #13281d; }
.pound { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mortar { width: 140px; height: 90px; margin: 0 auto; background: #6b4a2a; border-radius: 0 0 50px 50px; border-top: 10px solid #8a643c; display: grid; place-items: center; font-weight: 800; color: #f4efe6; }
.yard { position: relative; height: 200px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.spec { position: absolute; width: 40px; height: 40px; border: 0; transform: rotate(var(--r)); box-shadow: inset -4px -4px 0 rgba(0,0,0,.2); }
.pot { font-size: 15px; text-align: center; margin: 0; }
.pot-vis { width: 150px; height: 110px; margin: 0 auto; border-radius: 0 0 70px 70px; background: #3a3a3a; border-top: 14px solid #555; position: relative; overflow: hidden; }
.pot-vis b { position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, #ff7a2f, #c43b12); transition: filter .2s; }
.receipt { background: #f4efe6; color: #1c1408; border-radius: 6px; padding: 10px 14px; font-size: 15px; display: flex; flex-direction: column; gap: 3px; }
.receipt div { display: flex; justify-content: space-between; }
.round { font-size: 13px; font-weight: 800; color: var(--lantern); margin: 0; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Shop, locks and sponsors ---------- */
.opt.locked, .sw.locked { position: relative; opacity: .8; }
.opt.locked canvas { filter: grayscale(.6) brightness(.8); }
.opt .lock { font-size: 11px; font-weight: 800; color: var(--ink); background: var(--lantern); border-radius: 99px; padding: 1px 7px; margin-top: 2px; }
.sw.locked::after { content: "₦"; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--lantern); color: var(--ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.shop-tile { border-color: var(--lantern); }
.shop-list { display: flex; flex-direction: column; gap: 10px; }
.shop-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.shop-item.focus { border-color: var(--lantern); box-shadow: 0 0 0 3px rgba(255,179,71,.25); }
.shop-item strong { display: block; font-size: 16px; margin: 6px 0 2px; }
.shop-item .btn { min-height: 44px; padding: 8px 14px; white-space: nowrap; }
.sponsor { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); background: rgba(23,28,40,.9); border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.sponsor img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; flex: 0 0 auto; }
.sponsor small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sponsor b { display: block; font-size: 15px; }
.sponsor.empty { justify-content: center; color: var(--muted); font-weight: 700; text-align: center; }
.foot a.linkish { display: inline; }

/* Accounts */
.me-btns { display: flex; flex-direction: column; gap: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .linkish { align-self: flex-start; padding: 0; }
.acct-top { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.acct-top canvas { width: 84px; height: 104px; }
.acct-name { font-family: var(--font-display); font-size: 24px; color: var(--lantern); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-family: var(--font-display); font-size: 22px; }
.stats span { font-size: 12px; color: var(--muted); }
#srvSearch { width: 100%; }

/* "Tap your screen to hear the music" message shown until the first tap */
.music-hint { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; width: min(420px, calc(100% - 32px)); display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--lantern); background: rgba(23,28,40,.96); color: var(--text, #f4efe6); font-family: Rubik, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.45); cursor: pointer; animation: hint-in .45s ease both; }
.music-hint .mh-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--lantern); color: #1a1408; font-size: 20px; animation: hint-pulse 1.6s ease-in-out infinite; }
.music-hint .mh-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.music-hint b { font-size: 15px; }
.music-hint small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.music-hint[hidden] { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes hint-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .music-hint, .music-hint .mh-icon { animation: none; } }

/* Server list: search + refresh */
.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row .field { flex: 1; min-width: 0; }
.refresh-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding-inline: 14px; }
.search-row .refresh-btn:only-child { margin-left: auto; }
.refresh-btn.spinning .ico { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Live stats on the main menu */
.live-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: -4px; }
.live-stats b { color: var(--text, #f4efe6); font-weight: 800; }
.live-stats .live { display: inline-flex; align-items: center; gap: 6px; }
.live-stats .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(43,212,125,.6); animation: livepulse 2s ease-out infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(43,212,125,.6); } 100% { box-shadow: 0 0 0 8px rgba(43,212,125,0); } }
@media (prefers-reduced-motion: reduce) { .live-stats .dot { animation: none; } }

/* Practice mode button under Play */
.practice-btn { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 10px 16px; }
.practice-btn .ico { grid-row: span 2; }
.practice-btn small { grid-column: 2; font-size: 12px; color: var(--muted); font-weight: 500; }

/* Story briefing before each round */
.story { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.story h2 { font-size: clamp(24px, 6vw, 32px); color: var(--lantern); }
.story p { margin: 0; line-height: 1.5; }
.story-dots { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.story-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.story-dots span.on { background: var(--lantern); width: 22px; border-radius: 4px; }
.story-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.side-card { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.side-card.good { border-color: rgba(43,212,125,.55); }
.side-card.good strong { color: var(--green); }
.side-card.bad { border-color: rgba(255,93,93,.55); }
.side-card.bad strong { color: var(--red); }
.side-card p { font-size: 14px; }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; }
.role-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.role-list li strong { color: var(--green); font-size: 14px; }
.role-list li.thief strong { color: var(--red); }
.role-list li span { font-size: 13px; color: var(--muted); }
