/* CYBERVLAD — stile. Look unico, scuro e al neon (scelta deliberata: niente tema chiaro). */
/* Layout: canvas a tutto schermo, interfaccia DOM sovrapposta con pannelli ad angoli tagliati */
:root {
  --bg: #07070c; --panel: rgba(11, 11, 19, 0.94); --panel2: rgba(20, 20, 32, 0.9); --ink: #e8e6df; --muted: #8a8a9a;
  --acc: #ffd23f; --acc2: #22e3d3; --red: #ff2e63; --vio: #b35cff; --line: #2a2a3c;
  --f-disp: "Chakra Petch", "Arial Narrow", sans-serif; --f-body: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--f-body); -webkit-user-select: none; user-select: none; touch-action: none; }
input { -webkit-user-select: text; user-select: text; }
#game { position: fixed; inset: 0; display: block; cursor: crosshair; width: 100%; height: 100%; outline: none; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.ver a { color: var(--acc2); pointer-events: auto; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#ui .screen, #ui .panel, #ui button, #ui input, #dialog { pointer-events: auto; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 700; letter-spacing: 0.04em; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 26px; color: var(--acc); text-transform: uppercase; }
h3 { font-size: 15px; color: var(--acc2); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 18px; }
p { max-width: 65ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.center { text-align: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two > * { min-width: 0; }

/* bottoni */
.btn { font: 700 15px var(--f-disp); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; cursor: pointer; clip-path: var(--cut); transition: background .15s, color .15s, border-color .15s; text-align: left; }
.btn:hover, .btn:focus-visible { background: rgba(255, 210, 63, 0.12); border-color: var(--acc); color: var(--acc); outline: none; }
.btn.big { font-size: 18px; padding: 14px 22px; }
.btn.acc { background: var(--acc); color: #0a0a12; border-color: var(--acc); }
.btn.acc:hover { background: #ffe27a; color: #0a0a12; }
.btn.ghost { background: transparent; }
.btn small { display: block; font: 400 13px var(--f-body); color: var(--muted); letter-spacing: 0; text-transform: none; }
.mini { font: 600 13px var(--f-body); color: var(--ink); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); padding: 5px 10px; cursor: pointer; }
.mini:hover:not(:disabled), .mini:focus-visible { border-color: var(--acc); color: var(--acc); outline: none; }
.mini.on { background: var(--acc); color: #0a0a12; border-color: var(--acc); }
.mini:disabled, .btn:disabled { opacity: 0.35; cursor: default; }
.mini.ghost { background: transparent; }
.chip { font: 600 13px var(--f-body); color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 5px 12px; cursor: pointer; text-transform: capitalize; }
.chip.on { color: #0a0a12; background: var(--acc2); border-color: var(--acc2); }
.tab { font: 700 14px var(--f-disp); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.tab.on, .tab:hover { color: var(--acc); border-bottom-color: var(--acc); }
.tab.close { margin-left: auto; color: var(--ink); }
.dot { display: inline-block; width: 7px; height: 7px; background: var(--red); border-radius: 50%; vertical-align: middle; }

/* schermate */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.screen.dim { background: rgba(4, 4, 8, 0.72); backdrop-filter: blur(3px); }
.screen.red { background: radial-gradient(circle, rgba(80, 0, 20, 0.55), rgba(10, 0, 4, 0.92)); }
.screen.black { background: #050508; overflow-y: auto; align-items: flex-start; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 24px; clip-path: var(--cut); max-height: calc(100% - 16px); overflow-y: auto; max-width: 100%; position: relative; }
.panel::before { content: ""; position: absolute; left: 0; top: 0; width: 60px; height: 3px; background: var(--acc); }
.panel.wide { width: 980px; }
#pauseBox { width: 440px; }
#loreBox { width: 640px; }
#loreBox p { font-size: 18px; line-height: 1.6; }

/* titolo */
#title { justify-content: flex-start; background: linear-gradient(90deg, rgba(5, 5, 10, 0.92) 0%, rgba(5, 5, 10, 0.6) 45%, rgba(5, 5, 10, 0) 75%); }
.titleWrap { display: flex; flex-direction: column; gap: 22px; width: min(460px, 100%); padding-left: clamp(0px, 4vw, 60px); max-height: 100%; overflow-y: auto; }
.logo { display: flex; flex-direction: column; line-height: 0.82; }
.logo .l1, .logo .l2 { font: 700 clamp(56px, 11vw, 112px) var(--f-disp); letter-spacing: -0.02em; }
.logo .l1 { color: var(--ink); }
.logo .l2 { color: var(--acc); text-shadow: 4px 0 0 var(--red), -3px 0 0 var(--acc2); animation: glitch 4s infinite steps(1); }
.logo .l3 { font: 600 15px var(--f-disp); letter-spacing: 0.5em; color: var(--acc2); margin-top: 14px; }
.panel.sub { padding: 16px 18px; }
.panel.sub:empty { display: none; }
.ver { position: fixed; right: 16px; bottom: 12px; color: var(--muted); font-size: 13px; }
@keyframes glitch { 0%, 92%, 100% { transform: none; clip-path: none; } 93% { transform: translate(3px, -1px); clip-path: inset(10% 0 55% 0); } 95% { transform: translate(-4px, 2px); clip-path: inset(50% 0 10% 0); } 97% { transform: translate(2px, 0); } }
.glitch-t { color: var(--acc2) !important; text-shadow: 2px 0 var(--red), -2px 0 var(--acc); animation: glitch 2s infinite steps(1); }

/* creazione personaggio */
.cgrid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.cgrid > * { min-width: 0; }
.cprev { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cprev canvas { max-width: 100%; border: 1px solid var(--line); }
.lbl { font: 600 12px var(--f-disp); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; display: block; }
#cname { font: 700 22px var(--f-disp); color: var(--acc); background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); padding: 8px 12px; width: 100%; max-width: 320px; }
#cname:focus { outline: none; border-color: var(--acc); }
.origins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.origin { text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: 14px/1.3 var(--f-body); }
.origin b { font: 700 15px var(--f-disp); color: var(--acc); }
.origin em { font-style: normal; color: var(--acc2); font-size: 13px; }
.origin.on { border-color: var(--acc); background: rgba(255, 210, 63, 0.08); }
.sws { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; background: var(--c); border: 2px solid rgba(255, 255, 255, 0.12); cursor: pointer; padding: 0; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--acc); }

/* menu di gioco */
.menuP { width: min(1180px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; padding: 0; }
#menuTabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 0 12px; flex-shrink: 0; }
#menuBody { padding: 18px 22px; overflow-y: auto; flex: 1; }
.inv { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.inv > * { min-width: 0; }
.wlist { display: flex; flex-direction: column; gap: 8px; }
.wcard { border: 1px solid var(--line); border-left: 3px solid var(--r); background: rgba(255, 255, 255, 0.02); padding: 10px 12px; }
.wh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wh b { font: 700 16px var(--f-disp); color: var(--r); }
.rar { color: var(--muted); font-size: 13px; }
.slotb { margin-left: auto; font: 700 11px var(--f-disp); background: var(--acc); color: #0a0a12; padding: 1px 6px; }
.ws { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.ws b { color: var(--ink); }
.tr { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--acc2); margin-top: 4px; }
.wa { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wa:empty { display: none; }
.res { display: flex; gap: 18px; flex-wrap: wrap; }
.res b { color: var(--acc); font-family: var(--f-disp); }
.ammo div { display: grid; grid-template-columns: 1fr auto; position: relative; padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ammo i { position: absolute; left: 0; bottom: -1px; height: 1px; background: var(--acc); }
.items { display: flex; flex-direction: column; gap: 6px; }
.item, .imp, .hk, .quest, .gig, .offer, .slot { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); padding: 8px 12px; background: rgba(255, 255, 255, 0.02); }
.item > div, .imp > div, .hk > div, .quest > div:first-child, .gig > div, .offer > :first-child, .slot > div { min-width: 0; flex: 1; }
.char { display: grid; grid-template-columns: 260px 1fr; gap: 26px; }
.char > * { min-width: 0; }
.charL canvas { width: 140px; height: 140px; }
.xpbar { height: 4px; background: rgba(255, 255, 255, 0.08); margin-top: 8px; }
.xpbar i { display: block; height: 100%; background: var(--vio); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 3px 0; color: var(--muted); }
.stats b { color: var(--ink); }
.pts { float: right; color: var(--acc); letter-spacing: 0.04em; }
.attrs { display: flex; flex-direction: column; gap: 6px; }
.attr { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; border-left: 3px solid var(--c); background: rgba(255, 255, 255, 0.02); padding: 6px 10px; }
.attr > b { font: 700 28px var(--f-disp); color: var(--c); text-align: center; }
.attr strong { font-family: var(--f-disp); }
.perks { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.pcol { display: flex; flex-direction: column; gap: 6px; }
.ph { font: 700 13px var(--f-disp); letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); border-bottom: 2px solid var(--c); padding-bottom: 4px; }
.perk { text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--ink); padding: 8px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; font: 13px/1.25 var(--f-body); }
.perk b { font: 700 13px var(--f-disp); }
.perk span { color: var(--acc); font-weight: 600; }
.perk small { grid-column: 1 / -1; color: var(--muted); }
.perk.got { border-color: var(--acc2); }
.perk.lock { opacity: 0.45; }
.perk:not(:disabled):hover { border-color: var(--acc); }
.perk:disabled { cursor: default; }
.implants { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.islot { display: flex; flex-direction: column; gap: 6px; }
.ih { font: 700 13px var(--f-disp); letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc2); }
.imp.on, .hk.on { border-color: var(--acc2); background: rgba(34, 227, 211, 0.06); }
.hacks { display: flex; flex-direction: column; gap: 6px; }
.hk { border-left: 3px solid var(--c); }
.journal { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }
.journal > * { min-width: 0; }
.quest { align-items: flex-start; margin-bottom: 8px; }
.quest.on { border-color: var(--acc); }
.quest b { font-family: var(--f-disp); }
.obj { color: var(--acc); margin-top: 6px; }
.qdone { color: var(--muted); padding: 3px 0; border-bottom: 1px solid var(--line); }
.gigs { display: flex; flex-direction: column; gap: 8px; }
.gt { font-size: 24px; color: var(--acc); width: 32px; text-align: center; flex: 0 0 auto !important; }
.pay { color: var(--acc); font: 700 15px var(--f-disp); }
.achs { display: flex; flex-direction: column; gap: 4px; }
.ach { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding: 5px 0; opacity: 0.5; }
.ach.on { opacity: 1; }
.ach.on b { color: var(--acc); }
details.tarot { border-bottom: 1px solid var(--line); padding: 6px 0; }
details.tarot summary { cursor: pointer; color: #ff5ac8; font-family: var(--f-disp); }
.slots { display: flex; flex-direction: column; gap: 6px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set input[type=range] { width: 200px; max-width: 100%; accent-color: var(--acc); }
.help div { padding: 4px 0; }
.help b { color: var(--acc); font-family: var(--f-disp); }

/* negozio */
.shophead { display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shophead h2 { margin: 0; }
.money { font: 700 20px var(--f-disp); color: var(--acc); }
.shop { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; padding: 16px 20px; overflow-y: auto; flex: 1; }
.shop > * { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.offer { align-items: stretch; }
.offer .wcard { border: 0; border-left: 3px solid var(--r); padding: 0 0 0 10px; background: none; }
.offer.sold { opacity: 0.4; }
.buy { white-space: nowrap; align-self: center; font-variant-numeric: tabular-nums; }
.sh { border-left: 3px solid var(--c, var(--line)); padding-left: 10px; }

/* mappa */
#mapview { flex-direction: column; gap: 10px; }
.mapHead { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 1100px; flex-wrap: wrap; }
.mapHead h2 { margin: 0; }
#mapCanvas { border: 1px solid var(--acc); image-rendering: pixelated; cursor: crosshair; max-width: 100%; }

/* dialoghi */
#dialog { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent); z-index: 8; }
.dlg { display: flex; gap: 18px; width: min(980px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--acc); padding: 16px; clip-path: var(--cut); cursor: pointer; }
#dialog.echo .dlg { border-top-color: var(--acc2); box-shadow: inset 0 0 40px rgba(34, 227, 211, 0.12); }
#dialog.sys .dlg { border-top-color: var(--muted); }
#dlgFace { width: 120px; height: 120px; flex-shrink: 0; }
.dlgMain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#dlgName { font: 700 16px var(--f-disp); letter-spacing: 0.1em; text-transform: uppercase; }
#dlgText { font-size: 19px; line-height: 1.45; min-height: 3em; }
#dialog.sys #dlgText { font-style: italic; color: #c8c8d8; }
#dlgNext { align-self: flex-end; color: var(--muted); font-size: 13px; animation: blink 1.2s infinite; }
#dlgChoices { display: flex; flex-direction: column; gap: 6px; }
#dlgChoices:empty { display: none; }
.choice { text-align: left; font: 17px var(--f-body); color: var(--ink); background: var(--panel2); border: 1px solid var(--line); padding: 8px 12px; cursor: pointer; }
.choice span { display: inline-block; width: 22px; color: var(--acc); font-family: var(--f-disp); font-weight: 700; }
.choice.req { color: var(--acc2); }
.choice em { color: var(--red); font-style: normal; font-size: 14px; }
.choice:hover:not(:disabled), .choice:focus-visible { border-color: var(--acc); background: rgba(255, 210, 63, 0.08); outline: none; }
.choice:disabled { opacity: 0.4; cursor: default; }
@keyframes blink { 50% { opacity: 0.3; } }

/* HUD DOM */
#objective { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); text-align: center; max-width: min(520px, 60vw); display: flex; flex-direction: column; gap: 2px; text-shadow: 0 2px 6px #000; }
#objective b { font: 700 13px var(--f-disp); letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc); }
#objective span { font-size: 16px; }
#objective.flash { animation: objf 1.2s; }
@keyframes objf { 0% { opacity: 0; transform: translate(-50%, -10px); } 100% { opacity: 1; transform: translate(-50%, 0); } }
#timer { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); font: 700 28px var(--f-disp); color: var(--acc); text-shadow: 0 2px 8px #000; font-variant-numeric: tabular-nums; }
#timer.red { color: var(--red); animation: blink .5s infinite; }
#toasts { position: fixed; left: 22px; top: 150px; display: flex; flex-direction: column; gap: 6px; max-width: min(420px, 80vw); }
.toast { background: var(--panel); border-left: 3px solid var(--acc2); padding: 7px 12px; font-size: 15px; animation: tin .25s; transition: opacity .4s, transform .4s; }
.toast.warn { border-left-color: var(--red); color: #ffd0d8; }
.toast.ach { border-left-color: var(--acc); color: var(--acc); font-family: var(--f-disp); }
.toast.tut { border-left-color: var(--vio); }
.toast.loot { border-left-color: var(--r); }
.toast.loot b { color: var(--r); font-family: var(--f-disp); }
.toast.loot span { color: var(--muted); font-size: 13px; }
.toast.out { opacity: 0; transform: translateX(-20px); }
@keyframes tin { from { opacity: 0; transform: translateX(-20px); } }
#banner { position: fixed; top: 32%; left: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0; pointer-events: none; }
#banner.on { animation: ban 3.8s forwards; }
#banner .bh { font: 700 15px var(--f-disp); letter-spacing: 0.4em; color: var(--acc); }
#banner .bt { font: 700 clamp(22px, 4vw, 36px) var(--f-disp); color: var(--ink); text-shadow: 0 3px 12px #000; }
@keyframes ban { 0% { opacity: 0; transform: translate(-50%, -40%); } 10%, 85% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; } }
#actBanner { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(0, 0, 0, 0.7), transparent 70%); }
#actBanner.on { animation: ban2 5s forwards; }
#actBanner .ah { font: 700 18px var(--f-disp); letter-spacing: 0.6em; color: var(--acc2); }
#actBanner .as { font: 700 clamp(36px, 7vw, 72px) var(--f-disp); color: var(--acc); }
@keyframes ban2 { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
#district { position: fixed; bottom: 22%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none; }
#district.on { animation: ban3 3.5s forwards; }
#district .dn { font: 700 clamp(26px, 5vw, 44px) var(--f-disp); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 3px 14px #000; }
#district .dd { color: #c8c8d8; text-shadow: 0 2px 6px #000; }
@keyframes ban3 { 0% { opacity: 0; letter-spacing: 0.4em; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
#bossLine, #echoLine { position: fixed; left: 50%; transform: translateX(-50%); bottom: 120px; background: var(--panel); padding: 8px 16px; border-left: 3px solid var(--red); opacity: 0; max-width: min(640px, 90vw); font-size: 17px; }
#echoLine { bottom: 170px; border-left-color: var(--acc2); }
#bossLine.on, #echoLine.on { animation: ban3 4.5s forwards; }
#bossLine b { color: var(--red); font-family: var(--f-disp); }
#touchPrompt { position: fixed; bottom: 270px; right: 22px; background: var(--panel); border-left: 3px solid var(--acc); padding: 6px 12px; font: 600 15px var(--f-body); }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 20; }
#fade.on { opacity: 1; }

/* breach protocol */
.bbox { background: var(--panel); border: 1px solid var(--acc2); padding: 20px; width: min(860px, 100%); clip-path: var(--cut); max-height: 100%; overflow-y: auto; }
.bhead { display: flex; justify-content: space-between; align-items: center; }
.bhead h2 { color: var(--acc2); }
.btime { font: 700 30px var(--f-disp); color: var(--acc); font-variant-numeric: tabular-nums; }
.btime.red { color: var(--red); }
.bbody { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.bbody > * { min-width: 0; }
.bgrid { display: grid; gap: 4px; }
.bc { font: 700 clamp(14px, 2.6vw, 20px) var(--f-disp); background: rgba(34, 227, 211, 0.04); color: #5f8f8c; border: 1px solid transparent; aspect-ratio: 1; cursor: default; padding: 0; }
.bc.act { background: rgba(34, 227, 211, 0.14); color: var(--acc2); border-color: rgba(34, 227, 211, 0.4); cursor: pointer; }
.bc.act:hover { background: var(--acc2); color: #0a0a12; }
.bc.used { color: #3a3a4a; }
.bbuf { display: flex; gap: 4px; flex-wrap: wrap; }
.bbuf span { width: 40px; height: 40px; border: 1px dashed var(--line); display: grid; place-items: center; font: 700 16px var(--f-disp); color: var(--acc); }
.bseq { padding: 6px 0; border-bottom: 1px solid var(--line); }
.bseq div { display: flex; gap: 8px; font: 700 18px var(--f-disp); color: var(--muted); }
.bseq span.hit { color: var(--acc2); }
.bseq.ok div { color: var(--acc); }
.bseq small { color: var(--muted); }

/* morte e finale */
#deathBox h1 { font-size: clamp(56px, 12vw, 120px); color: var(--red) !important; margin: 0; }
#deathBox { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#endBox { width: min(760px, 100%); margin: 8vh auto; padding: 0 16px 60px; }
#endBox .eh { font: 700 15px var(--f-disp); letter-spacing: 0.5em; color: var(--acc2); }
#endBox h1 { font-size: clamp(40px, 8vw, 80px); color: var(--acc); margin-bottom: 30px; }
#endBox p { font-size: 20px; line-height: 1.6; opacity: 0; animation: fin 1.6s forwards; }
#endBox .credits { opacity: 0; animation: fin 1.6s forwards; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 20px; }
@keyframes fin { to { opacity: 1; } }
#arenaBox { width: 460px; }
#arenaBox h1 { color: var(--acc); font-size: 54px; }

/* controlli touch */
#touch { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
#touch .tz-left, #touch .tz-right { position: absolute; top: 25%; bottom: 0; pointer-events: auto; }
#touch .tz-left { left: 0; width: 45%; }
#touch .tz-right { right: 0; width: 55%; }
.knob { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 2px solid rgba(255, 210, 63, 0.3); border-radius: 50%; opacity: 0; pointer-events: none; }
.knob.on { opacity: 1; }
.knob i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 210, 63, 0.35); transform: translate(-50%, -50%); }
.tbtns { position: absolute; right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(6, 46px); gap: 6px; pointer-events: auto; }
#touch button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 210, 63, 0.45); background: rgba(10, 10, 18, 0.55); color: var(--acc); font: 700 18px var(--f-disp); pointer-events: auto; }
#touch button.on { background: var(--acc); color: #0a0a12; }
#touch .tfire { position: absolute; right: calc(330px + env(safe-area-inset-right, 0px)); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); width: 84px; height: 84px; font-size: 34px; background: rgba(255, 46, 99, 0.35); border-color: var(--red); color: #fff; }
.tmenu, .tmap, .tinv { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); }
.tmenu { left: 50%; margin-left: -23px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.tmap { top: auto !important; left: calc(50% + 34px); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } .tinv { top: auto !important; left: calc(50% - 84px); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
body.touch #game { cursor: default; }
body.touch #toasts { top: 130px; }

/* schermi piccoli */
@media (max-width: 820px) {
  .cgrid, .inv, .char, .journal, .two, .shop, .bbody { grid-template-columns: 1fr; }
  .origins { grid-template-columns: 1fr; }
  .perks { grid-template-columns: repeat(5, 170px); }
  .panel { padding: 16px; }
  #objective { top: 120px; max-width: 90vw; }
  #objective span { font-size: 14px; }
  .dlg { flex-direction: column; gap: 8px; }
  #dlgFace { width: 64px; height: 64px; }
  #dlgText { font-size: 16px; }

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