:root {
  --c1: #5b5bd6; --c2: #ffb703; --c3: #2a9d8f;
  --ink: #23263a; --muted: #6c7086; --panel: #fff; --bg: #f3efe6; --line: #e7e0d2;
  --r: 22px; --shadow: 0 2px 0 rgba(35, 38, 58, .06), 0 10px 30px rgba(35, 38, 58, .10);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; margin-bottom: 6px; }
p { line-height: 1.45; }
a { color: var(--c1); font-weight: 700; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; display: block; }
.center-block { display: block; margin: 8px auto; }
.mt { margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn.big { flex: 1 1 200px; width: auto; }

.page { max-width: 1100px; margin: 0 auto; padding: 12px 16px 60px; }
.page.narrow { max-width: 620px; }
.panel { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }

/* Buttons */
.btn {
  border: 0; border-radius: 16px; padding: 12px 18px; font-family: var(--display); font-weight: 600; font-size: 1rem;
  background: var(--c1); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); transition: transform .08s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.btn.big { width: 100%; padding: 15px; font-size: 1.08rem; margin-top: 10px; }
.btn.small { padding: 7px 12px; font-size: .88rem; border-radius: 12px; }
.btn.gold { background: var(--c2); color: #2b2100; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), inset 0 -4px 0 var(--line); }
.btn.off { background: #dcd6ca; color: #6b6458; }
.btn.link { background: none; color: var(--c1); box-shadow: none; }
.btn small { font-family: var(--font); font-weight: 600; opacity: .8; }
.ibtn { border: 0; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.85); box-shadow: var(--shadow); font-size: 1.1rem; flex: none; display: grid; place-items: center; }
.ibtn.ghost { background: transparent; box-shadow: none; }
.ibtn.tiny { width: 28px; height: 28px; font-size: .8rem; border-radius: 9px; box-shadow: none; background: #f1ece2; }
.linkish { border: 0; background: none; color: var(--c1); font-weight: 800; padding: 6px 4px; }
.pill { display: inline-block; background: #f1ece2; border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: .82rem; white-space: nowrap; }
.coins { font-family: var(--display); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.coins i { font-style: normal; }

/* Forms */
label { display: block; font-weight: 700; margin: 12px 0 4px; }
input:not([type=radio]):not([type=checkbox]):not([type=range]), select, textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; padding: 13px 15px; border-radius: 14px;
  border: 2px solid var(--line); background: #fffdf8; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c1); }
textarea { resize: vertical; }
.lbl { font-weight: 700; margin: 16px 0 8px; }
.check { display: flex; gap: 8px; font-weight: 600; align-items: center; }
.steps { padding-left: 20px; line-height: 1.6; margin: 0 0 8px; }
code { background: #f1ece2; padding: 1px 5px; border-radius: 5px; }
details { margin-top: 8px; }
.seg { display: inline-flex; background: #f1ece2; border-radius: 14px; padding: 4px; gap: 4px; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.seg button { border: 0; background: none; padding: 9px 12px; border-radius: 11px; font-weight: 800; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.faces label { margin: 0; }
.faces input { display: none; }
.faces .face { width: 100%; aspect-ratio: 1; border-radius: 50%; background: #eef4ff; border: 3px solid transparent; cursor: pointer; transition: transform .15s; }
.faces input:checked + .face { border-color: var(--c1); transform: scale(1.06); background: color-mix(in srgb, var(--c1) 15%, #fff); }
.levels { display: grid; gap: 8px; }
.lvl { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: left; width: 100%; font-weight: 600; }
.lvl input { display: none; }
.lvl > b { font-family: var(--display); font-size: 1.1rem; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #f1ece2; flex: none; }
.lvl span { color: var(--muted); font-size: .86rem; }
.lvl strong { display: block; color: var(--ink); font-size: 1rem; }
.lvl:has(input:checked), .lvl.sel { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 8%, #fff); }
.lvl:has(input:checked) > b, .lvl.sel > b { background: var(--c1); color: #fff; }

/* Faces */
.face { display: block; object-fit: contain; }
.face.sm { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.face.big { width: 64px; height: 64px; border-radius: 50%; background: #eef4ff; }
.face.mini { width: 34px; height: 34px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.face.hero { width: 112px; height: 112px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); }

/* Home */
.home { padding-top: 0; }
.hero { text-align: center; padding: 30px 0 6px; }
.logo { width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 28px; display: grid; place-items: center; font-size: 3.2rem;
  background: linear-gradient(160deg, #8fd3ff, #c9b8ff); box-shadow: var(--shadow); animation: bob 3s ease-in-out infinite; }
.hero h1 { font-size: 2.6rem; }
.hero h1 em { font-style: normal; color: var(--c1); }
.hero p { color: var(--muted); margin: 6px 0 0; }
.section { margin: 26px 0 10px; }
.player { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; }
.player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.player-head > div { flex: 1; }
.citylist { display: grid; gap: 8px; }
.citycard { display: flex; align-items: center; gap: 12px; border: 0; text-align: left; padding: 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--cc) 10%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cc) 25%, #fff); }
.citycard:hover { transform: translateY(-1px); }
.citycard.add { justify-content: center; font-weight: 800; color: var(--muted); background: #faf7f1; box-shadow: inset 0 0 0 2px var(--line); }
.cflag { font-size: 2rem; }
.cinfo { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cinfo b { font-family: var(--display); font-weight: 600; font-size: 1.08rem; }
.cinfo small { color: var(--muted); }
.cstats { display: grid; justify-items: end; gap: 2px; }
.prog { display: block; height: 8px; border-radius: 9px; background: rgba(0,0,0,.07); overflow: hidden; margin-top: 4px; }
.prog i { display: block; height: 100%; background: var(--cc, var(--c1)); border-radius: 9px; }
.keycard { border: 3px solid var(--c2); }
.keyhelp p { margin: 6px 0; font-size: .95rem; }
.ok { color: #15803d; font-size: .85rem; margin-left: 6px; }

/* Top bar on simple pages */
.bar { display: flex; align-items: center; gap: 12px; padding: 8px 0; }

/* City */
.citypage { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sky-day { background: linear-gradient(180deg, #8fd3ff 0, #d8f1ff 380px, #eaf6e4 100%); }
.sky-dusk { background: linear-gradient(180deg, #ff9a8b 0, #fecf8a 380px, #f3e6d6 100%); }
.sky-night { background: linear-gradient(180deg, #141a3d 0, #2c3270 420px, #3a3768 100%); color: #f2f2ff; }
.sky-night .muted { color: #c0c3e6; }
.hud { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sky-night .hud { background: rgba(20, 26, 61, .6); }
.hud-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-title h2 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-title small { color: inherit; opacity: .75; }
.hud-title .linkish { color: inherit; padding: 0; font-size: inherit; }
.purse { background: var(--c2); color: #2b2100; padding: 9px 14px; border-radius: 999px; font-size: 1.05rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.dock { position: fixed; z-index: 7; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 6px; padding: 8px; background: rgba(255,255,255,.92); border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); max-width: calc(100vw - 24px); }
.dock button { position: relative; border: 0; background: none; width: 64px; padding: 6px 0; border-radius: 16px; display: grid; justify-items: center; gap: 2px; font-size: 1.35rem; color: var(--ink); }
.dock button span { font-size: .68rem; font-weight: 800; color: var(--muted); }
.dock button:hover:not(:disabled) { background: #f1ece2; }
.dock button.gold { background: var(--c2); }
.dock button.gold span { color: #2b2100; }
.dock em { position: absolute; top: 2px; right: 10px; background: #ef4444; color: #fff; font-style: normal; font-size: .7rem; font-weight: 900; border-radius: 99px; padding: 1px 6px; }
.notes { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 0; scrollbar-width: none; flex: none; }
.notes:empty { display: none; }
.notes::-webkit-scrollbar { display: none; }
.notes .note { width: auto; max-width: 300px; margin: 0; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; padding: 8px 12px; border-radius: 999px; }
.note { display: block; width: calc(100% - 32px); max-width: 760px; margin: 10px auto 0; border: 0; text-align: left; background: rgba(255,255,255,.9); color: var(--ink);
  border-radius: 16px; padding: 10px 14px; font-size: .92rem; box-shadow: var(--shadow); }
.note.event { background: #fff4d6; }
.note.favour { background: #ffe9ec; }
.note .pill { float: right; background: var(--c2); }
.mapwrap { flex: 1; min-height: 0; position: relative; }
.isomap { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.isomap:active { cursor: grabbing; }
.isomap .who, .isomap .plabel { display: none; }
.isomap.show-faces .who { display: inline; }
.isomap.show-names .plabel { display: inline; }
.isomap .splash { animation: splash 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.isomap .flag { animation: wave 2s ease-in-out infinite; transform-box: fill-box; transform-origin: left; }
.zoom { position: absolute; right: 12px; bottom: 100px; display: grid; gap: 6px; }
.zoom button { width: 42px; height: 42px; border: 0; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.isomap .bld { cursor: pointer; transition: transform .2s; transform-box: fill-box; }
.isomap .bld:hover { transform: translateY(-6px); }
.isomap .who { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; }
.isomap .who.tired { animation: none; opacity: .5; }
.isomap .mark { animation: bob 1s ease-in-out infinite; transform-box: fill-box; }
.isomap .fog { cursor: pointer; }
.isomap .fog:hover { opacity: .9; }
.street { background: rgba(255,255,255,.75); border-radius: var(--r); padding: 12px; margin: 14px 0; color: var(--ink); }
.sign { display: inline-block; background: var(--c1); color: #fff; font-family: var(--display); padding: 5px 12px; border-radius: 10px; margin-bottom: 10px; }
.cards { display: grid; gap: 8px; }
.binfo { flex: 1; display: grid; min-width: 0; }
.binfo small { color: var(--muted); }

/* Chat */
.chat { max-width: 720px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.scene { position: relative; height: 178px; flex: none; overflow: hidden; border-radius: 0 0 28px 28px; }
.scene .back { position: absolute; top: 12px; left: 12px; z-index: 2; }
.scene-bld { position: absolute; right: 3%; bottom: -10px; }
.scene-bld svg { height: 168px; width: auto; display: block; }
.scene-who { position: absolute; left: 14px; bottom: 10px; display: flex; align-items: flex-end; gap: 6px; }
.scene-who .face.hero { width: 118px; height: 118px; }
.who-card { background: rgba(255,255,255,.92); color: var(--ink); border-radius: 16px; padding: 8px 12px; margin-bottom: 10px; display: grid; box-shadow: var(--shadow); }
.who-card b { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.who-card small { color: var(--muted); }
.hearts { font-size: .7rem; letter-spacing: -1px; }
.turns { position: absolute; top: 20px; left: 64px; display: flex; gap: 5px; align-items: center; background: rgba(255,255,255,.85); padding: 6px 9px; border-radius: 99px; font-size: .8rem; }
.turns i { width: 10px; height: 10px; border-radius: 50%; background: #d9d3c6; }
.turns i.on { background: var(--c1); }
.mission { margin: -16px 14px 0; position: relative; z-index: 2; background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow);
  display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .95rem; border-left: 6px solid var(--c2); }
.mission.fav { border-left-color: #ef476f; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg.new { animation: pop .2s; }
.msg.me { align-self: flex-end; }
.bub { background: #fff; padding: 10px 14px; border-radius: 20px 20px 20px 6px; box-shadow: 0 2px 8px rgba(0,0,0,.06); font-size: 1.06rem; line-height: 1.42; }
.msg.me .bub { background: var(--c1); color: #fff; border-radius: 20px 20px 6px 20px; }
.tr { color: var(--muted); font-size: .9rem; margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.tools { display: flex; gap: 6px; margin-top: 7px; }
.tools button { border: 0; background: #f1ece2; border-radius: 9px; padding: 4px 10px; font-size: .8rem; font-weight: 800; }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: #c9c2b4; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.waitnote { color: var(--muted); font-size: .82rem; padding-left: 44px; }
.footer { padding: 8px 14px max(14px, env(safe-area-inset-bottom)); }
.composer { display: flex; gap: 8px; align-items: center; }
.composer input { margin: 0 !important; flex: 1; font-size: 1.05rem !important; border-radius: 999px !important; padding: 14px 18px !important; }
.send { border: 0; width: 50px; height: 50px; border-radius: 50%; background: var(--c1); color: #fff; font-size: 1.2rem; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.mic { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 0; font-size: 1.55rem; background: var(--c2); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.mic.rec { background: #ff5a5a; animation: ring 1.2s infinite; }
.byebtn { margin: 0 0 10px; animation: pop .3s; }
.chatactions { display: flex; justify-content: space-between; padding: 4px 4px 0; }
.hintbox { background: #fff4d6; border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; display: grid; }

/* Result */
.result { text-align: center; }
.result-top { display: flex; justify-content: center; align-items: center; gap: 8px; }
.ring { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c1) calc(var(--p) * 1%), #ece6da 0); animation: pop .4s; }
.ring > div { width: 102px; height: 102px; border-radius: 50%; background: #fff; display: grid; place-items: center; align-content: center; }
.scorenum { font-family: var(--display); font-size: 2.5rem; font-weight: 600; line-height: 1; }
.ring small { color: var(--muted); font-weight: 700; }
.result h2 { font-size: 1.6rem; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 118px 1fr 48px; gap: 10px; align-items: center; text-align: left; font-size: .9rem; font-weight: 700; margin: 8px 0; }
.bar > div { height: 12px; background: #ece6da; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c1); border-radius: 99px; }
.how { text-align: left; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: .9rem; }
.how summary { cursor: pointer; font-weight: 800; color: var(--c1); }
.how ul { padding-left: 18px; line-height: 1.5; }
.how p { color: var(--muted); }
.rewards { background: #fff4d6; font-weight: 800; display: grid; gap: 6px; }
.favourcard { background: #ffe9ec; line-height: 1.5; }
.favourcard small { display: block; color: var(--muted); }
.corr { border-top: 1px solid var(--line); padding: 10px 0; }
.corr:first-of-type { border-top: 0; }
.wrong { color: #c2410c; text-decoration: line-through; text-decoration-color: rgba(194,65,12,.4); }
.right { color: #15803d; font-weight: 800; display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.memcard { background: color-mix(in srgb, var(--c3) 12%, #fff); }
.levelup { background: color-mix(in srgb, var(--c2) 25%, #fff); }

/* Sheets */
#modal { position: fixed; inset: 0; background: rgba(20, 24, 40, .5); display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#modal.open { display: flex; animation: fade .15s; }
.sheet { background: #fff; color: var(--ink); border-radius: 28px; padding: 20px; width: 100%; max-width: 460px; position: relative; max-height: 90vh; overflow: auto; animation: up .22s; }
.sheet.still { animation: none; }
.x { position: absolute; top: 12px; right: 12px; z-index: 2; background: #f1ece2; box-shadow: none; }
.sheet-art { position: relative; height: 170px; margin: -20px -20px 14px; border-radius: 28px 28px 0 0; overflow: hidden; }
.sheet-art svg { position: absolute; right: 6%; bottom: -8px; height: 168px; width: auto; }
.sheet-art .face.hero { position: absolute; left: 18px; bottom: 6px; }
.ownercard { background: #faf7f1; border-radius: 16px; padding: 12px; margin: 10px 0 8px; }
.ownercard p { margin: 6px 0; font-size: .92rem; }
.fact { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: #faf7f1; margin: 6px 0; font-size: .92rem; }
.fact > span { flex: 1; }
.fact.event { background: #fff4d6; font-weight: 700; }
.fact.favour { background: #ffe9ec; font-weight: 700; }
.actions { display: grid; gap: 8px; margin-top: 8px; }
.friendrow { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.friendrow .hearts { font-size: .85rem; }
.note.missed, .fact.missed { background: #ffe4ef; }
.btn.wide, .linkish.wide { width: 100%; margin-top: 8px; }
.btn s { opacity: .6; font-weight: 500; }
.menu { display: grid; gap: 6px; margin: 8px 0; }
.mi { display: flex; align-items: center; gap: 8px; background: #faf7f1; border-radius: 14px; padding: 8px 10px; }
.mi > span:first-child { flex: 1; display: grid; }
.mi small { color: var(--muted); }
.subbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; max-width: 792px; margin: 0 auto; }
.subbar .grow { flex: 1; }
.chip { border: 0; background: rgba(255,255,255,.9); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: .88rem; box-shadow: var(--shadow); white-space: nowrap; }
.chip.gold { background: var(--c2); color: #2b2100; }
.chip.fire { background: #ffe1c7; }
.mi.learned { opacity: .6; }
.thread { background: #faf7f1; border-radius: 18px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.thead { display: flex; align-items: center; gap: 8px; }
.tmsg { max-width: 85%; padding: 8px 12px; border-radius: 16px; display: flex; gap: 6px; align-items: center; }
.tmsg.npc { background: #fff; justify-self: start; border-radius: 16px 16px 16px 4px; }
.tmsg.me { background: var(--c1); color: #fff; justify-self: end; border-radius: 16px 16px 4px 16px; }
.fix { font-size: .9rem; color: #15803d; }
.thead .pill { margin-left: auto; }
.synccode { font-family: var(--display); font-size: 1.6rem; text-align: center; background: #f1ece2; border-radius: 16px; padding: 14px; margin: 10px 0; letter-spacing: .02em; user-select: all; }
.player-head .linkish { display: block; padding: 2px 0; }
.pill.warn { background: #ffe8c2; }
.pill.ok { background: #dcfce7; }
.news { border-top: 1px solid var(--line); padding: 12px 0; }
.news h4 { font-family: var(--display); font-weight: 600; font-size: 1.05rem; margin: 0 0 4px; }
.news p { margin: 4px 0 8px; }
.q { display: grid; gap: 6px; margin-top: 10px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 12px; text-align: left; font-weight: 700; }
.opt.right { border-color: #16a34a; background: #dcfce7; opacity: 1; }
.opt.wrong { border-color: #dc2626; background: #fee2e2; opacity: 1; }
form.inline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
form.inline input { margin: 0 !important; flex: 1; padding: 10px 12px !important; }
form.inline input.price { flex: 0 0 90px; }
.actions .btn:not(.big) { padding: 13px; }
.ownedbox { background: color-mix(in srgb, var(--c2) 22%, #fff); border-radius: 14px; padding: 10px 12px; font-size: .92rem; text-align: center; }
.quest { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #faf7f1; margin: 8px 0; }
.quest > div { flex: 1; display: grid; gap: 2px; }
.quest small { color: var(--muted); }
.quest.done { opacity: .55; }

/* Overlays */
#busy { position: fixed; inset: 0; background: rgba(243, 239, 230, .88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; place-items: center; z-index: 30; padding: 16px; }
#busy.open { display: grid; }
.bbox { text-align: center; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
#busy .waitnote { padding: 6px 0 0; }
.spin { font-size: 4rem; animation: bob 1s ease-in-out infinite; }
#toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 200%); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 700; z-index: 40; transition: transform .25s, opacity .25s; max-width: calc(100vw - 32px); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.confetti { position: fixed; top: -40px; z-index: 50; pointer-events: none; animation: fall 1.8s ease-in forwards; }

@keyframes splash { 50% { transform: scaleY(.8); opacity: .7; } }
@keyframes wave { 50% { transform: skewY(-8deg); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,90,90,.6); } 70% { box-shadow: 0 0 0 14px rgba(255,90,90,0); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (max-width: 560px) {
  .hero h1 { font-size: 2.2rem; }
  .dock button { width: 58px; }
  .scene { height: 160px; }
  .scene-who .face.hero { width: 100px; height: 100px; }
  .bar { grid-template-columns: 100px 1fr 44px; }
  .result-top .face.hero { width: 90px; height: 90px; }
  #modal { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 28px 28px 0 0; max-width: none; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/* Message box: several lines */
.composer textarea { flex: 1; margin: 0 !important; font: inherit; font-size: 1.05rem; padding: 13px 18px; border-radius: 24px; border: 2px solid var(--line); background: #fffdf8; resize: none; max-height: 130px; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--c1); }
.composer { align-items: flex-end; }

/* Surprise card */
.surprise { text-align: center; }
.surprise .face.hero { margin: 0 auto -6px; }
.card3d { perspective: 800px; width: 220px; height: 150px; margin: 10px auto 6px; }
.card-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flip .9s .35s cubic-bezier(.3,1.4,.5,1) both; }
.card-back, .card-front { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; align-content: center; gap: 4px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); }
.card-back { background: linear-gradient(135deg, var(--c1), var(--c3)); font-size: 3.5rem; }
.card-front { background: #fff; transform: rotateY(180deg); border: 3px solid var(--c2); }
.card-front .aicon { font-size: 2.6rem; }
.card-front b { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.card-front small { color: var(--muted); }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

/* Games */
.scene.short { height: 150px; }
.game .gbody { flex: 1; overflow-y: auto; padding: 14px 14px 30px; }
.gcard { background: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.gq { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; line-height: 1.4; }
.gap { display: inline-block; min-width: 60px; border-bottom: 3px solid var(--c1); color: var(--c1); }
.gdots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.gdots i { width: 10px; height: 10px; border-radius: 50%; background: #d9d3c6; }
.gdots i.on { background: var(--c1); }
.gdots i.cur { background: var(--c2); transform: scale(1.3); }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 14px; }
.tiles span { width: 38px; height: 44px; display: grid; place-items: center; background: var(--c2); border-radius: 10px; font-family: var(--display); font-size: 1.3rem; font-weight: 600; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.gform { display: grid; gap: 8px; }
.gform textarea { font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); resize: vertical; }
.center-row { justify-content: center; margin: 8px 0 12px; }
.okbox { background: #dcfce7; }
.badbox { background: #ffedd5; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mgrid > div { display: grid; gap: 8px; align-content: start; }
.mbtn { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 8px; font-weight: 800; min-height: 52px; transition: transform .1s; }
.mbtn.sel { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, #fff); transform: scale(1.03); }
.mbtn.done { border-color: #16a34a; background: #dcfce7; opacity: .7; }
.mbtn.flash { animation: shake .35s; border-color: #dc2626; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.xwrap { overflow-x: auto; margin-bottom: 12px; }
.xgrid { display: grid; gap: 3px; margin: 0 auto; }
.xcell, .xblank { aspect-ratio: 1; min-width: 26px; }
.xcell { position: relative; background: #fff; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ink); }
.xcell i { position: absolute; top: 1px; left: 3px; font-size: .58rem; font-style: normal; font-weight: 800; color: var(--muted); }
.xcell input { width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font-family: var(--display); font-size: 1.15rem; font-weight: 600; text-transform: uppercase; padding: 0; border-radius: 6px; }
.xcell input:focus { outline: 3px solid var(--c2); }
.xcell.ok { background: #dcfce7; }
.xcell.bad { background: #fee2e2; }
.clues ol { margin: 4px 0 10px; padding-left: 4px; list-style: none; }
.clues li { margin: 4px 0; }
.goalline { margin: 10px 0 0; padding: 9px 12px; border-radius: 14px; background: #f1ece2; font-weight: 700; font-size: .9rem; text-align: left; }
.goalline.ok { background: #dcfce7; }

/* ---------- City map (board game style) ---------- */
.citymap { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; background: #4fc3f7; }
.citymap:active { cursor: grabbing; }
.citymap .bld { cursor: pointer; }
.citymap .lift { transition: transform .18s; }
.citymap .bld:hover .lift { transform: translateY(-4px); }
.citymap .bld.tired .bemoji { opacity: .55; }
.citymap .mark { animation: bob 1s ease-in-out infinite; transform-box: fill-box; }
.citymap .splash { animation: bob 2.4s ease-in-out infinite; transform-box: fill-box; }
.citymap .bird { animation: bob 3s ease-in-out infinite; transform-box: fill-box; }
.citymap .twinkle { animation: twinkle 2.5s ease-in-out infinite; }
.citymap .fog { cursor: pointer; }
.citymap .fog:hover { opacity: .92; }
@keyframes twinkle { 50% { opacity: .3; } }

/* ---------- The globe ---------- */
.worldpage { min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden; color: var(--ink); padding-bottom: 40px;
  background: linear-gradient(180deg, #8fd3ff 0, #c8ecff 45%, #eaf6e4 100%); }
.worldpage::before, .worldpage::after { content: ''; width: 120px; height: 56px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-30 -24 60 34'%3E%3Cpath d='M-22 6 Q-26 -4 -16 -6 Q-14 -16 -3 -14 Q4 -22 13 -14 Q24 -14 22 -2 Q28 6 18 8 Z' fill='white' stroke='%23c9d8e8' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; position: absolute; font-size: 64px; opacity: .85; pointer-events: none; animation: drift 60s linear infinite; }
.worldpage::before { top: 90px; left: -80px; }
.worldpage::after { top: 300px; left: -120px; font-size: 90px; animation-duration: 85s; animation-delay: -30s; }
@keyframes drift { to { transform: translateX(calc(100vw + 240px)); } }
.worldpage .hud { background: rgba(255, 255, 255, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.globe { position: relative; display: grid; place-items: center; width: 100%; height: min(72vh, 118vw); margin: 0 auto; }
.globesvg { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.globesvg:active { cursor: grabbing; }
.globesvg .country { cursor: pointer; transition: filter .15s; }
.globesvg .country.mine { stroke-width: 2.2; }
.globesvg .gbob { animation: bob 2.4s ease-in-out infinite; }
.globesvg .country:hover { filter: brightness(1.12); }
.globesvg .gpin { cursor: pointer; filter: drop-shadow(0 3px 3px rgba(35,38,58,.35)); }
.globesvg .gpin:hover .gbob { animation-duration: .8s; }
.gload { color: var(--muted); text-align: center; font-weight: 700; }
.gzoom { position: absolute; right: 16px; top: 90px; bottom: auto; }
.worldlist { position: relative; display: grid; gap: 10px; max-width: 560px; margin: 0 auto; padding: 0 16px; color: var(--ink); }
.worldbtn { margin-top: 10px; }
.worldbtn small { opacity: .8; font-weight: 700; margin-left: 6px; }
.bigflag { font-size: 3.4rem; line-height: 1; margin: 6px 0; }

/* ---------- Vocabulary lesson ---------- */
.gcard.lesson { text-align: center; }
.lword { font-family: var(--display); font-size: 2rem; font-weight: 600; margin: 8px 0 10px; color: var(--c1); }
.lit { font-size: 1.15rem; font-weight: 800; margin: 12px 0 6px; }
.lex { background: #f6f3ec; border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; text-align: left; }
.menucard { background: rgba(255,255,255,.95); color: var(--ink); border-radius: 16px; padding: 8px 12px; margin: 8px 12px 0; box-shadow: var(--shadow); max-height: 38vh; overflow: auto; }
.menucard summary { cursor: pointer; font-weight: 800; }
.menucard .menu { margin-top: 6px; }
.note.broken { background: #fff0e0; }
.issuebox { background: #fff0e0; border: 2px solid #f4a261; border-radius: 16px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; }
.issuebox .row { display: flex; flex-wrap: wrap; gap: 8px; }
.issuebox .btn { flex: 1 1 180px; }
.maptip { position: fixed; z-index: 30; pointer-events: none; background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  max-width: 260px; font-size: .88rem; line-height: 1.35; display: grid; gap: 2px; }
.maptip b { font-size: 1rem; }
.maptip .tl { color: var(--muted); }
.maptip .tp { font-weight: 800; }
.maptip .tp.can { color: #0a8f45; }
.maptip .tp.cant { color: #c2410c; }
.wallet-note { position: relative; text-align: center; margin: 8px auto 0; font-size: .85rem; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.7); width: fit-content; padding: 4px 12px; border-radius: 999px; }

/* ---------- Computer and big tablets ---------- */
@media (min-width: 1000px) {
  /* City: the map on the left, everything else in a side column. */
  .citypage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto auto auto auto minmax(0, 1fr); }
  .citypage > .hud { grid-column: 1 / -1; }
  .citypage > .mapwrap { grid-column: 1; grid-row: 2 / -1; min-height: 0; }
  .citypage > :not(.hud):not(.mapwrap) { grid-column: 2; }
  .citypage .subbar { max-width: none; margin: 0; padding: 14px 16px 0; flex-wrap: wrap; }
  .citypage .dock { position: static; transform: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 16px 0; padding: 10px; border-radius: 22px; }
  .citypage .dock button { width: auto; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; padding: 10px 12px; font-size: 1.3rem; }
  .citypage .dock button span { font-size: .9rem; color: var(--ink); }
  .citypage .notes { flex-direction: column; overflow: auto; padding: 14px 16px 16px; align-self: start; max-height: 100%; }
  .citypage .notes .note { max-width: none; white-space: normal; border-radius: 16px; }
  .citypage > .note { width: auto; margin: 14px 16px 0; }
  .mapwrap .zoom { bottom: 18px; }
  /* World: the globe big on the left, your cities on the right. */
  .worldpage { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto auto minmax(0, 1fr); height: 100vh; height: 100dvh; padding-bottom: 0; }
  .worldpage > .hud { grid-column: 1 / -1; }
  .worldpage > .globe { grid-column: 1; grid-row: 2 / -1; width: 100%; height: 100%; align-self: stretch; }
  .worldpage > .wallet-note { grid-column: 2; margin-top: 18px; }
  .worldpage > .worldlist { grid-column: 2; align-self: start; width: 100%; padding: 16px 24px 24px 0; max-height: 100%; overflow: auto; }
  .worldpage > .gzoom { right: 440px; top: auto; bottom: 24px; }
  /* Chat and games: a wider, roomier column. */
  .chat { max-width: 860px; box-shadow: 0 0 0 1px var(--line); }
  .scene { height: 210px; }
  .scene-bld svg { height: 196px; }
}
.units { display: grid; gap: 8px; margin: 12px 0; }
.unit { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 18px; padding: 10px 14px; font: inherit; color: var(--ink); cursor: pointer; }
.unit span { display: grid; }
.unit small { color: var(--muted); }
.unit .uicon { font-size: 1.6rem; }
.unit.cur { border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 18%, transparent); }
.unit.ok { background: #effaf1; border-color: #b7e4c0; }
.unit.lock { opacity: .55; cursor: default; }
.note.basics { background: #e8f0ff; font-weight: 700; }
.note.gift { background: #fff4d6; }
.ltr { margin: -4px 0 8px; color: var(--muted); font-weight: 800; }
.lvl.test { border-style: dashed; }

/* ---------- 3D city ---------- */
.slot3d { position: absolute; inset: 0; display: grid; place-items: center; background: #9fd8ff; }
.slot3d canvas.city3d { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.slot3d canvas.city3d:active { cursor: grabbing; }
.slot3d svg.citymap { position: absolute; inset: 0; }
.joy { display: none; position: absolute; left: 18px; bottom: 110px; width: 112px; height: 112px; border-radius: 50%; z-index: 5;
  background: rgba(255,255,255,.45); border: 3px solid rgba(35,38,58,.25); touch-action: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: #fff; border: 3px solid #23263a; box-shadow: var(--shadow); }
.keyhint { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; z-index: 4; margin: 0; background: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 14px; font-size: .82rem; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
@media (pointer: coarse) { .joy { display: block; } .keyhint { display: none; } }
@media (min-width: 1000px) { .joy { bottom: 24px; } }
.camtoggle { position: absolute; right: 12px; top: 10px; z-index: 5; box-shadow: var(--shadow); }
.emogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin-top: 12px; }
.emogrid button { font-size: 2rem; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 6px 0; cursor: pointer; }
.emogrid button.sel { border-color: var(--c1); background: #eef0ff; }
.syncrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.synccode.small { font-size: 1rem; padding: 6px 12px; margin: 0; }
button.plain { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
button.plain h3:hover { text-decoration: underline; }
.seg.views { display: inline-flex; background: rgba(255,255,255,.85); border-radius: 999px; padding: 3px; gap: 2px; box-shadow: var(--shadow); }
.seg.views button { border: 0; background: none; border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .85rem; font-weight: 800; color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg.views button.on { background: var(--c1); color: #fff; }
.note.paused { background: #e7f6ec; font-weight: 700; }
.pausebox { background: #e7f6ec; border: 2px solid #8fd19e; border-radius: 16px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.pausebox .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 8px 12px; background: #fff3f3; border: 2px solid #ffc9c9; border-radius: 16px; font-size: .9rem; }
.recbar b { margin-right: auto; }
.recbar span:not(.recdot) { margin-right: auto; color: var(--muted); }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.cityrow { display: flex; gap: 8px; align-items: stretch; }
.cityrow .citycard { flex: 1; min-width: 0; }
.cityrow .delcity { align-self: center; background: rgba(255,255,255,.8); }
.lglyph { font-size: 5rem; line-height: 1.1; margin: 4px 0; font-weight: 600; color: var(--c1); }
.lglyph.small { font-size: 2.6rem; }
.gq.big { font-size: 3.4rem; text-align: center; }
.gcard.info h4 { font-family: var(--display); font-size: 1.25rem; margin: 4px 0 8px; }
.gcard.info p { text-align: left; }
.glyphrow { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.trace { position: relative; width: 170px; height: 170px; border: 3px dashed var(--line); border-radius: 18px; background: #fffdf8; touch-action: none; }
.trace span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; color: rgba(35,38,58,.13); pointer-events: none; line-height: 1; }
.trace canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.trace .ibtn { position: absolute; right: 4px; top: 4px; }
.trace small { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; color: var(--muted); font-size: .75rem; }
.hint { background: #fff8e1; border-radius: 12px; padding: 8px 10px; text-align: left; }
.citybox { display: grid; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.citybox small { display: block; font-weight: 600; opacity: .7; font-size: .78rem; }
.btn.danger { background: #fde8e8; color: #b42318; box-shadow: none; }
.btn.wide { width: 100%; }
@media (max-width: 560px) {
  .worldpage .hud-title small, .worldpage .codelbl { display: none; }
  .worldpage .hud-title h2 { font-size: 1rem; }
}
.hud-title > div { min-width: 0; overflow: hidden; }
.hud-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud > .chip, .hud > .purse, .hud > .ibtn { flex: none; }
.mapviews { position: absolute; left: 12px; top: 10px; z-index: 5; }
.citymap .you { animation: blink 2s ease-in-out infinite; }
.citymap .lift { transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.citymap .bld:hover .lift { transform: scale(1.06); }
@media (max-width: 700px) { .keyhint { display: none; } }
.mission.target { background: #fff7e0; }
.mission.target small { opacity: .7; margin-left: 6px; }
.who-card .tgt { display: block; color: #b77900; font-weight: 800; }
.targetres { font-weight: 700; }
.targetres.hit { background: #fff7e0; border: 2px solid #f5c84c; }
.chest .card-back { color: #fff; font-size: 4rem; }
.chest .card-front { border: 4px solid; }
.loot { display: grid; gap: 4px; margin-top: 8px; font-weight: 800; }
.chest.legendary .card3d { filter: drop-shadow(0 0 18px rgba(245,179,1,.7)); }
.chest.epic .card3d { filter: drop-shadow(0 0 14px rgba(155,93,229,.6)); }
.chip.gems { background: #eef6ff; font-weight: 800; }
.gemrow { background: #eef6ff; border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.gemrow b { font-size: 1.3rem; }
.unit .btn { margin-left: auto; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.shopitem { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border: 2px solid var(--line); background: #fff; border-radius: 16px; font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.shopitem .aicon { font-size: 1.8rem; }
.shopitem.off { opacity: .6; cursor: default; }
.shopitem em { position: absolute; top: -8px; right: 8px; background: var(--c2); font-style: normal; font-size: .7rem; font-weight: 900; padding: 1px 8px; border-radius: 99px; }
.shopitem small { color: var(--muted); font-size: .7rem; }
.chest .card3d { width: 250px; height: 260px; }
.chest .card-front .aicon { font-size: 2.2rem; }

/* ---------- Minimal city layout ---------- */
.citypage .hud { gap: 8px; padding: 10px 14px; background: rgba(255,255,255,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(35,38,58,.06); }
.sky-night .citypage .hud, .citypage.sky-night .hud { background: rgba(20,26,61,.6); }
.citypage .hud .ibtn { width: 38px; height: 38px; border-radius: 12px; background: transparent; box-shadow: none; font-size: 1.2rem; }
.citypage .hud .ibtn:hover { background: rgba(35,38,58,.06); }
.hud-title.plain { flex: 1; min-width: 0; display: flex; align-items: center; }
.hud-title.plain h2 { font-size: 1.1rem; line-height: 1.2; }
.hud-title.plain small { font-size: .78rem; opacity: .7; font-weight: 700; }
.hud .caret { font-size: .7em; opacity: .5; }
.citypage .hud .chip.gems { background: rgba(58,134,255,.1); box-shadow: none; padding: 6px 10px; }
.citypage .hud .purse .coins { box-shadow: none; }
.citypage .subbar { display: none; }

/* Map controls: views top-left, round buttons on the right, collect pill on top. */
.mapviews { position: absolute; left: 12px; top: 12px; z-index: 5; }
.seg.views { background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(35,38,58,.12); padding: 3px; }
.seg.views button { padding: 6px 12px; min-width: 40px; }
.mapctl { position: absolute; right: 12px; top: 12px; z-index: 5; display: grid; gap: 6px; }
.mapctl button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(35,38,58,.12); font-size: 1.15rem; font-weight: 800; color: var(--ink); cursor: pointer; }
.mapctl button:hover { background: #fff; }
.mapwrap .zoom, .mapwrap > .camtoggle { display: none; }
.collectpill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--c2); color: #2b2100; font: inherit; font-weight: 800; box-shadow: 0 4px 14px rgba(35,38,58,.18); cursor: pointer; animation: up .3s; }
.keyhint { top: auto; bottom: 96px; animation: hintfade 7s forwards; }
@keyframes hintfade { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* Notes: at most two, slim. */
.notes { padding: 8px 14px 0; gap: 6px; }
.notes .note { font-size: .82rem; padding: 6px 12px; box-shadow: 0 1px 4px rgba(35,38,58,.08); }
.note.more { background: #fff; font-weight: 800; }

/* Bottom menu: light, icons with small labels. */
.dock { padding: 6px 8px; gap: 2px; border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 6px 24px rgba(35,38,58,.14); }
.dock button { width: 60px; font-size: 1.25rem; padding: 6px 0 4px; }
.dock button span { font-size: .64rem; font-weight: 700; color: var(--muted); }
.dock button.dim { opacity: .45; }

/* City menu list */
.menulist { display: grid; gap: 6px; margin: 12px 0 4px; }
.menulist button { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; border: 0; background: #f6f3ec; border-radius: 14px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.menulist button span { grid-row: 1 / 3; font-size: 1.5rem; text-align: center; }
.menulist button small { color: var(--muted); font-size: .8rem; }
.menulist button:disabled { opacity: .55; cursor: default; }
.menulist button:hover:not(:disabled) { background: #efeadf; }

@media (min-width: 1000px) {
  .citypage { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .citypage .dock { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 14px 16px 0; padding: 8px; background: rgba(255,255,255,.9); box-shadow: 0 2px 12px rgba(35,38,58,.08); }
  .citypage .dock button { grid-auto-flow: column; justify-content: start; gap: 12px; padding: 10px 12px; border-radius: 12px; width: 100%; font-size: 1.2rem; }
  .citypage .dock button span { font-size: .95rem; color: var(--ink); font-weight: 700; }
  .citypage .dock em { position: static; margin-left: auto; }
  .keyhint { bottom: 24px; }
}
.keyhint { top: 60px; bottom: auto; }
@media (min-width: 1000px) { .keyhint { top: 60px; bottom: auto; } }

/* ---------- Everything in the top bar ---------- */
.hudnav { display: flex; gap: 2px; }
.hudnav button { position: relative; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 12px; padding: 7px 10px; font: inherit; font-size: 1.05rem; color: inherit; cursor: pointer; }
.hudnav button span { font-size: .82rem; font-weight: 700; }
.hudnav button:hover { background: rgba(35,38,58,.06); }
.hudnav button.dim { opacity: .45; }
.hudnav em, .hudmenu em { position: absolute; top: 2px; right: 2px; min-width: 9px; height: 9px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font-style: normal; font-size: .62rem; font-weight: 900; line-height: 9px; }
.hudnav em:not(:empty) { height: 15px; line-height: 15px; top: -2px; right: -2px; }
.hudmenu { position: relative; display: none !important; }
.mbadge { background: #ef4444; color: #fff; font-style: normal; font-size: .72rem; border-radius: 99px; padding: 0 7px; margin-left: 6px; }
.menulist button.dim { opacity: .5; }
@media (max-width: 1180px) { .hudnav button span { display: none; } }
@media (max-width: 760px) { .hudnav, .hudset { display: none !important; } .hudmenu { display: grid !important; } }
/* No side column any more: the map takes the whole screen. */
@media (min-width: 1000px) {
  .citypage { display: flex; flex-direction: column; }
  .citypage > .notes { flex-direction: row; overflow-x: auto; padding: 8px 14px 0; max-height: none; align-self: auto; }
  .citypage > .notes .note { white-space: nowrap; }
  .citypage > .mapwrap { flex: 1; min-height: 0; }
}
.joy { bottom: 24px; }
.mapctl .camtoggle { position: static; box-shadow: 0 2px 10px rgba(35,38,58,.12); }
.keyhint, .citypage .keyhint { top: auto !important; bottom: 80px !important; }
@media (max-width: 760px) { .collectpill { top: 60px; } }
.tracebox { display: grid; justify-items: center; gap: 6px; }
.trace canvas.traceguide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trace { width: 190px; height: 190px; }
.traceres { margin: 0; font-size: .82rem; font-weight: 700; color: var(--muted); text-align: center; }
.traceres.ok { color: #0a8f45; }
.traceres.bad { color: #c2410c; }

/* ---------- The chest you open ---------- */
.chestsheet { text-align: center; overflow: hidden; }
.chestlabel { font-family: var(--display); font-size: 1.3rem; font-weight: 600; margin: 4px 0 0; }
.chestsheet.open .chestlabel { color: var(--rc); animation: pop .4s; }
.chestwrap { position: relative; height: 290px; display: grid; place-items: center; cursor: pointer; }
.chestsheet.open .chestwrap { cursor: default; }
.rays { position: absolute; width: 360px; height: 360px; left: 50%; top: 46%; margin: -180px 0 0 -180px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 55%, transparent) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); }
.chestsheet:not(.open) .rays { opacity: .35; animation: spin 14s linear infinite; }
.chestsheet.open .rays { opacity: 1; animation: spin 7s linear infinite, raysin .5s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes raysin { from { transform: scale(.2); opacity: 0; } }
.chest3 { position: relative; width: 150px; height: 120px; margin-top: 30px; filter: drop-shadow(0 10px 14px rgba(35,38,58,.3)); }
.chestsheet:not(.open) .chest3 { animation: wobble 1.6s ease-in-out infinite; }
.chestsheet.shake .chest3 { animation: shake .6s linear; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) translateY(-4px); } 40% { transform: rotate(4deg) translateY(-2px); } 60% { transform: rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 50%, 90% { transform: translate(-7px, -3px) rotate(-5deg); } 30%, 70% { transform: translate(7px, -3px) rotate(5deg); } }
.chest3 .base { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 85%, #fff), color-mix(in srgb, var(--rc) 75%, #000)); border: 4px solid #23263a; }
.chest3 .lid { position: absolute; left: -4px; right: -4px; top: 6px; height: 52px; border-radius: 40px 40px 8px 8px; transform-origin: 50% 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 70%, #fff), var(--rc)); border: 4px solid #23263a; transition: transform .45s cubic-bezier(.3,1.6,.5,1); z-index: 2; }
.chestsheet.open .chest3 .lid { transform: translateY(-34px) rotate(-24deg) translateX(-26px); }
.chest3 .band { position: absolute; left: 50%; width: 22px; margin-left: -11px; top: 0; bottom: 0; background: #f5c84c; border-left: 3px solid #23263a; border-right: 3px solid #23263a; }
.chest3 .lock { position: absolute; left: 50%; bottom: -16px; width: 26px; height: 28px; margin-left: -13px; border-radius: 6px; background: #ffd166; border: 3px solid #23263a; z-index: 3; }
.chestsheet.open .chest3 .lock { display: none; }
.chestsheet.open .chest3 .base::after { content: ''; position: absolute; left: 10px; right: 10px; top: -10px; height: 18px; border-radius: 50%; background: radial-gradient(#fff8d6, color-mix(in srgb, var(--rc) 40%, #fff) 60%, transparent 70%); animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: .55; } }
.taphint { position: absolute; bottom: 2px; margin: 0; font-weight: 800; color: var(--muted); animation: bob 1.2s ease-in-out infinite; }
.spark { position: absolute; left: 50%; top: 52%; font-style: normal; font-size: 1.1rem; opacity: 0; animation: spark .9s var(--d) ease-out forwards; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) scale(1.2); } }
.loot2 { position: absolute; top: 4px; left: 0; right: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: none; }
.loot2 > span { background: #fff; border: 3px solid var(--rc); border-radius: 999px; padding: 6px 12px; font-weight: 800; box-shadow: 0 6px 16px rgba(35,38,58,.18);
  opacity: 0; animation: lootout .55s calc(.35s + var(--i) * .28s) cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes lootout { from { opacity: 0; transform: translateY(150px) scale(.3); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.6); } }
.chestsheet.legendary .chest3 { filter: drop-shadow(0 0 22px rgba(245,179,1,.8)) drop-shadow(0 10px 14px rgba(35,38,58,.3)); }
.goalbar { display: grid; gap: 4px; margin: 10px 0; }
.goalbar small { color: var(--muted); font-weight: 700; }
.menuedit { display: grid; gap: 6px; margin: 8px 0; }
.menuedit .mi { display: flex; align-items: center; gap: 8px; background: #f6f3ec; border-radius: 12px; padding: 8px 10px; }
.menuedit .mi > span:first-child { flex: 1; display: grid; }
.menuedit .mi small { color: var(--muted); }
.menuedit .mi.empty { border: 2px dashed var(--line); background: transparent; justify-content: center; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; }
.menuedit .mi.empty:hover { color: var(--c1); border-color: var(--c1); }
.lvlnow { display: flex; align-items: center; gap: 12px; background: #f6f3ec; border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.lvlnow b { font-family: var(--display); font-size: 1.8rem; color: var(--c1); }
.lvlnow span { display: grid; }
.ladder { display: flex; gap: 4px; margin: 4px 0 8px; }
.ladder span { flex: 1; text-align: center; font-weight: 800; font-size: .8rem; padding: 4px 0; border-radius: 8px; background: #f1ece2; color: var(--muted); }
.ladder span.done { background: color-mix(in srgb, var(--c1) 25%, #fff); color: var(--ink); }
.ladder span.cur { background: var(--c1); color: #fff; }
.citybox .btn { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pwords { background: #f6f3ec; border-radius: 16px; padding: 8px 12px; margin: 10px 0; }
.pwords summary { cursor: pointer; font-weight: 800; }
.pwords .warn { color: #c2410c; font-weight: 700; }
.pwlist { display: grid; gap: 6px; margin-top: 8px; max-height: 300px; overflow: auto; }
.pw { background: #fff; border-radius: 12px; padding: 8px 10px; }
.pwtop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pwtop small { color: var(--muted); }
.pwex { margin-top: 4px; font-size: .9rem; display: grid; gap: 2px; }
.pwex small { color: var(--muted); }
.opt.sel { border-color: var(--c1) !important; background: color-mix(in srgb, var(--c1) 12%, #fff) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 25%, transparent); }
.lookprev { display: grid; place-items: center; margin: 4px 0 10px; }
.lookrow { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.lookrow > span { font-weight: 700; font-size: .85rem; color: var(--muted); }
.lookrow > div { display: flex; flex-wrap: wrap; gap: 6px; }
.lookopt { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.lookopt.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.lookopt.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); }
.lookopt.sw.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }

/* ---------- Professional polish ---------- */
body { letter-spacing: -.005em; }
h1, h2, h3, .chestlabel { font-weight: 700; letter-spacing: -.02em; }
.ic { display: block; flex: none; }
.ibtn .ic, .mapctl .ic, .hudnav .ic { margin: auto; }
.citypage .hud .ibtn { color: var(--ink); }
.hudnav button { color: #3b3f52; }
.hudnav button .ic { width: 19px; height: 19px; }
.mapctl button { display: grid; place-items: center; color: #2b2f40; }
.seg.views button .ic { margin: 0 auto; }
/* Menu lists: icon in a soft square, label, chevron */
.menulist button { grid-template-columns: 40px 1fr 18px; background: #fff; border: 1px solid #ece7dc; padding: 10px 12px; }
.menulist button:hover:not(:disabled) { background: #faf8f3; }
.menulist button .mic { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c1) 10%, #fff); color: var(--c1); font-size: 1.2rem; }
.menulist button b { font-weight: 600; }
.menulist button .chev { grid-row: 1 / 3; grid-column: 3; color: #b3ad9f; display: grid; place-items: center; }
.sheet h3 { font-size: 1.15rem; }
.sheet { border-radius: 22px; }
.note.hap { background: #eef4ff; }
.chestitem { border-color: color-mix(in srgb, var(--rc) 45%, #fff); }
.minichest { width: 44px; height: 34px; border-radius: 10px 10px 6px 6px; border: 3px solid #23263a; background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 70%, #fff) 0 45%, var(--rc) 45%); position: relative; }
.minichest::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 8px; margin-left: -4px; background: #f5c84c; border-left: 2px solid #23263a; border-right: 2px solid #23263a; }

/* Account */
.accbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin: 14px 0; }
.accbox > span { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.accbox small { color: var(--muted); font-size: .8rem; }
.accbox b { overflow-wrap: anywhere; }
.accbox.in { border: 1px solid var(--line); box-shadow: none; }
.authform { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.authform label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.authform .btn { margin-top: 4px; }
.authform label.consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .88rem; line-height: 1.4; }
.authform label.consent input { margin-top: 2px; width: 18px; height: 18px; flex: none; }
.dangertext { color: #b42318; }
.legalnote { text-align: center; font-size: .8rem; color: var(--muted); margin: 6px 0 24px; }
.legalnote a { color: inherit; }
.note.sleep { background: #232849; color: #fff; }
button.purse.plain { background: var(--c2); color: #2b2100; border: 0; cursor: pointer; font: inherit; font-size: 1.05rem; }
.xrate { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 0; }

/* ---------- Round 43: layout fixes ---------- */
.menulist button b, .menulist button small { grid-column: 2; min-width: 0; }
.menulist button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-title.plain small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .purse { white-space: nowrap; flex: none; padding: 7px 12px; }
.hud .purse .coins { gap: 4px; }
.clock { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 4px; }
.clock b { font-family: var(--display); font-size: .95rem; font-variant-numeric: tabular-nums; }
.clock small { font-size: .7rem; font-weight: 700; opacity: .65; }
@media (max-width: 560px) {
  .citypage .hud { gap: 6px; padding: 8px 10px; }
  .citypage .hud .chip.gems { display: none; }
  .clock small { display: none; }
  .hud .purse { font-size: .92rem !important; padding: 6px 10px; }
  .hud-title.plain h2 { font-size: 1rem; }
  .wallet-note { margin-right: 64px !important; margin-left: 12px !important; text-align: left; }
}
.gzoom { z-index: 3; }

/* Missions */
.msec { margin: 16px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mcard { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.mcard .mtop { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.mcard .mtop b { font-weight: 600; }
.mcard .prog { display: block; height: 6px; border-radius: 9px; background: #efe9dd; overflow: hidden; margin: 8px 0 2px; }
.mcard .prog i { display: block; height: 100%; background: var(--c3); border-radius: 9px; }
.mbtns { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.mbtns .btn:only-child { margin-left: auto; }
.mhow { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #f6f3ec; font-size: .88rem; }

/* Words */
.wstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.wstats div { background: #f6f3ec; border-radius: 12px; padding: 10px; text-align: center; }
.wstats b { display: block; font-family: var(--display); font-size: 1.5rem; }
.wstats small { color: var(--muted); font-weight: 600; }

/* Newspaper: a full page */
#modal .sheet.paper { width: min(980px, 100%); max-width: none; max-height: 94vh; background: #fbf8f1; }
@media (max-width: 760px) { #modal .sheet.paper { height: 100%; max-height: none; border-radius: 0; } }
.masthead { text-align: center; border-bottom: 3px double #23263a; padding: 4px 0 8px; margin: 0 36px 10px; }
.masthead h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; letter-spacing: -.01em; }
.mastline { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 1px solid #23263a; margin-top: 6px; padding-top: 4px; }
.papercols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.paper .news { border: 0; border-top: 1px solid #d9d1c0; border-radius: 0; background: transparent; padding: 12px 0; margin: 0; box-shadow: none; }
.paper .news h4 { font-family: Georgia, 'Times New Roman', serif; font-size: 1.25rem; line-height: 1.25; }
.paper .news p { font-family: Georgia, 'Times New Roman', serif; font-size: 1.02rem; line-height: 1.55; }
.pzpage { border-top: 3px double #23263a; margin-top: 14px; padding-top: 6px; }
.pzhead { font-family: Georgia, serif; text-align: center; }
.pzgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.pz { background: #fff; border: 1px solid #e3dccd; border-radius: 14px; padding: 12px 14px; }
.pz.off { opacity: .7; }
.pz h4 { margin: 0 0 2px; }
.pzslots { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pzslots span { width: 36px; height: 42px; border-bottom: 3px solid #23263a; display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; }
.pzkeys { display: flex; flex-wrap: wrap; gap: 6px; }
.pzkeys button { min-width: 40px; height: 44px; border-radius: 10px; border: 1px solid #ddd5c5; background: #f6f3ec; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.pzkeys button:disabled { opacity: .25; }
.pzkeys .undo { margin-left: auto; }
.pzmatch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pzmatch > div { display: grid; gap: 6px; align-content: start; }
.pzmatch button { padding: 9px 10px; border-radius: 10px; border: 1px solid #ddd5c5; background: #fff; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.pzmatch button.sel { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, #fff); }
.pzmatch button.ok { background: #e7f6ee; border-color: #b7e2c8; color: #1d6b43; }
.pzok { color: #1d6b43; font-weight: 700; margin: 8px 0 0; }

/* ---------- Chest (SVG) ---------- */
.chestsvg { display: block; overflow: visible; }
.chestsvg.big { width: 190px; height: auto; margin-top: 26px; position: relative; z-index: 2; }
.chestsvg.mini { width: 54px; height: auto; margin: 0 auto 4px; }
.chestsvg .clid { transform-box: fill-box; transform-origin: 8% 100%; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.chestsvg .cglow { opacity: 0; transition: opacity .3s .15s; }
.chestsheet:not(.open) .chestsvg.big { animation: wobble 1.6s ease-in-out infinite; transform-origin: 50% 95%; }
.chestsheet:not(.open) .chestsvg.big .clid { animation: lidpeek 1.6s ease-in-out infinite; }
.chestsheet.shake .chestsvg.big { animation: shake .6s linear; }
.chestsheet.open .chestsvg.big .clid { transform: translate(-2px, -16px) rotate(-16deg); }
.chestsheet.open .chestsvg.big .clock { opacity: 0; }
.chestsheet.open .chestsvg.big .cglow { opacity: 1; }
.chestsheet.legendary .chestsvg.big { filter: drop-shadow(0 0 22px rgba(245,179,1,.75)); }
.chestsheet.epic .chestsvg.big { filter: drop-shadow(0 0 16px rgba(155,93,229,.6)); }
@keyframes lidpeek { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-5px) rotate(-3deg); } 90% { transform: none; } }

/* Faces: a coloured disc with the game's dark outline */
.face.sm, .face.big, .face.mini, .face.hero { border-radius: 50%; border: 2.5px solid #23263a; box-sizing: border-box; background: #fff; }
.face.hero { border-width: 3.5px; }
.note.hot { background: #fff1e6; color: #8a3b12; font-weight: 700; }
.xcalc { background: #faf7f0; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.xrow { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: .95rem; }
.xrow.minus b { color: #b42318; }
.xrow.total { border-top: 1px dashed #d8cfbd; margin-top: 4px; padding-top: 8px; font-size: 1.08rem; }
.xrow.total b { color: #1d6b43; }
.xrow.after { font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.xwarn { color: #b42318; font-weight: 700; margin: 6px 0 0; font-size: .88rem; }
.xquick { gap: 6px; }

/* Culture */
.nearcult { position: absolute; left: 50%; transform: translateX(-50%); bottom: 156px; z-index: 5; background: #23263a; color: #fff; box-shadow: var(--shadow); animation: up .2s; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1000px) { .nearcult { bottom: 76px; } }
.culturesheet { text-align: center; }
.cultbig { font-size: 3.4rem; line-height: 1; margin: 6px 0 4px; }
.culturesheet p { text-align: left; }
.cultword { display: flex; align-items: center; gap: 8px; justify-content: center; background: #f6f3ec; border-radius: 12px; padding: 10px; margin: 10px 0; }
.cultword span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cultword small { color: var(--muted); }
.note.cult { background: #23263a; color: #fff; font-weight: 700; }
.note.holiday { background: #ffe9a8; color: #6b4e00; font-weight: 800; }
.kn { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-right: 8px; border-radius: 6px; border: 1px solid #d8cfbd; font: 600 .72rem var(--font); color: var(--muted); vertical-align: 2px; }
@media (pointer: coarse) { .kn { display: none; } }
.saycard { position: absolute; left: 50%; transform: translateX(-50%); top: 64px; z-index: 6; width: min(420px, calc(100% - 32px)); background: #fff; border: 2.5px solid #23263a; border-radius: 18px; padding: 12px 44px 12px 16px; box-shadow: var(--shadow); animation: up .2s; }
.saycard b { display: block; font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.saycard small { display: block; color: var(--muted); margin: 2px 0 8px; }
.saycard .x { position: absolute; top: 8px; right: 8px; }
.saycard .row { gap: 6px; }
.nearexp { position: absolute; left: 50%; transform: translateX(-50%); bottom: 208px; z-index: 5; box-shadow: var(--shadow); animation: up .2s; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1000px) { .nearexp { bottom: 128px; } }
.todaybtn { position: relative; z-index: 4; align-self: flex-start; margin: 8px 14px 0; border: 0; background: rgba(255,255,255,.92); color: var(--ink); font: inherit; font-weight: 700; font-size: .85rem; padding: 7px 12px; border-radius: 999px; box-shadow: 0 1px 4px rgba(35,38,58,.12); cursor: pointer; width: fit-content; }
.todaybtn em { font-style: normal; background: #ef4444; color: #fff; border-radius: 99px; padding: 0 6px; margin-left: 4px; font-size: .75rem; }
.todaylist { display: grid; gap: 8px; margin-top: 10px; }
.todaylist .note { width: 100%; margin: 0; white-space: normal; border-radius: 14px; padding: 10px 12px; box-shadow: none; border: 1px solid var(--line); }
.citypage { position: relative; }
.citypage > .todaybtn { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 7; white-space: nowrap; max-width: calc(100% - 200px); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .citypage > .todaybtn { top: 60px; max-width: calc(100% - 150px); } }
.flagimg { display: inline-block; width: 1.25em; height: .9em; object-fit: cover; border-radius: 3px; vertical-align: -.08em; box-shadow: 0 0 0 1px rgba(35,38,58,.25); }
.flagimg.big { width: 34px; height: 24px; }
.flagimg.huge { width: 84px; height: 58px; border-radius: 8px; }
.citypage.sky-night .hud, .citypage.sky-night .hud .ibtn, .citypage.sky-night .hudnav button, .citypage.sky-night .hud-title { color: #f3f4ff; }
.citypage.sky-night .hud .chip.gems { background: rgba(255,255,255,.14); color: #fff; }
.toggles { display: grid; gap: 6px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 1px solid #ece7dc; background: #fff; border-radius: 14px; padding: 12px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.toggle i { flex: none; width: 42px; height: 24px; border-radius: 99px; background: #d8d3c7; position: relative; transition: background .2s; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle.on i { background: #16a34a; }
.toggle.on i::after { transform: translateX(18px); }
.vol { display: flex; align-items: center; gap: 12px; padding: 4px 14px 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.vol input { flex: 1; min-width: 0; margin: 0; padding: 0; accent-color: var(--c1); }
.toggle small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.evfacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.evfacts div { background: #f6f3ec; border-radius: 12px; padding: 10px 12px; }
.evfacts small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.todaylist button.note { cursor: pointer; text-align: left; font: inherit; }
.pzclue { font-family: Georgia, serif; font-size: 1.3rem; font-weight: 700; margin: 2px 0 6px; }
.pzhint { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }
.pzhint small { color: var(--muted); font-weight: 500; }
.howwords { background: #f6f3ec; border-radius: 14px; padding: 10px 14px; margin: 10px 0; font-size: .88rem; }
.howwords p { margin: 4px 0; }
.mi .pill small { font-size: .65rem; color: #1d6b43; }
/* Messages: one floating button, bottom right, for all your cities */
.msgfab { position: fixed; right: 16px; bottom: 24px; z-index: 9; width: 58px; height: 58px; border-radius: 50%; border: 2.5px solid #23263a; background: #fff; color: #23263a; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(35,38,58,.25); cursor: pointer; }
.msgfab em { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ef4444; color: #fff; font: 700 .75rem/22px var(--font); font-style: normal; text-align: center; }
@media (max-width: 760px) { .msgfab { bottom: 96px; width: 52px; height: 52px; } }
.msgtabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 6px; padding-bottom: 4px; scrollbar-width: none; }
.msgtabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.msgtabs button.on { background: #23263a; color: #fff; border-color: #23263a; }
.msgtabs em { font-style: normal; background: #ef4444; color: #fff; border-radius: 99px; padding: 0 6px; font-size: .72rem; }
.mission + .mission { margin-top: 8px; }
.goalwords { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; align-items: stretch; }
.goalwords > small { flex: none; align-self: center; font-weight: 700; color: var(--muted); font-size: .72rem; max-width: 70px; line-height: 1.2; }
.goalwords button { flex: none; display: grid; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 6px 10px; font: inherit; cursor: pointer; }
.goalwords button b { font-size: .92rem; }
.goalwords button small { color: var(--muted); font-size: .72rem; }
.settings .setcard h3 { margin-bottom: 10px; }
.settings .setcard .row { margin-top: 10px; }
/* Crossword: clean squares, the current word highlighted */
.xgrid .xcell input { border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 6px !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; height: 100% !important; width: 100% !important; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--ink); caret-color: transparent; }
.xgrid .xcell input:focus { outline: 3px solid var(--c2); outline-offset: -3px; background: #fff7d6 !important; }
.xcell.on { background: #fff3c4; }
.clues li.on { background: #fff3c4; border-radius: 6px; }
.xgrid { gap: 2px; }

/* Corrections in the phone: under your own message, easy to read. */
.thread .fix { align-self: flex-end; max-width: 88%; margin: -2px 0 6px auto; padding: 7px 11px; border-radius: 12px; background: #fff4d6; color: #6b4e00; font-size: .88rem; line-height: 1.35; }
.thread .fix b { display: block; color: #23263a; font-size: .95rem; }
.thread .fix small { display: block; margin-top: 2px; }
.thread .fix.ok { background: #dcfce7; color: #15803d; padding: 4px 10px; }

/* Choosing on the map where to go. */
.pickbar { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 999px; background: #1d4ed8; color: #fff; font-weight: 700; font-size: .92rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); white-space: nowrap; }
.pickbar .btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); }
.mapctl button.on { background: #1d4ed8; color: #fff; }

/* The toast never blocks taps on what is under it. */
#toast { pointer-events: none; }

/* The clover is on: money doubled for a while. */
.luckpill { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; background: #dcfce7; color: #15803d; font-weight: 800; font-size: .8rem; white-space: nowrap; }

/* The crossword's solution on the result screen. */
.solgrid .xcell { display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1rem; min-width: 22px; }
.solgrid .xcell.miss { background: #eef0f4; color: #8a8fa3; }
.solgrid .xcell s { position: absolute; right: 2px; bottom: 0; font-size: .55rem; color: #dc2626; }
.sollist { list-style: none; padding: 0; margin: 6px 0 0; text-align: left; }
.sollist li { margin: 5px 0; font-size: .95rem; }
.sollist li.bad b:last-child { color: #15803d; }

/* "Today in town" sits with the map buttons, with how many things are going on. */
.mapctl .todayctl { position: relative; }
.mapctl .todayctl em { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e4572e; color: #fff; font-size: .7rem; font-style: normal; line-height: 18px; }

/* Your mistakes at the end of a game. */
.wrongs ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.wrongs li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.wrongs li:first-child { border-top: 0; }
.wrongs li b { color: #15803d; }
.wrongs li small { color: #dc2626; }
.okline { color: #15803d; font-weight: 700; }

/* Report a question. */
.reportq { display: block; margin: 10px auto 0; color: var(--muted); }
.sheet .col { display: grid; gap: 8px; margin-top: 10px; }

/* Flashcards. */
.fcard { display: block; width: 100%; min-height: 190px; margin: 12px 0; padding: 22px 16px; border: 2px solid var(--line); border-radius: 20px; background: #fff; text-align: center; cursor: pointer; box-shadow: 0 6px 18px rgba(35,38,58,.08); }
.fcard.flip { border-color: #16a34a; }
.fcard hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }
.fword { font-family: var(--display); font-size: 1.8rem; font-weight: 800; margin: 6px 0; color: var(--ink); }
.fex { margin: 4px 0 2px; font-style: italic; }

/* The place screen: who, friendship, what's on, the main action, the rest folded. */
.bsheet .bhead { display: flex; gap: 12px; align-items: center; text-align: left; margin-bottom: 8px; }
.bsheet .bhead h3 { margin: 0; }
.bsheet .bhead p { margin: 2px 0; }
.bsheet .ownedtag { color: #1d4ed8; font-weight: 800; }
.fbar { margin: 6px 0 2px; text-align: left; }
.fbtop { display: flex; justify-content: space-between; font-size: .9rem; }
.fbtrack { height: 10px; border-radius: 6px; background: #fde2e4; overflow: hidden; margin-top: 4px; }
.fbtrack i { display: block; height: 100%; background: linear-gradient(90deg, #f472b6, #e11d48); border-radius: 6px; }
.bsheet .perks { text-align: left; margin: 2px 0 10px; }
.bsheet .perks .warn { color: #b45309; }
.bsheet .actions { display: grid; gap: 8px; margin: 10px 0; }
.propbox { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--c1) 6%, #fff); border: 1px solid var(--line); text-align: left; }
.proprow { display: flex; justify-content: space-between; align-items: center; }
.lockline { text-align: left; }

/* Chat: the goal on one line (tap to read it all), so the messages keep the room. */
.mission.one { padding: 8px 12px; }
.mission.one summary { list-style: none; cursor: pointer; display: flex; gap: 6px; align-items: baseline; }
.mission.one summary::-webkit-details-marker { display: none; }
.mission.one:not([open]) summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission.one p { margin: 6px 0 0; }
@media (max-width: 700px) {
  .chat .scene { height: 112px; }
  .chat .scene .face.hero, .scene-who .face.hero { width: 70px; height: 70px; }
  .chat .scene-bld { transform: scale(.7); transform-origin: bottom right; }
  .goalwords { padding: 2px 2px 4px; }
  .goalwords > small { display: none; }
  .goalwords button { padding: 4px 8px; }
  .goalwords button small { display: none; }
  .hintbox { padding: 6px 10px; margin-bottom: 4px; }
  .chatactions { margin-top: 2px; }
  .menucard { margin: 6px 12px 0; }
}

/* Phones: the main things are always one tap away, in a bar at the bottom. */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: grid; grid-template-columns: repeat(6, 1fr); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 -1px 0 rgba(35,38,58,.08), 0 -6px 18px rgba(35,38,58,.06); }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: 1px; border: 0; background: none; padding: 5px 0 3px; font: inherit; color: #3b3f52; cursor: pointer; }
  .tabbar button .ic { width: 21px; height: 21px; }
  .tabbar button span { font-size: .64rem; font-weight: 700; }
  .tabbar button.dim { opacity: .45; }
  .tabbar em { position: absolute; top: 2px; right: calc(50% - 18px); min-width: 9px; height: 9px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font-style: normal; font-size: .6rem; line-height: 9px; }
  .tabbar em:not(:empty) { height: 15px; line-height: 15px; top: 0; }
  .citypage .msgfab { display: none; }
  .citypage .joy { bottom: 84px !important; }
  .citypage .mapwrap { padding-bottom: 64px; }
  .citypage.sky-night .tabbar { background: rgba(20,26,61,.92); }
  .citypage.sky-night .tabbar button { color: #f3f4ff; }
}

/* The town tour. */
.tut { position: fixed; inset: 0; z-index: 60; }
.tutdim { position: absolute; inset: 0; background: rgba(15,18,35,.62); }
.tuthole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15,18,35,.62), 0 0 0 3px #ffd166; pointer-events: none; transition: all .25s; }
.tutcard { position: absolute; left: 0; right: 0; margin: 0 auto; width: min(360px, calc(100vw - 32px)); background: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: 0 14px 40px rgba(0,0,0,.3); text-align: left; }
.tutcard h3 { margin: 4px 0 6px; }
.tutcard p { margin: 0 0 12px; line-height: 1.45; }
.tutcard .row { justify-content: flex-end; gap: 8px; }
/* Phones: the chat header in one row — back, face, name, turns — and nothing on top of each other. */
@media (max-width: 700px) {
  .chat .scene { height: 76px; border-radius: 0 0 20px 20px; }
  .chat .scene .back { top: 50%; transform: translateY(-50%); }
  .chat .scene-who { left: 60px; bottom: 50%; transform: translateY(50%); align-items: center; }
  .chat .scene-who .face.hero { display: none; }
  .chat .who-card { margin: 0; padding: 4px 10px; }
  .chat .who-card b { font-size: .95rem; }
  .chat .who-card .hearts { display: none; }
  .chat .turns { top: auto; bottom: 8px; left: auto; right: 12px; }
  .chat .scene-bld { display: none; }
  .chat .mission { margin-top: 8px; }
}

/* Stop the voice while it speaks. */
.stopvoice { position: fixed; left: 50%; transform: translateX(-50%); top: 70px; z-index: 70; border: 0; border-radius: 999px; padding: 9px 16px; background: #23263a; color: #fff; font: inherit; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }

/* Friendship points on the result screen. */
.friendres { max-width: 360px; margin: 6px auto 4px; }
.friendres p { margin: 4px 0 0; }

/* Chest odds. */
.odds table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 6px; }
.odds th, .odds td { padding: 5px 4px; text-align: center; border-top: 1px solid var(--line); }
.odds td:first-child { text-align: left; }
.oddsline { display: block; margin-top: 6px; font-size: .8rem; opacity: .85; }
.tutwho { display: flex; align-items: center; gap: 8px; }
.tutwho .face.mini { width: 30px; height: 30px; }

/* The monthly pass. */
.ptrack { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-bottom: 8px; }
.pstep { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); font-size: 1rem; }
.pstep small { position: absolute; top: 1px; left: 4px; font-size: .55rem; color: var(--muted); }
.pstep i { position: absolute; bottom: 0; right: 3px; font-style: normal; font-size: .7rem; color: #16a34a; font-weight: 800; }
.pstep.done { background: #dcfce7; border-color: #86efac; }
.pstep.next { border-color: #f5b301; box-shadow: 0 0 0 2px #fde68a; }
.pstep.big { background: #f3e8ff; }
.pstep.locked { opacity: .55; }
.premiumbox { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: #f5f3ff; border: 1px solid #ddd6fe; text-align: left; }
.premiumbox ul { margin: 6px 0 10px; padding-left: 18px; }

/* "Oggi a…": the front page of the day. */
.todaysheet { padding-top: 0; }
.thead2 { margin: 0 -20px 6px; padding: 22px 20px 16px; border-radius: 22px 22px 0 0; color: #fff; background: linear-gradient(135deg, #3a86ff, #5b5bd6); text-align: left; }
.thead2.sky-dusk { background: linear-gradient(135deg, #f97316, #db2777); }
.thead2.sky-night { background: linear-gradient(135deg, #1e1b4b, #3730a3); }
.thead2 small { opacity: .85; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.thead2 h2 { margin: 2px 0; font-size: 1.5rem; }
.thead2 span { opacity: .9; font-size: .88rem; }
.tcard { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; margin: 8px 0; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(35,38,58,.06); cursor: default; }
.tcard .ticon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.9rem; border-radius: 16px; background: #f3f4f6; }
.tcard small { color: var(--muted); font-weight: 700; font-size: .75rem; }
.tcard h4 { margin: 2px 0 4px; font-size: 1.05rem; }
.tcard p { margin: 0 0 8px; font-size: .9rem; line-height: 1.4; }
.tcard .tby { color: #b45309; font-weight: 600; }
.tcard.hot { background: #fff7ed; border-color: #fed7aa; } .tcard.hot .ticon { background: #ffedd5; }
.tcard.hol { background: #fdf4ff; border-color: #f5d0fe; cursor: pointer; } .tcard.hol .ticon { background: #fae8ff; }
.tcard.ev .ticon { background: #e0f2fe; }
.tlist { display: grid; gap: 6px; }
.trow { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.trow span:first-child { font-size: 1.2rem; text-align: center; }
.trow b:last-child { color: var(--muted); }
.tquiet { padding: 18px; border-radius: 18px; background: #f0fdf4; color: #166534; font-weight: 600; text-align: center; }
.mapctl .todayctl { background: #ffd166 !important; }
/* What a passer-by says: small, it should not cover the town. */
.saycard { width: min(330px, calc(100% - 32px)); padding: 10px 34px 10px 12px; border-width: 2px; border-radius: 16px; }
.saycard b { font-size: .95rem; }
.saycard small { font-size: .78rem; margin: 2px 0 6px; }
.saycard .btn.small { padding: 4px 9px; font-size: .78rem; }

/* The street you are in. */
.streetpill { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; z-index: 5; padding: 6px 14px; border-radius: 999px; background: rgba(29,78,216,.92); color: #fff; font-weight: 800; font-size: .9rem; box-shadow: 0 4px 12px rgba(0,0,0,.18); white-space: nowrap; max-width: calc(100% - 200px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

/* The monthly pass: always at hand, bottom left. */
.passfab { position: fixed; left: 16px; bottom: 24px; z-index: 9; width: 58px; height: 58px; border-radius: 18px; border: 2.5px solid #23263a; background: linear-gradient(160deg, #fff4d6, #ffd166); display: grid; place-items: center; align-content: center; gap: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(35,38,58,.18); }
.passfab small { font-size: .62rem; font-weight: 800; color: #6b4e00; margin-top: 2px; }
.passfab em { position: absolute; top: -8px; right: -8px; font-style: normal; font-size: 1rem; background: #ef4444; border-radius: 99px; padding: 2px 4px; }
.passfab.ready { animation: passpulse 1.6s ease-in-out infinite; }
@keyframes passpulse { 50% { transform: scale(1.08); } }
@media (max-width: 760px) { .passfab { bottom: 76px; width: 50px; height: 50px; font-size: 1.3rem; } }
@media (pointer: coarse) { .citypage .joy { left: 84px !important; } }
.fcard { cursor: default; }
.fcard.bad { border-color: #dc2626; }
.fverdict { margin: 0 0 6px; font-weight: 800; }
.fcard.bad .fverdict { color: #dc2626; } .fcard.flip:not(.bad) .fverdict { color: #16a34a; }
#f-flash input { flex: 1; }

/* Letters your keyboard lacks / the other alphabet's keyboard. */
.kbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.kkey { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-size: 1.05rem; cursor: pointer; box-shadow: 0 1px 0 rgba(35,38,58,.12); touch-action: manipulation; }
.kkey:active { background: #e0e7ff; }
.kkey.ktoggle { font-size: .82rem; font-weight: 700; }
.kbar.full { flex-direction: column; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; max-height: 190px; overflow: auto; }
.kgrid .kkey.wide { grid-column: span 3; font-size: .8rem; }
.prolock { flex: none; border: 1px dashed #c4b5fd; background: #f5f3ff; color: #5b21b6; border-radius: 12px; padding: 6px 10px; font: inherit; font-size: .82rem; cursor: pointer; }

/* The entry test's reading task. */
.pltext { text-align: left; background: #fffaf0; border: 1px solid #f3e3c3; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; line-height: 1.5; font-size: .95rem; max-height: 260px; overflow: auto; }

/* Who someone is. */
.whoname { padding: 0; font-weight: 800; color: var(--c1); text-decoration: underline dotted; }
.biocard { text-align: left; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.biocard p { margin: 0 0 8px; line-height: 1.5; }
.factrow { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.factrow b { text-align: right; font-weight: 600; }
/* Dots: green right, red wrong; the one on screen has a ring; answered ones can be tapped. */
.gdots i.ok { background: #16a34a; }
.gdots i.bad { background: #dc2626; }
.gdots i.cur { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.gdots i.tap { cursor: pointer; width: 12px; height: 12px; }

/* The pass, like a game season pass: golden banner, a track of levels to scroll sideways. */
.passsheet { max-width: 640px; padding-top: 0; }
.passhero { margin: 0 -20px 12px; padding: 22px 20px 16px; border-radius: 22px 22px 0 0; color: #fff; text-align: left; background: radial-gradient(circle at 80% 0, #ffd166 0, transparent 45%), linear-gradient(135deg, #7c3aed, #4c1d95); }
.passhero small { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; opacity: .85; font-size: .72rem; }
.passhero h2 { margin: 2px 0 8px; font-size: 1.5rem; }
.passhero p { margin: 8px 0 0; font-size: .85rem; opacity: .95; }
.phrow { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; }
.phbar { position: relative; height: 20px; margin-top: 8px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.phbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffd166, #f59e0b); border-radius: 99px; }
.phbar span { position: relative; display: block; text-align: center; font-size: .75rem; font-weight: 800; line-height: 20px; color: #23263a; }
.prows { display: flex; justify-content: space-between; margin: 10px 2px 4px; }
.plabel { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.plabel.gold { color: #b45309; }
.ptrack2 { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x proximity; }
.ptier { flex: none; width: 92px; display: grid; gap: 6px; scroll-snap-align: center; }
.pnum { position: relative; display: grid; place-items: center; height: 34px; }
.pnum::before { content: ''; position: absolute; left: -8px; right: -8px; top: 50%; height: 6px; transform: translateY(-50%); background: #e5e7eb; }
.ptier.on .pnum::before { background: #f59e0b; }
.pnum span { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid #e5e7eb; font-weight: 800; font-size: .85rem; }
.ptier.on .pnum span { border-color: #f59e0b; background: #fff7e0; }
.ptier.next .pnum span { border-color: #7c3aed; }
.pnum small { position: absolute; bottom: -9px; font-size: .58rem; color: var(--muted); font-weight: 700; }
.pcard { position: relative; height: 104px; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 6px 4px; border-radius: 16px; background: #f8fafc; border: 2px solid #e5e7eb; text-align: center; }
.pcard.gold { background: linear-gradient(160deg, #fff7d6, #ffe08a); border-color: #f5c84b; }
.pcard.big { box-shadow: inset 0 0 0 2px rgba(124,58,237,.35); }
.pcard.far { opacity: .7; }
.pcard.ready { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.25); animation: passpulse 1.6s ease-in-out infinite; }
.pcard.got { opacity: .55; }
.pico { position: relative; font-size: 1.9rem; line-height: 1; }
.pico b { position: absolute; right: -10px; bottom: -4px; font-size: .7rem; background: #23263a; color: #fff; border-radius: 99px; padding: 1px 5px; }
.pcard small { font-size: .68rem; font-weight: 700; line-height: 1.15; color: #3b3f52; }
.pdone { position: absolute; top: 4px; right: 6px; font-style: normal; color: #16a34a; font-weight: 900; }
.plock { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: .8rem; }
.btn.tiny { padding: 3px 9px; font-size: .72rem; border-radius: 99px; }
.passsheet .plabel { display: block; text-align: left; margin: 8px 2px 2px; }

/* Shop: today's promos and the Premium pass. */
.promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.promo { position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 10px 12px; border-radius: 18px; text-align: center; background: linear-gradient(160deg, #fff1f2, #ffe4e6); border: 2px solid #fda4af; }
.promo em { position: absolute; top: -8px; left: -6px; font-style: normal; font-weight: 900; font-size: .8rem; color: #fff; background: #e11d48; border-radius: 10px; padding: 3px 8px; transform: rotate(-6deg); }
.promo .pico { font-size: 2.2rem; }
.promo b { font-size: 1rem; }
.promo small { font-size: .74rem; line-height: 1.2; }
.promo.bought { opacity: .55; }
.premcard { text-align: left; padding: 16px; border-radius: 20px; color: #fff; background: radial-gradient(circle at 85% 0, #ffd166 0, transparent 40%), linear-gradient(135deg, #7c3aed, #4c1d95); }
.premhead { display: flex; align-items: center; gap: 10px; }
.premhead > span { font-size: 2rem; }
.premhead b { display: block; font-size: 1.2rem; }
.premhead small { opacity: .85; }
.premcard ul { margin: 10px 0 12px; padding-left: 18px; line-height: 1.6; font-size: .9rem; }
.premcard .btn[disabled] { background: rgba(255,255,255,.2); color: #fff; border: 0; }
.passshop { display: block; margin: 4px auto 0; }
/* Pass prizes: drawn pictures, a check when collected, a padlock on Premium. */
.pcard { cursor: pointer; }
.part { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.part svg { width: 44px; height: 44px; }
.part .chest.mini, .part svg.mini { width: 46px; height: 46px; }
.part b { position: absolute; right: -10px; bottom: -2px; font-size: .68rem; background: #23263a; color: #fff; border-radius: 99px; padding: 1px 5px; }
.pdone, .plock { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; }
.pdone { background: #16a34a; }
.pdone::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.plock { background: #b45309; border-radius: 4px; width: 12px; height: 10px; top: 10px; }
.plock::before { content: ''; position: absolute; left: 2px; top: -6px; width: 8px; height: 8px; border: 2px solid #b45309; border-bottom: 0; border-radius: 6px 6px 0 0; box-sizing: border-box; }
.pprice { font-size: .85rem; }
.pprice s { color: var(--muted); }
.pprice b { color: #e11d48; font-size: 1.05rem; }

/* Drawn icons (same style as the pass) and the bonus info cards */
.art { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; }
.art svg { width: 100%; height: 100%; }
.art.i { width: 1.15em; height: 1.15em; vertical-align: -.22em; }
.art.big { width: 72px; height: 72px; }
.gemrow { display: flex; align-items: center; gap: 10px; }
.gemrow .art { width: 30px; height: 30px; }
.gemrow .infob { margin-left: auto; }
.infob { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--muted); font: 800 .8rem/1 Georgia, serif; font-style: italic; cursor: pointer; flex: none; display: grid; place-items: center; padding: 0; }
.infob:hover { color: var(--ink); border-color: var(--ink); }
.shopitem .infob { position: absolute; top: 6px; left: 6px; }
.shopitem .pill.buy { border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.shopitem > .art { width: 44px; height: 44px; }
.unit .infob { margin-left: auto; }
.unit .infob + .btn { margin-left: 0; }
.infohead { display: flex; gap: 14px; align-items: center; margin: 6px 0 12px; }
.infohead h3 { margin: 0; }
.infohead p { margin: 2px 0 0; }
.infobox { background: #f6f7fb; border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.infobox h4 { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.infobox p { margin: 0; }
.infobox.tip { background: #fff8e1; }

/* Chest odds, pass icon, several prizes in one pass card */
.oddsrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.oddsrow .art { width: 30px; height: 30px; }
.oddsrow b { margin-left: auto; }
.chestitem .chestsvg.mini { width: 64px; height: 56px; }
.passfab .passico { width: 40px; height: 40px; display: block; }
.passfab .passico svg { width: 100%; height: 100%; }
.passfab em { font-weight: 900; color: #fff; padding: 1px 7px; font-size: .8rem; border: 2px solid #23263a; }
.passhero { position: relative; }
.passbadge { position: absolute; right: 64px; top: 12px; width: 76px; height: 76px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.passbadge svg { width: 100%; height: 100%; }
.pcard .parts { display: flex; justify-content: center; }
.pcard .parts .part + .part { margin-left: -12px; }
.pcard .parts:has(.part + .part) .part { width: 36px; height: 36px; }
.pcard .parts:has(.part + .part) .part svg { width: 34px; height: 34px; }
.art.i svg .chestsvg, .art.i .chestsvg { width: 100%; height: 100%; }
/* The drawn icons in the menus stay visible when the menu labels are hidden */
.hudnav button span.art, .tabbar button span.art { display: grid !important; font-size: 0; }
.hudnav button .art.ic { width: 24px !important; height: 24px !important; }
.art.ic { display: inline-grid; }

/* Real emoji in the game's style: a dark outline and a soft shadow, like a sticker */
.emo { display: inline-block; line-height: 1; filter: saturate(1.15) drop-shadow(.05em 0 0 #23263a) drop-shadow(-.05em 0 0 #23263a) drop-shadow(0 .05em 0 #23263a) drop-shadow(0 -.05em 0 #23263a) drop-shadow(0 .08em .04em rgba(35,38,58,.22)); }

/* The globe on the whole screen (the list of cities hidden) */
.worldpage.full > .worldlist, .worldpage.full > .wallet-note { display: none; }
.worldpage.full > .globe { grid-column: 1 / -1; min-height: calc(100dvh - 80px); }
.worldpage.full > .gzoom { right: 24px; }
@media (min-width: 900px) { .worldpage.full { grid-template-columns: minmax(0, 1fr); } }
/* A text whose translation is on its way */
.trwait { color: transparent !important; text-shadow: none !important; }
/* The pass button: icon and level always inside the button (also on phones) */
.passfab { padding: 3px 0 4px; }
.passfab .passico { width: 34px; height: 34px; }
.passfab small { line-height: 1; margin-top: 1px; white-space: nowrap; }
.pcard.none { visibility: hidden; }
/* Long words never run off the screen */
.lword, .lglyph, .gq.big, .fword, .cultbig, .card-front b { max-width: 100%; }
.tutcard { max-height: calc(100dvh - 16px); overflow: auto; }
/* Ask the mayor */
.helpmsgs { display: grid; gap: 8px; max-height: 46vh; overflow: auto; margin: 10px 0; padding: 4px 2px; }
.hmsg { padding: 10px 13px; border-radius: 16px; max-width: 88%; line-height: 1.4; white-space: pre-wrap; }
.hmsg.them { background: #eef6ff; justify-self: start; border-bottom-left-radius: 4px; }
.hmsg.me { background: var(--c1); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.helpform { display: flex; gap: 8px; align-items: flex-end; }
.helpform textarea { flex: 1; margin: 0; }
/* Languages and dialects of a country */
.langpicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.langpick { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; }
.langpick:hover { border-color: var(--c1); }
.langpick small { color: var(--muted); font-size: .75rem; }
.langpick.off { opacity: .5; cursor: default; }
.langpick.on { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 8%, #fff); }

/* A country in close-up: its shape, a point with a flag for every language and dialect */
.cmap { position: relative; margin: 6px 0 12px; border-radius: 20px; background: radial-gradient(circle at 30% 20%, #bfe7ff, #7cc8f2); border: 2.5px solid #23263a; overflow: hidden; }
.cmap svg { display: block; width: 100%; height: auto; }
.cpin { position: absolute; transform: translate(-50%, -100%); border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; }
.cpin .cflag { display: grid; place-items: center; padding: 3px; background: #fff; border: 2px solid #23263a; border-radius: 9px; box-shadow: 0 3px 0 rgba(35,38,58,.25); transition: transform .15s; }
.cpin i { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #23263a; margin-top: -1px; }
.cpin:hover .cflag { transform: scale(1.12); }
.cpin.on { z-index: 2; }
.cpin.on .cflag { background: #ffd166; transform: scale(1.25); }
.cpin.off { opacity: .55; }
.cflag img.flagimg.pin { width: 22px; height: 15px; border-radius: 3px; display: block; }
.cpick { display: flex; gap: 12px; align-items: center; background: #f6f7fb; border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; }
.cpick b { display: block; font-size: 1.05rem; }
.cpick small { color: var(--muted); }
.langpick .cflag { display: inline-grid; vertical-align: -3px; }
/* The level test: back, where you are, report; stopping when it gets too hard */
.plbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.plstop { background: #fff8e1; border-radius: 14px; padding: 10px 14px; margin: 6px 0 10px; }
.plstop p { margin: 0 0 8px; }

.linkbtn { background: none; border: 0; color: var(--muted, #77757f); text-decoration: underline; font: inherit; font-size: .9rem; margin: 12px auto 0; display: block; cursor: pointer; }
.authform textarea { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid #ccc; resize: vertical; }
