/* MARANZA FIGHT 4 — Milano, CSS */
@font-face { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; src: url('../assets/fonts/Anton-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/Inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/Inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/Inter-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/Inter-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --ink: #0b0c11;
  --ink2: #14151c;
  --ink3: #1d1f28;
  --cream: #f4efdf;
  --yellow: #ffc42e;
  --yellow-deep: #e8a400;
  --pink: #ff4f7b;
  --teal: #2ee6c8;
  --red: #e5323d;
  --green: #7ed957;
  --muted: #9e9a90;
  --line: rgba(244, 239, 223, 0.16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; width: 100%; background: var(--ink); color: var(--cream); font-family: 'Inter', system-ui, sans-serif; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; outline: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
canvas { display: block; }

/* overlays */
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.55) 100%); }
#grain { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }
#flashDamage { position: fixed; inset: 0; pointer-events: none; z-index: 45; background: radial-gradient(ellipse at center, transparent 30%, rgba(229,50,61,.7) 100%); opacity: 0; transition: opacity .15s ease; }
#flashDamage.on { opacity: 1; transition: opacity .05s; }
#flashRage { position: fixed; inset: 0; pointer-events: none; z-index: 44; background: radial-gradient(ellipse at center, transparent 35%, rgba(255,196,46,.55) 100%); opacity: 0; }
#flashRage.on { animation: rageFlash .8s ease-out; }
@keyframes rageFlash { 0% { opacity: .9; } 100% { opacity: 0; } }

.screen { position: fixed; inset: 0; z-index: 30; overflow: auto; }
.screen.overlay-screen { background: rgba(5,6,10,.72); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.kicker { font-weight: 800; font-size: 11px; letter-spacing: .2em; color: var(--yellow); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; background: var(--pink); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,79,123,.15); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .5; } }

