:root {
  --bg: #17181c;
  --panel: rgba(16, 16, 20, 0.62);
  --panel-solid: #1c1c22;
  --panel-border: rgba(255, 255, 255, 0.10);
  --text: #f2eee6;
  --muted: #a7a39a;
  --accent: #e0262e;
  --accent-2: #ffb020;
  --font: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --title: "Anton", "Impact", "Arial Black", "Segoe UI", sans-serif;
  --fan-r: 132px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; touch-action: none; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
button { font-family: var(--font); font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 9px 14px; cursor: pointer; font-size: 13px; letter-spacing: .3px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .08s, background .15s, border-color .15s; }
button:hover { background: rgba(60, 60, 70, .8); }
button:active { transform: scale(.96); }
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: #ff6a6a; }
button.primary:hover { background: #ff3b44; }
button.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
button.round.big { width: 68px; height: 68px; font-size: 32px; border-width: 2px; border-color: rgba(255,255,255,.18); box-shadow: 0 8px 26px rgba(0,0,0,.55); position: relative; }

/* ---- top-right menu */
#menu-wrap { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); pointer-events: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#btn-menu { opacity: .8; }
#btn-menu:hover { opacity: 1; }
#menu { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 190px; animation: drop .18s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#menu button { display: flex; align-items: center; gap: 10px; background: transparent; border-color: transparent; box-shadow: none; border-radius: 10px; padding: 9px 10px; text-align: left; font-weight: 600; }
#menu button:hover { background: rgba(255,255,255,.08); }
#menu .mi { width: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
#menu .mi svg { display: block; }
#mute-ico .mute { display: none; }
#mute-ico.muted .mute { display: block; }
#mute-ico.muted .wave { display: none; }
#btn-menu svg { display: block; }
#menu kbd { margin-left: auto; font-family: var(--font); font-size: 10px; color: var(--muted); border: 1px solid var(--panel-border); border-radius: 5px; padding: 1px 5px; }

/* ---- weapon fan (GTA-style) */
#fan-backdrop { position: fixed; inset: 0; pointer-events: auto; background: radial-gradient(circle at calc(100% - 52px) 50%, rgba(0,0,0,.05), rgba(0,0,0,.55) 70%); animation: fadein .2s ease-out; z-index: 4; }
#weapon-wrap { position: absolute; right: max(18px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); width: 68px; height: 68px; pointer-events: auto; z-index: 6; }
#btn-weapon { position: absolute; inset: 0; background: rgba(20, 20, 26, .78); }
#btn-weapon #weapon-ico { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); transition: transform .15s; }
#btn-weapon #weapon-key { position: absolute; right: 6px; bottom: 6px; font-size: 10px; color: var(--muted); font-weight: 700; font-family: var(--font); }
#btn-weapon #weapon-shells { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 9px; letter-spacing: 2px; color: #ffb020; font-family: var(--font); }
#weapon-wrap.open #btn-weapon { border-color: var(--accent); background: rgba(40, 10, 12, .85); }
#weapon-wrap.open #btn-weapon #weapon-ico { transform: scale(.85); }
#weapon-fan { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#weapon-fan .tool { position: absolute; left: 0; top: 0; width: 60px; height: 60px; margin: -30px 0 0 -30px; padding: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: rgba(20, 20, 26, .86); border: 2px solid rgba(255,255,255,.16); box-shadow: 0 8px 22px rgba(0,0,0,.55); opacity: 0; pointer-events: none; transform: translate(0, 0) scale(.25); transition: transform .28s cubic-bezier(.2, 1.5, .4, 1), opacity .18s ease-out; transition-delay: 0s; }
#weapon-fan .tool .ico { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); }
#weapon-fan .tool .lbl { font-size: 8.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
#weapon-fan .tool.active { border-color: var(--accent); background: rgba(70, 14, 18, .9); }
#weapon-fan .tool.active .lbl { color: var(--text); }
#weapon-wrap.open #weapon-fan .tool { opacity: 1; pointer-events: auto; transform: translate(var(--dx), var(--dy)) scale(1); transition-delay: calc(var(--i) * 35ms); }
#weapon-wrap.open #weapon-fan .tool:hover { transform: translate(var(--dx), var(--dy)) scale(1.12); }
#weapon-fan .tool.locked { display: none; }
#weapon-wrap.open #weapon-fan .tool.top { transform: translate(var(--dx), var(--dy)) scale(1.22); border-color: #e9c46a; box-shadow: 0 0 0 3px rgba(233,196,106,.25), 0 8px 22px rgba(0,0,0,.55); z-index: 2; }
#weapon-fan .tool .badge-ico { filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); }
#weapon-wrap.open #weapon-fan .tool { transition-delay: 0s; }
#weapon-wrap.open.dragging #weapon-fan .tool { transition: transform .05s linear, opacity .18s ease-out; }

#hint { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 12px; color: var(--muted); text-shadow: 0 1px 0 #000; white-space: nowrap; opacity: .85; transition: opacity 1s; background: rgba(0,0,0,.35); padding: 6px 12px; border-radius: 999px; }
#hint.fade { opacity: 0; }   /* la mette il gioco dopo tre colpi andati a segno: i comandi ormai li sai (la transizione c'era già) */

#overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0,0,0,.2), rgba(0,0,0,.75)); animation: fadein .4s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
#overlay-box { text-align: center; padding: 28px 36px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,.6); max-width: 92vw; }
#ko-text.escaped { color: #3ec46d; text-shadow: 0 6px 0 #0d4a24, 0 0 30px rgba(62,196,109,.6); font-size: 64px; }
#ko-text { font-family: var(--title); font-weight: 400; font-size: 96px; line-height: 1; color: var(--accent); text-shadow: 0 6px 0 #5a0a0a, 0 0 30px rgba(224,38,46,.6); letter-spacing: 4px; animation: slam .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes slam { from { transform: scale(3) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }
#ko-sub { color: var(--muted); margin: 10px 0 6px; font-size: 14px; }
#ko-stats { font-size: 14px; margin-bottom: 18px; }
#ko-stats b { color: var(--accent-2); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

#warn { position: fixed; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 56px); transform: translateX(-50%); z-index: 20; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; gap: 12px; align-items: center; backdrop-filter: blur(8px); }
.hidden { display: none !important; }
#rotate { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: #0f1115; color: #f2f2f2; text-align: center; padding: 24px; }
#rotate .phone { display: block; margin: 0 auto 18px; color: #f2f2f2; transform-origin: 50% 50%; animation: rotate-hint 2.4s ease-in-out infinite; }
#rotate .rt-title { font: 700 24px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .02em; }
#rotate .rt-sub { margin-top: 8px; font-size: 14px; opacity: .7; }
@keyframes rotate-hint { 0%, 18% { transform: rotate(0); } 45%, 72% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  #weapon-fan .tool, #menu, #overlay, #ko-text, #rotate .phone { transition: none; animation: none; }
}
@media (max-height: 460px) {
  :root { --fan-r: 96px; }
  #weapon-wrap { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 22px); transform: none; }
  #hint { display: none; }
  #ko-text { font-size: 56px; }
  #warn { top: max(10px, env(safe-area-inset-top)); }
}
@media (max-width: 640px) {
  :root { --fan-r: 96px; }
  #weapon-wrap { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 40px); transform: none; }
  #hint { display: none; }
  #ko-text { font-size: 64px; }
}

/* the preloader: the whole building (59 images) comes in before the first punch */
#preload{position:fixed;inset:0;z-index:100;background:radial-gradient(ellipse at 50% 40%,#2b231d 0%,#161210 70%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#e9c46a;font-family:"Segoe UI",system-ui,sans-serif;transition:opacity .6s}
#preload.done{opacity:0;pointer-events:none}
#preload .pl-logo{display:flex;align-items:center;gap:16px;font-size:46px;font-weight:800;letter-spacing:1px;color:#f1efe8;text-shadow:0 2px 0 #000}
#preload .pl-d{background:#d62824;color:#fff;border-radius:10px;width:60px;height:60px;display:flex;align-items:center;justify-content:center;font-size:44px;box-shadow:0 3px 0 #7a1414}
#preload .pl-motto{color:#cdb37a;font-size:13px;letter-spacing:3px;text-transform:uppercase}
#preload .pl-bar{width:min(60vw,440px);height:12px;border:2px solid #cdb37a;border-radius:7px;overflow:hidden;background:#2a2320;margin-top:10px}
#preload .pl-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#c9a24a,#f6dd8a);transition:width .15s}
#preload .pl-txt{font-size:12px;color:#9a8a6a;letter-spacing:1px}
@media (max-width:600px){#preload .pl-logo{font-size:30px}#preload .pl-d{width:42px;height:42px;font-size:30px}}

/* ---------------------------------------------------------------- the game's own UI icon set
   Le icone dell'interfaccia erano tratti sottili generici, di un altro disegno rispetto al gioco. Questo set è disegnato come
   il resto: UNA forma piena nell'oro della D.I.C.K. Corp. (o nel rosso aziendale), UN contorno scuro, niente più sottile di
   2 px, così reggono a 19 px. `--ic` è il colore della forma, `currentColor` resta per i tratti che devono seguire il testo. */
.ico-ui { display: block; overflow: visible; --ic: #e3b04b; }
.ico-ui .sh { fill: var(--ic); stroke: #14141a; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ico-ui .ln { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-ui .fl { fill: currentColor; }
.ico-ui .cut { fill: none; stroke: #14141a; stroke-width: 2.1; stroke-linecap: round; }
.ico-ui.tie { --ic: #cf2b36; }                       /* capo nuovo = cravatta nuova */
.ico-ui.tie .sh { stroke: #3d070c; stroke-width: 1.1; }   /* a 21 px un contorno da 1,8 si mangia la sagoma: qui va sottile */

/* the corner: RESTART and the info tab on the same line, the menu under them */
#top-row { display: flex; align-items: center; gap: 8px; }

/* the restart badge: when the boss is dead there is no popup in the way any more — the game keeps running and you can go on
   shooting the body. This pulses in the corner instead, and one click hires a new one. */
#btn-restart { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 15px 0 12px; border-radius: 14px;
  font-weight: 900; font-size: 14px; letter-spacing: .1em; color: #fff; white-space: nowrap;
  background: linear-gradient(#e8323f, #bd0c1a); border: 2px solid rgba(255, 255, 255, .88);
  cursor: pointer; animation: restart-pulse 1.15s ease-in-out infinite; }
#btn-restart:hover { background: linear-gradient(#ff4a56, #d81222); animation: none; transform: scale(1.05); box-shadow: 0 10px 26px rgba(0,0,0,.55); }
@keyframes restart-pulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(0,0,0,.5), 0 0 0 0 rgba(233,45,58,.75); transform: scale(1); }
  50%      { box-shadow: 0 8px 26px rgba(0,0,0,.55), 0 0 0 11px rgba(233,45,58,0); transform: scale(1.055); }
}
@media (prefers-reduced-motion: reduce) { #btn-restart { animation: none; } }
@media (max-width: 560px) { #btn-restart { font-size: 12px; height: 40px; padding: 0 11px 0 9px; letter-spacing: .06em; } }

/* Il fascicolo lo aggiunge lore.js (file di un altro agente, non si tocca): la sua cartellina entra nel set da qui,
   riempita d'oro e ricontornata di scuro come le altre. Se un giorno cambia il suo markup questa regola smette di
   applicarsi e basta — non rompe niente. */
#btn-dossier .mi svg path:first-child { fill: #e3b04b; stroke: #14141a; stroke-width: 1.8; }
#btn-dossier .mi svg path + path { stroke: #14141a; stroke-width: 2; }