/* LOADING */
.loading-screen { background: radial-gradient(circle at 68% 20%, #342431 0%, #111219 45%, #07080c 100%); display: flex; align-items: center; justify-content: center; z-index: 100; }
.load-noise { position: absolute; inset: 0; opacity: .12; background: repeating-linear-gradient(115deg, transparent 0 28px, rgba(255,196,46,.08) 28px 29px), repeating-linear-gradient(65deg, transparent 0 44px, rgba(255,79,123,.06) 44px 45px); }
.loading-inner { position: relative; width: min(560px, 88vw); text-align: center; }
.load-kicker { font-size: 10px; letter-spacing: .4em; color: var(--muted); margin-bottom: 16px; }
.load-logo { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(52px, 10vw, 94px); line-height: .9; color: var(--yellow); letter-spacing: -.02em; text-shadow: 5px 5px 0 #000; }
.load-logo span { color: var(--cream); }
.load-logo b { display: inline-block; color: var(--pink); transform: rotate(-8deg) translateY(-10px); }
.load-sub { margin: 16px 0 30px; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.load-bar { height: 10px; background: #242530; border: 1px solid #3a3b46; padding: 2px; transform: skewX(-12deg); }
.load-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--yellow), var(--pink)); transition: width .2s; }
.load-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.load-foot { margin-top: 36px; font-size: 9px; letter-spacing: .22em; color: #615f68; }

/* MENU */
.menu-screen { background: linear-gradient(90deg, rgba(7,8,12,.96) 0%, rgba(7,8,12,.84) 34%, rgba(7,8,12,.28) 66%, rgba(7,8,12,.55) 100%), linear-gradient(0deg, rgba(7,8,12,.9), transparent 30%); display: flex; flex-direction: column; justify-content: space-between; padding: calc(18px + var(--safe-t)) calc(30px + var(--safe-r)) calc(16px + var(--safe-b)) calc(30px + var(--safe-l)); }
.menu-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.mini-brand { display: flex; gap: 10px; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.mini-brand b { color: var(--pink); }
.mb-mark { width: 28px; height: 28px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 17px; transform: rotate(-6deg); }
.menu-top-right { display: flex; gap: 10px; align-items: center; }
.money-pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(11,12,17,.72); border: 1px solid rgba(255,196,46,.35); padding: 7px 12px 7px 8px; font-weight: 800; font-size: 13px; letter-spacing: .03em; backdrop-filter: blur(6px); }
.coin { width: 20px; height: 20px; display: grid; place-items: center; background: var(--yellow); color: #171006; border-radius: 50%; font-size: 12px; font-weight: 900; }
.ghost-btn { border: 1px solid var(--line); padding: 10px 15px; font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--cream); background: rgba(11,12,17,.35); transition: .18s; }
.ghost-btn:hover { border-color: var(--yellow); background: rgba(255,196,46,.1); color: var(--yellow); }
.ghost-btn.danger:hover { border-color: var(--pink); color: var(--pink); background: rgba(255,79,123,.1); }
.ghost-btn.wide { width: 100%; margin-top: 12px; }
.ghost-btn.install-mini { border-color: rgba(46,230,200,.4); color: var(--teal); }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); font-weight: 900; color: var(--muted); }
.icon-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.menu-main { display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(280px, .62fr); gap: 5vw; align-items: end; flex: 1; min-height: 0; position: relative; z-index: 2; padding-top: 5vh; }
.menu-copy { align-self: center; padding-bottom: 4vh; }
.game-title { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; margin: 20px 0 0; font-size: clamp(74px, 11.5vw, 168px); line-height: .79; letter-spacing: -.025em; color: var(--yellow); text-shadow: 6px 7px 0 rgba(0,0,0,.7); display: block; position: relative; }
.game-title span { display: block; }
.game-title .fight { color: var(--cream); margin-left: .22em; }
.game-title .four { position: absolute; right: 3%; bottom: -4%; color: var(--pink); font-size: 1.08em; transform: rotate(9deg); text-shadow: 8px 8px 0 #0a0a0e; -webkit-text-stroke: 2px #0a0a0e; }
.tagline { margin: 28px 0 30px; font-size: clamp(13px, 1.2vw, 16px); line-height: 1.6; color: #d6d0c2; max-width: 440px; }
.tagline em { color: var(--muted); font-style: normal; font-size: .9em; }
.menu-nav { display: flex; flex-direction: column; gap: 7px; max-width: 480px; }
.main-btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 18px; background: var(--yellow); color: var(--ink); border: 1px solid var(--yellow); transform: skewX(-4deg); transition: .18s; box-shadow: 4px 4px 0 rgba(0,0,0,.35); }
.main-btn > * { transform: skewX(4deg); }
.main-btn:hover { background: var(--cream); transform: skewX(-4deg) translateX(5px); box-shadow: 7px 7px 0 rgba(0,0,0,.4); }
.main-btn .mb-index { font-size: 9px; font-weight: 900; opacity: .55; width: 18px; }
.main-btn .mb-label { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 25px; letter-spacing: .02em; line-height: 1; }
.main-btn .mb-sub { font-size: 9px; font-weight: 700; opacity: .62; letter-spacing: .06em; margin-left: auto; text-align: right; max-width: 170px; }
.main-btn .mb-arrow { font-weight: 900; font-size: 19px; margin-left: 4px; }
.main-btn.small { padding: 11px 18px; }
.main-btn.small .mb-label { font-size: 19px; }
.main-btn.compact { width: auto; min-width: 220px; justify-content: space-between; padding: 13px 18px; }
.main-btn.compact .mb-label { font-size: 20px; }
.menu-foot { margin-top: 26px; font-size: 9px; letter-spacing: .12em; color: #67656e; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-foot span { white-space: nowrap; }
.menu-card { align-self: center; background: #e9e1cb; color: #17150f; width: min(330px, 100%); justify-self: end; padding: 22px 22px 18px; transform: rotate(-2.2deg); box-shadow: 12px 14px 0 rgba(0,0,0,.38); position: relative; }
.card-tape { position: absolute; width: 96px; height: 26px; background: rgba(255,196,46,.7); top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg); mix-blend-mode: multiply; }
.card-portrait { font-size: 44px; width: 64px; height: 64px; background: #17150f; color: var(--yellow); display: grid; place-items: center; border-radius: 50%; margin-bottom: 14px; }
.card-quote { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 24px; line-height: 1.05; letter-spacing: -.01em; }
.card-quote b { color: #b9183c; }
.card-author { margin-top: 12px; font-size: 9px; font-weight: 800; letter-spacing: .06em; line-height: 1.5; opacity: .62; }
.card-stats { display: flex; justify-content: space-between; border-top: 2px solid rgba(23,21,15,.15); margin-top: 16px; padding-top: 12px; }
.card-stats div { display: flex; flex-direction: column; gap: 2px; }
.card-stats b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 26px; line-height: 1; }
.card-stats span { font-size: 7px; font-weight: 900; letter-spacing: .12em; opacity: .55; }
.menu-bottom { display: flex; align-items: center; gap: 20px; position: relative; z-index: 2; font-size: 9px; letter-spacing: .12em; color: #76737c; }
.text-btn { color: #b9b4a7; font-size: 9px; font-weight: 800; letter-spacing: .15em; border-bottom: 1px solid transparent; }
.text-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.menu-disclaimer { margin-left: auto; font-size: 8px; color: #56545d; letter-spacing: .08em; }

/* MAP */
.map-screen { background: #0e0f15; padding: calc(18px + var(--safe-t)) calc(24px + var(--safe-r)) calc(18px + var(--safe-b)) calc(24px + var(--safe-l)); display: flex; flex-direction: column; gap: 18px; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.map-head h2, .shop-head h2 { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(32px, 4.5vw, 58px); line-height: .9; margin: 6px 0 0; letter-spacing: -.015em; color: var(--cream); }
.map-head h2 span, .shop-head h2 span { color: var(--yellow); }
.map-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.map-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 18px; }
.map-canvas { position: relative; background: radial-gradient(circle at 50% 45%, #20222c 0%, #12131a 60%, #0a0b10 100%); border: 1px solid rgba(255,196,46,.18); overflow: hidden; min-height: 380px; }
.map-canvas::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle, #000 30%, transparent 90%); }
.metro-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.line-main { fill: none; stroke: var(--yellow); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; opacity: .8; }
.line-glow { fill: none; stroke: rgba(255,196,46,.18); stroke-width: 22; stroke-linejoin: round; stroke-linecap: round; }
.line-dot { fill: var(--ink); stroke: var(--yellow); stroke-width: 3; }
.district-nodes { position: absolute; inset: 0; }
.dnode { position: absolute; transform: translate(-50%, -50%); width: 132px; border: 0; text-align: left; padding: 0; background: none; color: var(--cream); }
.dnode .pin { width: 34px; height: 34px; border-radius: 50%; background: #171820; border: 3px solid var(--yellow); color: var(--yellow); font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 16px; display: grid; place-items: center; margin-bottom: 5px; transition: .18s; box-shadow: 0 0 0 5px rgba(255,196,46,.08); }
.dnode .dn-name { font-weight: 900; font-size: 10px; letter-spacing: .05em; text-shadow: 0 2px 4px #000; line-height: 1.1; }
.dnode .dn-prog { font-size: 8px; color: var(--muted); font-weight: 800; letter-spacing: .06em; }
.dnode:hover .pin { transform: scale(1.12); background: var(--yellow); color: var(--ink); }
.dnode.selected .pin { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 8px rgba(255,196,46,.14), 0 0 30px rgba(255,196,46,.35); }
.dnode.done .pin { border-color: var(--teal); color: var(--ink); background: var(--teal); }
.dnode.locked { opacity: .42; cursor: not-allowed; }
.dnode.locked .pin { border-color: #55535d; color: #77747d; }
.dnode.boss .pin { border-color: var(--pink); color: var(--pink); }
.dnode.selected.boss .pin { background: var(--pink); color: var(--ink); }
.map-legend { position: absolute; left: 14px; bottom: 12px; font-size: 8px; letter-spacing: .1em; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot.done { background: var(--teal); } .dot.current { background: var(--yellow); } .dot.locked { background: #55535d; }
.map-panel { background: #15161e; border: 1px solid rgba(244,239,223,.12); padding: 20px; display: flex; flex-direction: column; min-height: 0; position: relative; }
.panel-tape { position: absolute; right: -8px; top: 18px; width: 84px; height: 20px; background: var(--yellow); transform: rotate(4deg); opacity: .9; }
.map-panel-head { display: flex; justify-content: space-between; gap: 10px; }
.map-panel h3 { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 30px; line-height: .95; margin: 5px 0 6px; color: var(--cream); }
.map-panel p { font-size: 11px; line-height: 1.5; color: var(--muted); margin: 0; max-width: 280px; }
.district-seal { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 1px solid var(--yellow); color: var(--yellow); font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 26px; transform: rotate(4deg); }
.map-progress-text { font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--yellow); margin: 16px 0 8px; }
.mission-list { display: flex; flex-direction: column; gap: 7px; overflow: auto; padding-right: 4px; flex: 1; }
.mission-card { display: flex; align-items: center; gap: 10px; border: 1px solid rgba(244,239,223,.11); background: #1a1b23; padding: 10px 11px; text-align: left; transition: .15s; }
.mission-card:hover { border-color: rgba(255,196,46,.5); background: #20212a; }
.mission-card.locked { opacity: .42; cursor: not-allowed; }
.mission-card.boss { border-color: rgba(255,79,123,.35); background: linear-gradient(90deg, rgba(255,79,123,.08), #1a1b23); }
.mc-index { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 19px; color: var(--yellow); width: 28px; flex: none; }
.mission-card.boss .mc-index { color: var(--pink); }
.mc-body { min-width: 0; flex: 1; }
.mc-title { font-weight: 800; font-size: 11px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sub { font-size: 8px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-stars { color: var(--yellow); font-size: 10px; letter-spacing: 1px; }
.mc-go { font-size: 15px; color: var(--muted); }
.mission-card:hover .mc-go { color: var(--yellow); }

/* BRIEFING */
.briefing-screen { background: radial-gradient(circle at 70% 15%, rgba(255,79,123,.13), transparent 45%), #0a0b10; display: flex; align-items: center; justify-content: center; padding: 20px; }
.briefing-card { width: min(900px, 96vw); background: #e9e1cb; color: #17150f; position: relative; padding: 28px 30px 24px; box-shadow: 14px 16px 0 rgba(0,0,0,.45); overflow: hidden; }
.briefing-stripes { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: repeating-linear-gradient(180deg, var(--pink) 0 14px, #17150f 14px 28px); }
.briefing-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid rgba(23,21,15,.14); padding-bottom: 16px; }
.briefing-head .kicker { color: #9c273f; }
.briefing-head h2 { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(38px, 5vw, 58px); line-height: .9; margin: 7px 0 6px; letter-spacing: -.02em; }
.briefing-head p { margin: 0; font-size: 11px; color: rgba(23,21,15,.65); font-weight: 600; }
.mission-badge { flex: none; width: 78px; height: 78px; border: 2px solid #17150f; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(3deg); }
.mission-badge span { font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.mission-badge b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 34px; line-height: 1; }
.briefing-body { display: grid; grid-template-columns: .8fr 1.4fr; gap: 22px; padding: 18px 0; }
.briefing-objective { border-right: 1px solid rgba(23,21,15,.14); padding-right: 20px; }
.obj-label { font-size: 8px; font-weight: 900; letter-spacing: .18em; color: #9c273f; }
#briefingObjective { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 24px; line-height: 1.05; margin: 6px 0 16px; }
.obj-reward { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: rgba(23,21,15,.55); }
.obj-reward b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 22px; color: #17150f; display: block; margin-top: 2px; }
.dialogue { display: flex; flex-direction: column; gap: 9px; max-height: 220px; overflow: auto; padding-right: 6px; }
.dialogue-line { display: grid; grid-template-columns: 44px 1fr; gap: 9px; align-items: start; }
.dialogue-avatar { width: 42px; height: 42px; display: grid; place-items: center; background: #17150f; color: var(--yellow); font-size: 20px; border-radius: 50%; }
.dialogue-line.you .dialogue-avatar { background: var(--pink); color: #fff; }
.dialogue-who { font-size: 8px; font-weight: 900; letter-spacing: .12em; color: #9c273f; margin-bottom: 2px; }
.dialogue-text { font-size: 11px; line-height: 1.5; font-weight: 500; }
.briefing-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 2px solid rgba(23,21,15,.14); padding-top: 16px; }
.briefing-actions .ghost-btn { color: #17150f; border-color: rgba(23,21,15,.25); background: transparent; }
.briefing-actions .ghost-btn:hover { background: rgba(23,21,15,.08); color: #17150f; border-color: #17150f; }
.briefing-actions .main-btn { background: #17150f; color: var(--yellow); border-color: #17150f; }
.briefing-actions .main-btn:hover { background: #2a2720; color: var(--cream); }

/* HUD */
.hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l)); }
.hud button { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.player-panel { display: flex; gap: 9px; align-items: center; background: linear-gradient(90deg, rgba(11,12,17,.88), rgba(11,12,17,.3)); padding: 8px 12px 8px 8px; border-left: 3px solid var(--yellow); backdrop-filter: blur(6px); min-width: 310px; }
.portrait { width: 46px; height: 46px; border-radius: 50%; background: #24242d; border: 2px solid var(--yellow); display: grid; place-items: center; font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 24px; color: var(--yellow); position: relative; flex: none; }
.portrait i { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(255,196,46,.25); }
.player-info { flex: 1; min-width: 0; }
.player-name-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.player-name-row b { font-size: 10px; letter-spacing: .12em; }
#hudModeBadge { font-size: 7px; font-weight: 900; letter-spacing: .1em; color: var(--ink); background: var(--yellow); padding: 2px 5px; }
.bar { height: 9px; background: rgba(255,255,255,.1); margin-top: 3px; position: relative; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; transition: width .18s ease; }
.bar span { position: absolute; right: 4px; top: -1px; font-size: 7px; font-weight: 900; line-height: 11px; text-shadow: 0 1px 2px #000; }
.bar.hp i { background: linear-gradient(90deg, #c9202e, #ff5d6c); }
.bar.stamina { height: 5px; margin-top: 3px; }
.bar.stamina i { background: var(--teal); }
.bar.stamina span { display: none; }
.bar.rage { height: 5px; }
.bar.rage i { background: linear-gradient(90deg, #b56f00, var(--yellow)); }
.bar.rage span { display: none; }
.objective-panel { position: relative; background: rgba(11,12,17,.72); border-top: 2px solid var(--yellow); padding: 7px 14px 9px; min-width: 260px; max-width: 38vw; backdrop-filter: blur(6px); }
.obj-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.obj-top .kicker { font-size: 8px; }
#hudDistrict { font-size: 8px; font-weight: 900; color: var(--muted); letter-spacing: .1em; }
#objectiveText { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 20px; line-height: 1.05; margin-top: 2px; }
.objective-track { height: 3px; background: rgba(255,255,255,.12); margin-top: 6px; }
.objective-track i { display: block; height: 100%; width: 0%; background: var(--yellow); transition: width .2s; }
.objective-timer { position: absolute; right: 16px; top: 46px; font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 24px; color: var(--pink); }
.hud-right { display: flex; align-items: center; gap: 7px; }
.enemy-pill { font-size: 8px; font-weight: 900; letter-spacing: .08em; background: rgba(11,12,17,.7); border: 1px solid var(--line); padding: 8px 10px; color: var(--muted); }
.enemy-pill span { color: var(--pink); font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 15px; margin-right: 3px; }
.pause-btn { width: 42px; height: 42px; background: rgba(11,12,17,.75); border: 1px solid var(--line); color: var(--cream); font-weight: 900; font-size: 17px; letter-spacing: 2px; }
.pause-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.combo-box { position: absolute; right: 7%; top: 24%; text-align: right; transform: rotate(-2deg); text-shadow: 3px 3px 0 #000; }
#comboNum { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(54px, 7vw, 86px); line-height: .8; color: var(--yellow); }
#comboNum::after { content: 'x'; font-size: .34em; color: var(--cream); margin-left: 3px; }
#comboRank { font-size: 9px; font-weight: 900; letter-spacing: .18em; color: var(--cream); }
.combo-line { width: 140px; height: 3px; background: rgba(255,255,255,.16); margin-top: 6px; margin-left: auto; }
.combo-line i { display: block; height: 100%; background: var(--pink); width: 100%; }
.boss-box { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); width: min(620px, 80vw); background: rgba(11,12,17,.82); border: 1px solid rgba(255,79,123,.4); padding: 8px 12px; backdrop-filter: blur(8px); }
.boss-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.boss-head .kicker { color: var(--pink); font-size: 8px; }
.boss-head b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 22px; letter-spacing: .02em; color: var(--cream); flex: 1; }
#bossHp { font-size: 9px; font-weight: 900; color: var(--pink); }
.boss-track { height: 6px; background: #2a1820; }
.boss-track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8e1029, var(--pink)); transition: width .2s; }
.buffs { position: absolute; left: 50%; bottom: calc(74px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; }
.buff { background: rgba(11,12,17,.8); border: 1px solid var(--line); padding: 4px 7px; font-size: 14px; display: flex; align-items: center; gap: 3px; }
.buff small { font-size: 8px; font-weight: 900; color: var(--muted); }
.desktop-hints { position: absolute; left: 16px; bottom: 12px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 8px; letter-spacing: .06em; color: rgba(244,239,223,.48); max-width: 45vw; }
.desktop-hints b { color: rgba(255,196,46,.8); }
.subtitle { position: absolute; left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%); max-width: min(640px, 82vw); background: rgba(11,12,17,.86); border-left: 3px solid var(--yellow); padding: 10px 16px; pointer-events: none; }
.subtitle b { display: block; font-size: 8px; letter-spacing: .15em; color: var(--yellow); margin-bottom: 3px; }
.subtitle span { font-size: 12px; line-height: 1.45; }
.toasts { position: absolute; right: 16px; top: 110px; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.toast { background: rgba(11,12,17,.9); border: 1px solid var(--line); border-left: 3px solid var(--yellow); padding: 8px 14px; font-size: 10px; font-weight: 700; max-width: 300px; animation: toastIn .25s ease both; display: flex; gap: 8px; align-items: center; }
.toast.rage { border-left-color: var(--pink); color: var(--yellow); }
.toast .ti { font-size: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.popups { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.popup { position: absolute; transform: translate(-50%, -50%); font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 20px; color: #fff; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000; white-space: nowrap; pointer-events: none; letter-spacing: .02em; animation: popupFloat .9s ease-out both; }
.popup.damage { font-size: 17px; }
.popup.big { font-size: 27px; color: var(--yellow); }
.popup.money { color: var(--yellow); font-size: 16px; }
.popup.comic { color: var(--yellow); font-size: 32px; transform: translate(-50%,-50%) rotate(-7deg); }
.popup.warn { color: var(--pink); font-size: 28px; }
@keyframes popupFloat { 0% { opacity: 0; transform: translate(-50%,-40%) scale(.7); } 15% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%,-150%) scale(.9); } }
.flash-text { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; background: radial-gradient(ellipse, rgba(0,0,0,.45), transparent 65%); }
.flash-text b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(56px, 10vw, 130px); line-height: .85; color: var(--yellow); text-shadow: 6px 6px 0 #000; letter-spacing: -.02em; animation: flashIn .5s cubic-bezier(.2,1.4,.4,1) both; }
.flash-text span { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--cream); text-transform: uppercase; text-shadow: 0 2px 4px #000; }
.flash-text.go b { color: var(--pink); }
@keyframes flashIn { from { opacity: 0; transform: scale(.75) rotate(-3deg); } to { opacity: 1; transform: none; } }

/* MOBILE CONTROLS */
.mobile-controls { position: absolute; inset: 0; pointer-events: none; }
.joystick { position: absolute; left: calc(20px + var(--safe-l)); bottom: calc(24px + var(--safe-b)); width: 118px; height: 118px; border-radius: 50%; background: rgba(11,12,17,.38); border: 2px solid rgba(244,239,223,.22); pointer-events: auto; touch-action: none; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,196,46,.8); border: 2px solid #fff6df; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.action-pad { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(20px + var(--safe-b)); width: 250px; height: 200px; pointer-events: none; }
.action-btn { position: absolute; pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(11,12,17,.68); border: 2px solid rgba(244,239,223,.3); color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(4px); touch-action: manipulation; }
.action-btn span { font-size: 21px; line-height: 1; }
.action-btn small { font-size: 6px; font-weight: 900; letter-spacing: .1em; margin-top: 3px; color: var(--muted); }
.action-btn:active { transform: scale(.92); background: var(--yellow); color: var(--ink); }
.action-btn.light { right: 0; bottom: 0; width: 78px; height: 78px; border-color: var(--yellow); }
.action-btn.light span { font-size: 28px; }
.action-btn.heavy { right: 78px; bottom: 10px; border-color: var(--pink); }
.action-btn.jump { right: 16px; bottom: 86px; }
.action-btn.dodge { right: 92px; bottom: 86px; }
.action-btn.rage { right: 170px; bottom: 16px; border-color: var(--yellow); color: var(--yellow); }
.action-btn.rage span { font-size: 24px; }

/* PAUSA E PANNELLI */
.overlay-panel { width: min(820px, 94vw); max-height: 90vh; overflow: auto; background: #12131a; border: 1px solid rgba(244,239,223,.12); padding: 28px 30px; position: relative; box-shadow: 0 20px 80px rgba(0,0,0,.55); }
.overlay-panel h2 { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: clamp(46px, 6vw, 78px); line-height: .85; margin: 8px 0 22px; letter-spacing: -.02em; }
.overlay-panel h2 span { color: var(--pink); }
.pause-panel { width: min(460px, 92vw); }
.pause-actions { display: flex; flex-direction: column; gap: 8px; }
.pause-actions .main-btn { width: 100%; }
.pause-tip { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.5; color: var(--muted); }

/* SHOP */
.shop-screen { background: radial-gradient(circle at 80% 0%, rgba(255,196,46,.12), transparent 40%), #0c0d13; padding: calc(18px + var(--safe-t)) calc(24px + var(--safe-r)) calc(18px + var(--safe-b)) calc(24px + var(--safe-l)); display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.shop-head-right { display: flex; gap: 10px; align-items: center; }
.shop-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.shop-tab { padding: 9px 14px; font-size: 9px; font-weight: 900; letter-spacing: .12em; color: var(--muted); border-bottom: 2px solid transparent; }
.shop-tab.active { color: var(--yellow); border-color: var(--yellow); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
.shop-card { background: #15161e; border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.shop-card:hover { border-color: rgba(255,196,46,.5); }
.shop-icon { font-size: 26px; }
.shop-card h3 { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 22px; line-height: 1; margin: 0; }
.shop-card p { font-size: 9px; line-height: 1.45; color: var(--muted); margin: 0; flex: 1; }
.shop-level { display: flex; gap: 3px; }
.shop-level i { width: 18px; height: 4px; background: rgba(255,255,255,.1); }
.shop-level i.on { background: var(--yellow); }
.shop-buy { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.shop-price { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 19px; color: var(--yellow); }
.buy-btn { background: var(--yellow); color: var(--ink); padding: 7px 12px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.buy-btn:disabled { background: #2b2b33; color: #6c6a72; cursor: not-allowed; }
.buy-btn.owned { background: var(--teal); }
.shop-note { font-size: 9px; color: var(--muted); text-align: center; letter-spacing: .06em; padding: 10px; }

/* SETTINGS */
.settings-panel { width: min(620px, 94vw); }
.settings-grid { display: flex; flex-direction: column; gap: 15px; }
.settings-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 9px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.settings-grid label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--cream); }
.settings-grid select, .settings-grid input[type=range] { width: 100%; }
.settings-grid select { background: #1c1d26; border: 1px solid var(--line); color: var(--cream); padding: 10px; font: inherit; }
.settings-grid input[type=range] { accent-color: var(--yellow); }
.settings-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* RESULT / GAMEOVER */
.result-panel { width: min(680px, 94vw); text-align: center; background: #12131a; }
.result-panel .kicker, .gameover-panel .kicker { justify-content: center; }
.result-panel h2 { color: var(--yellow); }
.stars { font-size: 42px; letter-spacing: 6px; color: var(--yellow); text-shadow: 0 0 24px rgba(255,196,46,.4); }
.result-mission { font-size: 10px; color: var(--muted); letter-spacing: .12em; margin-top: 4px; text-transform: uppercase; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.result-grid span { display: block; font-size: 8px; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.result-grid b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 30px; color: var(--cream); }
.result-grid b#resultReward { color: var(--yellow); }
.result-unlock { background: rgba(46,230,200,.1); border: 1px solid rgba(46,230,200,.35); padding: 10px; font-size: 10px; font-weight: 700; color: var(--teal); margin-bottom: 15px; }
.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gameover-panel h2 { color: var(--pink); line-height: .82; }
.gameover-panel p { color: var(--muted); font-size: 12px; margin: 0 0 22px; }

/* CREDITS / HELP */
.credits-panel, .help-panel { width: min(760px, 94vw); }
.credits-body { font-size: 11px; line-height: 1.65; color: #c9c3b6; }
.credits-body h3 { font-size: 9px; letter-spacing: .16em; color: var(--yellow); margin: 20px 0 6px; }
.credits-body ul { padding-left: 18px; margin: 0; }
.credits-body li { margin-bottom: 7px; }
.credits-body li span { color: var(--muted); font-size: 9px; }
.credits-small { color: var(--muted); font-size: 9px; margin-top: 16px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.help-grid b { font-size: 9px; letter-spacing: .14em; color: var(--yellow); }
.help-grid p { font-size: 11px; line-height: 1.6; color: #c9c3b6; margin: 6px 0 0; }
kbd { display: inline-block; border: 1px solid var(--line); background: #1c1d26; padding: 1px 5px; font-size: 9px; font-family: 'Inter'; color: var(--cream); }

/* INSTALL / ORIENTATION / OFFLINE */
.install-fab { position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 60; background: var(--teal); color: #071b18; font-weight: 900; font-size: 10px; letter-spacing: .12em; padding: 12px 16px; box-shadow: 4px 4px 0 rgba(0,0,0,.4); }
.rotate-hint { position: fixed; inset: 0; z-index: 200; background: #08090d; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 30px; }
.rotate-hint span { font-size: 54px; color: var(--yellow); }
.rotate-hint b { font-family: 'Anton', Impact, 'Arial Narrow', sans-serif; font-size: 32px; }
.rotate-hint small { color: var(--muted); font-size: 11px; max-width: 280px; line-height: 1.5; }
.offline-badge { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 70; font-size: 8px; font-weight: 900; letter-spacing: .12em; background: var(--ink2); border: 1px solid var(--teal); color: var(--teal); padding: 4px 10px; }

/* RESPONSIVE */
@media (max-width: 980px) {
  .menu-main { grid-template-columns: 1fr; align-items: center; padding-top: 3vh; }
  .menu-card { display: none; }
  .menu-copy { align-self: center; padding-bottom: 2vh; }
  .game-title { font-size: clamp(64px, 15vw, 120px); }
  .menu-screen { background: linear-gradient(90deg, rgba(7,8,12,.96), rgba(7,8,12,.55)), linear-gradient(0deg, rgba(7,8,12,.95), transparent 45%); }
  .map-wrap { grid-template-columns: 1fr; overflow: auto; }
  .map-panel { min-height: 360px; }
  .map-canvas { min-height: 46vh; }
  .objective-panel { max-width: 34vw; min-width: 200px; }
}
@media (max-width: 720px) {
  .menu-screen { padding: calc(12px + var(--safe-t)) 18px calc(12px + var(--safe-b)); }
  .menu-top .money-pill { font-size: 11px; }
  .mini-brand span:last-child { font-size: 9px; }
  .game-title { font-size: clamp(68px, 21vw, 104px); }
  .game-title .four { right: 0; }
  .tagline { margin: 18px 0 22px; font-size: 12px; }
  .main-btn { padding: 12px 14px; }
  .main-btn .mb-label { font-size: 22px; }
  .main-btn .mb-sub { display: none; }
  .menu-bottom { gap: 10px; flex-wrap: wrap; }
  .menu-disclaimer { display: none; }
  .map-head h2, .shop-head h2 { font-size: 34px; }
  .map-head, .shop-head { flex-direction: column; }
  .map-panel { padding: 15px; }
  .briefing-card { padding: 20px 18px; }
  .briefing-body { grid-template-columns: 1fr; gap: 12px; }
  .briefing-objective { border-right: 0; border-bottom: 1px solid rgba(23,21,15,.14); padding: 0 0 12px; }
  .briefing-head h2 { font-size: 38px; }
  .mission-badge { width: 62px; height: 62px; }
  .mission-badge b { font-size: 28px; }
  .hud-top { gap: 6px; }
  .player-panel { min-width: 0; width: 48vw; padding: 6px; gap: 6px; border-left-width: 2px; }
  .portrait { width: 34px; height: 34px; font-size: 18px; border-width: 1px; }
  .player-name-row b { font-size: 8px; }
  #hudModeBadge { display: none; }
  .bar { height: 7px; }
  .bar span { display: none; }
  .objective-panel { min-width: 0; max-width: 35vw; padding: 5px 8px; }
  #objectiveText { font-size: 14px; }
  .obj-top .kicker { font-size: 6px; }
  #hudDistrict { display: none; }
  .hud-right { flex-direction: column; align-items: flex-end; gap: 4px; }
  .enemy-pill { display: none; }
  .money-pill { padding: 5px 8px 5px 5px; font-size: 11px; }
  .coin { width: 17px; height: 17px; font-size: 10px; }
  .pause-btn { width: 36px; height: 36px; font-size: 14px; }
  .combo-box { top: 16%; right: 4%; }
  #comboNum { font-size: 54px; }
  .boss-box { bottom: calc(110px + var(--safe-b)); width: 90vw; padding: 6px 8px; }
  .boss-head b { font-size: 17px; }
  .buffs { bottom: calc(200px + var(--safe-b)); left: auto; right: 16px; transform: none; }
  .desktop-hints { display: none; }
  .subtitle { bottom: calc(210px + var(--safe-b)); max-width: 90vw; }
  .toasts { top: 76px; right: 10px; }
  .toast { font-size: 9px; max-width: 240px; }
  .overlay-panel { padding: 20px 18px; max-height: 92vh; }
  .overlay-panel h2 { font-size: 46px; }
  .result-grid { grid-template-columns: 1fr 1fr 1fr; }
  .result-grid b { font-size: 24px; }
  .shop-grid { grid-template-columns: 1fr 1fr; }
  .shop-card { min-height: 170px; padding: 11px; }
  .shop-card h3 { font-size: 18px; }
  .help-grid { grid-template-columns: 1fr; }
  .settings-actions { flex-direction: column; }
  .install-fab { bottom: calc(12px + var(--safe-b)); right: 12px; }
  .map-canvas { min-height: 44vh; }
  .dnode { width: 105px; }
  .dnode .pin { width: 28px; height: 28px; font-size: 13px; }
  .dnode .dn-name { font-size: 8px; }
  .dnode .dn-prog { display: none; }
  .map-legend { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .game-title { font-size: clamp(54px, 12vh, 96px); }
  .tagline { margin: 10px 0 14px; }
  .menu-main { padding-top: 0; }
  .menu-copy { padding-bottom: 0; }
  .menu-foot { margin-top: 12px; }
  .menu-bottom { display: none; }
  .briefing-card { max-height: 94vh; overflow: auto; }
  .dialogue { max-height: 120px; }
  .overlay-panel { max-height: 94vh; }
  .hud { padding-top: calc(6px + var(--safe-t)); }
  .joystick { width: 96px; height: 96px; }
  .action-pad { transform: scale(.86); transform-origin: bottom right; }
}
body.touch .desktop-hints { display: none; }
body.touch .mobile-controls { display: block; }
body.touch .menu-card { display: none; }
body.touch .menu-screen { background: linear-gradient(90deg, rgba(7,8,12,.97), rgba(7,8,12,.62)), linear-gradient(0deg, rgba(7,8,12,.95), transparent 40%); }

/* --- MOBILE HUD FIXES --- */
@media (max-width: 720px) {
  #installBtn { display: none !important; }
  #btnMenuCredits { display: none !important; }
  .menu-top .mini-brand span:last-child { display: none; }
  .menu-top-right { gap: 6px; }
  #btnInstallMenu { font-size: 8px; padding: 7px 8px; letter-spacing: .06em; }
  .menu-top .money-pill { font-size: 10px; padding: 5px 8px 5px 5px; }
  .hud-top { position: relative; }
  .player-panel { width: calc(100% - 92px); min-width: 0; }
  .hud-right { position: absolute; top: 0; right: 0; }
  .objective-panel { position: absolute; top: 57px; left: 0; right: 0; max-width: none; min-width: 0; width: auto; padding: 6px 10px 7px; }
  #objectiveText { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .objective-timer { top: 38px; }
  .combo-box { top: 172px; right: 10px; }
  #comboNum { font-size: 54px; }
  .toasts { top: 146px; right: 8px; }
  .subtitle { bottom: calc(224px + var(--safe-b)); max-width: 94vw; }
  .buffs { bottom: calc(220px + var(--safe-b)); right: 10px; }
  .boss-box { bottom: calc(116px + var(--safe-b)); width: 94vw; }
  .joystick { width: 104px; height: 104px; left: calc(12px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); }
  .joy-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .action-pad {
    display: grid; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(2, 62px);
    gap: 6px; width: auto; height: auto;
    right: calc(10px + var(--safe-r)); bottom: calc(14px + var(--safe-b));
  }
  .action-btn { position: relative; right: auto !important; bottom: auto !important; width: 62px; height: 62px; }
  .action-btn.light { grid-column: 2 / 4; grid-row: 2; width: auto; height: 62px; border-radius: 34px; }
  .action-btn.light span { font-size: 25px; }
  .action-btn.heavy { grid-column: 1; grid-row: 2; }
  .action-btn.jump { grid-column: 3; grid-row: 1; }
  .action-btn.dodge { grid-column: 2; grid-row: 1; }
  .action-btn.rage { grid-column: 1; grid-row: 1; }
  .action-btn span { font-size: 20px; }
  .action-btn small { font-size: 6px; }
}
@media (max-width: 420px) {
  .game-title { font-size: clamp(58px, 20vw, 92px); }
  .tagline { font-size: 11px; }
  .menu-nav .main-btn .mb-label { font-size: 21px; }
  .hud { padding-left: 8px; padding-right: 8px; }
  .player-panel { width: calc(100% - 84px); padding: 5px 7px 5px 5px; }
  .portrait { width: 30px; height: 30px; font-size: 16px; }
  .objective-panel { top: 53px; }
  .objective-panel .obj-top { display: none; }
  #objectiveText { font-size: 14px; }
  .combo-box { top: 160px; }
  .action-pad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); }
  .action-btn { width: 58px; height: 58px; }
  .action-btn.light { height: 58px; }
  .joystick { width: 96px; height: 96px; }
}

/* --- TOUCH HUD (qualsiasi orientamento) --- */
body.touch #installBtn { display: none !important; }
body.touch .hud-top { position: relative; }
body.touch .player-panel { width: calc(100% - 102px); min-width: 0; }
body.touch .hud-right { position: absolute; top: 0; right: 0; }
body.touch .objective-panel { position: absolute; top: 57px; left: 0; right: 0; max-width: none; min-width: 0; width: auto; padding: 6px 10px 7px; }
body.touch #objectiveText { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch .combo-box { top: 168px; right: 10px; }
body.touch .toasts { top: 144px; right: 8px; }
body.touch .subtitle { bottom: calc(224px + var(--safe-b)); max-width: 94vw; }
body.touch .buffs { bottom: calc(218px + var(--safe-b)); right: 10px; }
body.touch .boss-box { bottom: calc(114px + var(--safe-b)); width: 94vw; }
body.touch .joystick { width: 108px; height: 108px; left: calc(12px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); }
body.touch .joy-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
body.touch .action-pad {
  display: grid; grid-template-columns: repeat(3, 66px); grid-template-rows: repeat(2, 66px);
  gap: 6px; width: auto; height: auto;
  right: calc(12px + var(--safe-r)); bottom: calc(16px + var(--safe-b));
}
body.touch .action-btn { position: relative; right: auto !important; bottom: auto !important; width: 66px; height: 66px; }
body.touch .action-btn.light { grid-column: 2 / 4; grid-row: 2; width: auto; height: 66px; border-radius: 36px; }
body.touch .action-btn.heavy { grid-column: 1; grid-row: 2; }
body.touch .action-btn.jump { grid-column: 3; grid-row: 1; }
body.touch .action-btn.dodge { grid-column: 2; grid-row: 1; }
body.touch .action-btn.rage { grid-column: 1; grid-row: 1; }
body.touch .action-btn small { font-size: 6px; }
@media (max-height: 560px) and (orientation: landscape) {
  body.touch .action-pad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); bottom: calc(8px + var(--safe-b)); }
  body.touch .action-btn { width: 58px; height: 58px; }
  body.touch .action-btn.light { height: 58px; }
  body.touch .joystick { width: 92px; height: 92px; bottom: calc(10px + var(--safe-b)); }
  body.touch .objective-panel { top: 50px; }
  body.touch .combo-box { top: 130px; }
  body.touch .subtitle { bottom: 180px; }
  body.touch .buffs { bottom: 175px; }
  body.touch .boss-box { bottom: 92px; }
}

/* install FAB solo nel menu */
#installBtn { display: none !important; }
#menu:not(.hidden) ~ #installBtn:not(.hidden) { display: block !important; }

/* --- LANDSCAPE PHONE --- */
body.touch .player-panel { width: min(380px, calc(100% - 102px)); }
body.touch .enemy-pill { display: none; }
@media (max-height: 560px) and (orientation: landscape) {
  .menu-screen { padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  .menu-top { position: absolute; top: calc(8px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); }
  .menu-main { display: block; padding-top: 0; }
  .menu-copy { padding: 0; display: flex; flex-direction: column; }
  .menu-copy .kicker, .menu-copy .tagline, .menu-foot, .menu-bottom { display: none; }
  .game-title { font-size: clamp(36px, 10vh, 64px); margin: 44px 0 0; line-height: .78; }
  .game-title .four { font-size: .86em; right: 1%; bottom: -2%; }
  .menu-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; max-width: 620px; margin-top: 8px; }
  .main-btn { padding: 7px 10px; gap: 8px; }
  .main-btn .mb-index { width: 14px; font-size: 8px; }
  .main-btn .mb-label { font-size: 17px; }
  .main-btn .mb-sub { display: none; }
  .menu-nav .main-btn.small { grid-column: span 1; }
  .menu-card { display: none; }
  .menu-top .mini-brand span:last-child { display: none; }
  .menu-top-right { gap: 6px; }
  .menu-top .money-pill { font-size: 10px; padding: 5px 8px 5px 5px; }
  #btnInstallMenu { font-size: 8px; padding: 7px 8px; }
}

body.touch #installBtn { display: none !important; }
