@font-face { font-family: "Lilita One"; src: url(../assets/fonts/LilitaOne.ttf) format("truetype"); font-display: block; }
@font-face { font-family: "Nunito"; font-weight: 800; src: url(../assets/fonts/Nunito-800.ttf) format("truetype"); font-display: block; }
:root {
  --ink: #0e1230; --navy: #1c2a8a; --navy2: #121a5c; --txt: #fff; --mut: #b9c3ff;
  --gold: #ffc72c; --gold2: #f09a00; --green: #3fdc5c; --red: #ff4d5a; --blue: #3b9dff; --purple: #b05cff;
  --font: "Lilita One", "Arial Black", Impact, sans-serif; --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--txt); font-family: var(--body); font-weight: 800; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; padding: 0; background: none; }
button:disabled { cursor: default; }
img, canvas { -webkit-user-drag: none; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.screen { position: fixed; inset: 0; display: none; overflow: hidden; }
.screen.active { display: block; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }

/* testo "brawl": Lilita One con contorno scuro spesso */
.fz, h1, h2, h3, .btn, .chip b, .play-btn, .dname, .ribbon, .lvl-badge, .cname, .tag, .stat b { font-family: var(--font); font-weight: 400; letter-spacing: .4px; }
.st { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.btn, .play-btn, .dname, .ribbon, .chip b, h1, h2, .cname, .stat b, .lvl-badge { -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); }

/* ───── sfondo animato ───── */
.bgfx { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 55%, #5a3fe0 0%, #2a249e 38%, #14165e 70%, #0a0c33 100%); }
.bgfx .rays { position: absolute; left: 50%; top: 58%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.085) 0 7deg, transparent 7deg 18deg); animation: spin 120s linear infinite; mask-image: radial-gradient(circle, #000 4%, transparent 55%); -webkit-mask-image: radial-gradient(circle, #000 4%, transparent 55%); }
.bgfx .grid { position: absolute; inset: -80px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 36px, transparent 36px 72px); animation: slide 14s linear infinite; }
.bgfx .dots { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.9) 0 2px, transparent 3px), radial-gradient(circle, rgba(140,220,255,.8) 0 3px, transparent 4px), radial-gradient(circle, rgba(255,210,120,.8) 0 2px, transparent 3px); background-size: 210px 260px, 330px 310px, 270px 340px; background-position: 0 0, 90px 120px, 160px 60px; animation: rise 18s linear infinite; opacity: .55; }
.bgfx.shop { background: radial-gradient(ellipse at 50% 40%, #c44bd8 0%, #6a2bb8 38%, #261672 70%, #0a0c33 100%); }
.bgfx.dark { background: radial-gradient(ellipse at 50% 50%, #2e3bc4 0%, #1a1f80 42%, #0b0e3d 100%); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { to { transform: translate(72px, 72px); } }
@keyframes rise { to { background-position: 0 -260px, 90px -190px, 160px -280px; } }

/* ───── Loading ───── */
#loading { position: fixed; inset: 0; z-index: 99; background: radial-gradient(circle at 50% 40%, #5a3fe0, #0a0c33 72%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .logo { font-family: var(--font); font-size: clamp(46px, 11vw, 110px); color: var(--gold); -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink), 0 0 50px #ffc72c88; letter-spacing: 4px; animation: logo 2s ease-in-out infinite; }
@keyframes logo { 50% { transform: scale(1.04) rotate(-1deg); } }
.lbar { width: min(60vw, 380px); height: 22px; border-radius: 14px; background: var(--ink); overflow: hidden; border: 4px solid var(--ink); box-shadow: 0 0 0 3px #fff3; }
.lbar i { display: block; height: 100%; width: 0; background: linear-gradient(#fff08a, var(--gold2)); transition: width .15s; }

/* ───── componenti ───── */
.btn { --c1: #ffe36a; --c2: #f5a300; --lip: #a85a00; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .35em; padding: .55em 1.1em; border-radius: 16px; font-size: clamp(18px, 3vh, 26px); color: #fff; background: linear-gradient(var(--c1), var(--c2)); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--lip), 0 6px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.6), inset 0 -5px 0 rgba(0,0,0,.16); margin-bottom: 8px; transition: transform .07s, filter .15s; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--lip), 0 1px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.6), inset 0 -5px 0 rgba(0,0,0,.16); }
.btn:disabled { filter: grayscale(.85) brightness(.7); }
.btn .ico { font-size: 1.15em; }
.btn.g { --c1: #8dff7a; --c2: #20b83e; --lip: #0f6a22; }
.btn.b { --c1: #7cc4ff; --c2: #2468e0; --lip: #123a8a; }
.btn.r { --c1: #ff8a8a; --c2: #e0223e; --lip: #8a0f22; }
.btn.p { --c1: #e0a8ff; --c2: #8a3ce0; --lip: #4a1a8a; }
.btn.k { --c1: #8a93c8; --c2: #4a5399; --lip: #242b66; }
.btn.big { font-size: clamp(22px, 4.4vh, 38px); padding: .5em 1.4em; }
.btn.glow { animation: btnglow 1.4s ease-in-out infinite; }
@keyframes btnglow { 50% { filter: brightness(1.18) drop-shadow(0 0 14px #ffe36a); } }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 8px; border-radius: 24px; background: var(--ink); border: 4px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 4px 0 rgba(0,0,0,.3); font-size: clamp(16px, 2.8vh, 24px); }
.chip .ico { font-size: 1.5em; }
.chip b { font-size: 1.05em; -webkit-text-stroke: 3px #000; }
.sqbtn { width: clamp(44px, 7vh, 56px); height: clamp(44px, 7vh, 56px); border-radius: 15px; background: linear-gradient(#8a93c8, #4a5399); border: 4px solid var(--ink); box-shadow: 0 5px 0 #242b66, 0 5px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.5); font-size: clamp(22px, 3.6vh, 30px); display: grid; place-items: center; margin-bottom: 6px; }
.sqbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #242b66, 0 1px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.5); }
.sqbtn.y { background: linear-gradient(#ffe36a, #f5a300); box-shadow: 0 5px 0 #a85a00, 0 5px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.6); }
.pbar { position: relative; height: clamp(22px, 3.6vh, 30px); border-radius: 16px; background: var(--ink); border: 4px solid var(--ink); box-shadow: 0 0 0 2px rgba(255,255,255,.2); overflow: hidden; }
.pbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 12px; background: linear-gradient(#a8f4ff, #25b8e8 60%, #1a86c8); box-shadow: inset 0 3px 0 rgba(255,255,255,.55); transition: width .3s; }
.pbar.gold i { background: linear-gradient(#fff08a, #f5a300); } .pbar.green i { background: linear-gradient(#b6ff9a, #27b84a); }
.pbar b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font); font-weight: 400; font-size: clamp(13px, 2.2vh, 19px); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.panel { background: linear-gradient(#2f3fb8, #1c2685); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 7px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.22), inset 0 0 0 2px rgba(255,255,255,.06); }

/* ───── barra alta ───── */
.topbar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l)); z-index: 5; }
.profile { display: flex; align-items: center; gap: 10px; padding: 4px 18px 4px 4px; border-radius: 40px; background: var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 4px 0 rgba(0,0,0,.3); }
.avatar { position: relative; width: clamp(44px, 8vh, 62px); aspect-ratio: 1; flex: none; }
.avatar img { width: 100%; height: 100%; }
.avatar .lv { position: absolute; right: -8px; bottom: -6px; width: 1.9em; height: 1.9em; display: grid; place-items: center; font-size: clamp(13px, 2.2vh, 17px); font-family: var(--font); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.avatar .lv .ico { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; } .avatar .lv span { position: relative; margin-top: 2px; }
.pinfo { display: flex; flex-direction: column; gap: 4px; }
.pname { font-family: var(--font); font-weight: 400; font-size: clamp(16px, 2.8vh, 22px); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.xpbar { width: clamp(80px, 14vw, 150px); height: 10px; border-radius: 6px; background: #000a; overflow: hidden; border: 2px solid #ffffff30; }
.xpbar i { display: block; height: 100%; background: linear-gradient(#b8ff9a, #27b84a); }

/* ───── HOME ───── */
.stage { position: absolute; left: 50%; top: 9vh; bottom: 24vh; width: min(52vw, 640px); transform: translateX(-50%); }
.stage .aura { position: absolute; left: 50%; bottom: 0; width: 86%; aspect-ratio: 1; transform: translate(-50%, 36%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 75%, #fff) 0%, color-mix(in srgb, var(--rc) 55%, transparent) 38%, transparent 66%); filter: blur(6px); opacity: .75; }
.stage .disc { position: absolute; left: 50%; bottom: -1%; width: 64%; height: 9%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--rc) 55%, #fff) 0%, var(--rc) 48%, transparent 72%); border: 0; box-shadow: 0 0 40px var(--rc); }
.hero-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; filter: drop-shadow(0 10px 16px rgba(0,0,0,.45)); }
.hero-cv.dim { filter: grayscale(1) brightness(.5) drop-shadow(0 10px 16px rgba(0,0,0,.45)); }
.dock { position: absolute; left: 50%; bottom: calc(1.6vh + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 3; }
.modesel { display: flex; align-items: center; gap: 8px; }
.modesel .arr { width: 44px; height: 44px; padding: 0; }
.modesel .arr .ico { font-size: 22px; } .flip .ico { transform: scaleX(-1); }
.modebtn { display: flex; align-items: center; gap: 12px; min-width: min(46vw, 300px); padding: 6px 22px 6px 8px; border-radius: 26px; background: linear-gradient(#3a4ad2, #1c2685); border: 4px solid var(--ink); box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 3px 0 rgba(255,255,255,.3); text-align: left; }
.modebtn:active { transform: translateY(3px); }
.modebtn .mi { width: clamp(42px, 7vh, 56px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--mc, #3b9dff); border: 4px solid var(--ink); display: grid; place-items: center; font-size: clamp(24px, 4vh, 32px); }
.modebtn b { display: block; font-family: var(--font); font-weight: 400; font-size: clamp(18px, 3.2vh, 26px); line-height: 1; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.modebtn small { color: var(--mut); font-size: clamp(11px, 1.8vh, 14px); }
.play-btn { padding: .22em 2.1em .3em; border-radius: 22px; font-size: clamp(34px, 7.4vh, 62px); color: #fff; background: linear-gradient(#ffec7a, #ffb000 55%, #ff9000); border: 5px solid var(--ink); box-shadow: 0 9px 0 #a85a00, 0 9px 0 5px var(--ink), inset 0 4px 0 rgba(255,255,255,.7), inset 0 -6px 0 rgba(0,0,0,.16), 0 0 50px #ffc72c88; -webkit-text-stroke: 5px var(--ink); animation: pulse 1.8s ease-in-out infinite; margin-bottom: 9px; letter-spacing: 3px; }
.play-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #a85a00, 0 2px 0 5px var(--ink), inset 0 4px 0 rgba(255,255,255,.7); }
@keyframes pulse { 50% { transform: scale(1.035); } }
.side-btn { position: absolute; top: 46%; transform: translateY(-50%); width: clamp(92px, 17vh, 140px); padding: 12px 6px 10px; border-radius: 22px; background: linear-gradient(#4a5af0, #2332b0); border: 4px solid var(--ink); box-shadow: 0 7px 0 #121a6a, 0 7px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.4); font-size: clamp(14px, 2.4vh, 21px); display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font-family: var(--font); font-weight: 400; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.side-btn .ico { font-size: clamp(38px, 8vh, 66px); }
.side-btn.left { left: calc(2.5vw + var(--safe-l)); } .side-btn.right { right: calc(2.5vw + var(--safe-r)); }
.side-btn:active { transform: translateY(calc(-50% + 5px)); box-shadow: 0 2px 0 #121a6a, 0 2px 0 4px var(--ink), inset 0 3px 0 rgba(255,255,255,.4); }
.side-btn .badge { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 26px; animation: bob .8s ease-in-out infinite; }

/* ───── sub-schermate ───── */
.sub-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 14px; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l)); z-index: 5; }
.sub-top h2 { margin: 0; font-size: clamp(26px, 5vh, 42px); } .sub-top h2 small { color: var(--mut); font-size: .55em; margin-left: 8px; font-family: var(--font); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.filters button { padding: 4px 14px 5px; border-radius: 16px; background: var(--ink); border: 3px solid var(--rc, #ffffff40); font-family: var(--font); font-weight: 400; font-size: clamp(13px, 2.2vh, 17px); color: var(--rc, #fff); }
.filters button.on { background: var(--rc, #fff); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.grid { position: absolute; left: 0; right: 0; top: calc(76px + var(--safe-t)); bottom: 0; overflow-y: auto; padding: 14px calc(18px + var(--safe-r)) 34px calc(18px + var(--safe-l)); display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 15vw, 190px), 1fr)); gap: 18px; align-content: start; }
.card { position: relative; border-radius: 20px; border: 5px solid var(--ink); background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--rc) 55%, #fff) 0%, var(--rc) 40%, color-mix(in srgb, var(--rc) 55%, #000) 100%); box-shadow: 0 6px 0 rgba(0,0,0,.4), inset 0 0 0 3px color-mix(in srgb, var(--rc) 40%, #fff), inset 0 4px 0 3px rgba(255,255,255,.35); overflow: hidden; cursor: pointer; transition: transform .12s; height: 0; padding-bottom: 138%; }
.card::before { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 38%, rgba(255,255,255,.16) 0 8deg, transparent 8deg 20deg); }
.card:active { transform: scale(.96); } .card:hover { transform: translateY(-3px); }
.card > img.hero { position: absolute; left: 0; top: 4%; width: 100%; height: 82%; object-fit: cover; object-position: 50% 6%; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.card.locked > img.hero { filter: grayscale(1) brightness(.45); } .card.locked { background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--rc) 28%, #6a7090), color-mix(in srgb, var(--rc) 18%, #1c2040) 80%); }
.card.sel { box-shadow: 0 6px 0 rgba(0,0,0,.4), 0 0 0 4px #fff, 0 0 30px 6px var(--rc), inset 0 4px 0 3px rgba(255,255,255,.35); }
.card .cname { position: absolute; left: 0; right: 0; bottom: 30px; padding: 22px 4px 3px; text-align: center; font-size: clamp(17px, 1.9vw, 23px); line-height: 1; background: linear-gradient(transparent, rgba(8,10,40,.85) 55%); }
.card.locked .cname { opacity: .6; }
.card .rolei { position: absolute; top: 7px; right: 7px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font-size: 19px; border: 2px solid #ffffff30; }
.card .lvbadge { position: absolute; top: 5px; left: 5px; width: 40px; height: 40px; display: grid; place-items: center; font-family: var(--font); font-size: 18px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.card .lvbadge .ico { position: absolute; inset: 0; width: 100%; height: 100%; } .card .lvbadge span { position: relative; margin-top: 3px; }
.card .lock { position: absolute; top: 6px; left: 7px; font-size: 32px; }
.card .up { position: absolute; bottom: 36px; right: 5px; font-size: 30px; animation: bob .8s ease-in-out infinite; z-index: 2; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.souls { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 22px; }
.souls .pbar { height: 20px; border-width: 3px; } .souls .pbar b { font-size: 12px; -webkit-text-stroke: 2.5px var(--ink); }
.souls img { position: absolute; left: -7px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; z-index: 2; }
.souls .pbar { margin-left: 18px; }

/* ───── Modal ───── */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(6,8,34,.82); display: flex; align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(3px); }
.modal-box { background: linear-gradient(#2f3fb8, #1c2685); border: 5px solid var(--ink); border-radius: 26px; box-shadow: 0 9px 0 rgba(0,0,0,.4), inset 0 3px 0 rgba(255,255,255,.25); padding: 22px; max-height: 94vh; overflow-y: auto; width: min(960px, 100%); text-align: center; animation: pop .22s cubic-bezier(.3,1.4,.6,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal-box h2, .modal-box h1 { margin: 0 0 14px; font-size: clamp(28px, 5vh, 44px); color: var(--gold); -webkit-text-stroke: 5px var(--ink); }
.modal-box h3 { margin: 14px 0 10px; color: var(--mut); font-size: 22px; }
.mode-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mode-card { --mc: #3b9dff; background: linear-gradient(#1a2275, #10165a); border: 4px solid var(--ink); border-radius: 20px; padding: 14px 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transition: transform .1s; box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 0 0 3px color-mix(in srgb, var(--mc) 50%, transparent); }
.mode-card:hover { transform: translateY(-4px); } .mode-card.on { box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 0 0 4px var(--gold), 0 0 24px #ffc72c88; }
.mode-card .mode-ico { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 35% 28%, #fff9, transparent 45%), var(--mc); display: grid; place-items: center; font-size: 46px; margin-bottom: 4px; }
.mode-card b { font-family: var(--font); font-weight: 400; font-size: 22px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; } .mode-card em { color: var(--gold); font-style: normal; font-size: 14px; }
.mode-card p { font-size: 13px; color: var(--mut); margin: 6px 0 8px; line-height: 1.35; flex: 1; }
.king-pick { display: flex; flex-direction: column; gap: 4px; width: 100%; } .king-pick .btn { font-size: 15px; padding: .35em .6em; margin-bottom: 6px; }
.result h1.win { color: var(--gold); } .result h1.lose { color: #ff8a9a; }
.rw-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.rw { background: var(--ink); border-radius: 18px; padding: 10px 20px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 110px; } .rw .ico { font-size: 38px; } .rw b { font-family: var(--font); font-weight: 400; font-size: 24px; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.levelup { margin: 14px auto 0; display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(#7cc4ff, #2468e0); border: 4px solid var(--ink); padding: 6px 22px; border-radius: 16px; font-family: var(--font); font-size: 26px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: pulse 1s infinite; }
.drops, .tiles { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.drop, .tile { position: relative; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 60%, #fff), var(--rc) 55%, color-mix(in srgb, var(--rc) 50%, #000)); border: 4px solid var(--ink); border-radius: 18px; padding: 12px 14px 8px; width: 128px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.drop img, .tile img { width: 76px; height: 76px; } .drop b, .tile b { font-family: var(--font); font-weight: 400; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; } .drop span, .tile span { font-size: 13px; }
.drop em, .tile em { position: absolute; top: -10px; right: -8px; background: var(--red); border: 3px solid var(--ink); font-style: normal; font-family: var(--font); font-size: 13px; padding: 1px 10px; border-radius: 12px; transform: rotate(8deg); }
.tile { opacity: 0; animation: tilein .45s ease-out forwards; } @keyframes tilein { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.dev { display: grid; gap: 8px; } .art-stat { color: var(--mut); margin: 0 0 10px; }
.audio-rows { display: grid; gap: 18px; margin: 8px 0 18px; text-align: left; min-width: min(380px, 80vw); }
.audio-rows label { display: flex; align-items: center; gap: 12px; font-family: var(--font); font-weight: 400; font-size: 22px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; } .audio-rows label .ico { font-size: 38px; }
.audio-rows input[type=range] { flex: 1; accent-color: var(--gold2); height: 30px; }

/* ───── scheda personaggio ───── */
#screen-detail .dgrid { position: absolute; left: 0; right: 0; top: calc(78px + var(--safe-t)); bottom: 0; display: grid; grid-template-columns: minmax(200px, 27%) 1fr minmax(240px, 34%); gap: 18px; padding: 0 calc(22px + var(--safe-r)) calc(14px + var(--safe-b)) calc(22px + var(--safe-l)); }
.d-left { display: flex; flex-direction: column; gap: 12px; padding-top: 4vh; min-width: 0; }
.dname { margin: 0; font-size: clamp(40px, 9vh, 84px); line-height: .95; -webkit-text-stroke: 7px var(--ink); text-shadow: 0 6px 0 var(--ink); color: #fff; word-break: break-word; }
.ribbon { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 22px 6px 14px; font-size: clamp(18px, 3.4vh, 28px); background: linear-gradient(color-mix(in srgb, var(--rc) 60%, #fff), var(--rc) 60%, color-mix(in srgb, var(--rc) 75%, #000)); border: 4px solid var(--ink); border-radius: 12px 26px 26px 12px; box-shadow: 0 5px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.5); }
.rolepill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 3px 18px 4px 8px; border-radius: 22px; background: var(--ink); font-family: var(--font); font-size: clamp(16px, 3vh, 24px); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); } .rolepill .ico { font-size: 1.6em; }
.descp { padding: 12px 16px; border-radius: 16px; background: rgba(8,10,48,.7); border: 3px solid rgba(255,255,255,.14); }
.descp h4 { margin: 0 0 4px; font-family: var(--font); font-weight: 400; font-size: clamp(16px, 2.6vh, 22px); color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.descp p { margin: 0; color: #dde2ff; font-size: clamp(13px, 2.1vh, 17px); line-height: 1.4; }
.d-mid { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.d-stage { position: relative; flex: 1; width: 100%; min-height: 0; }
.d-stage::before { content: ""; position: absolute; left: 50%; bottom: 3%; width: min(120%, 90vh); aspect-ratio: 1; transform: translate(-50%, 36%); border-radius: 50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 70%, #fff) 0 6deg, transparent 6deg 16deg); opacity: .32; mask-image: radial-gradient(circle, #000 10%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 62%); animation: spin 90s linear infinite; }
.d-stage .aura { position: absolute; left: 50%; bottom: 8%; width: min(105%, 80vh); aspect-ratio: 1; transform: translate(-50%, 30%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 85%, #fff) 0%, color-mix(in srgb, var(--rc) 65%, transparent) 36%, transparent 66%); opacity: .9; }
.d-stage .disc { position: absolute; left: 50%; bottom: 2%; width: 60%; height: 7%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--rc) 55%, #fff) 0%, var(--rc) 48%, transparent 72%); box-shadow: 0 0 40px var(--rc); }
.d-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding-top: 6px; z-index: 2; }
.d-actions .btn { min-width: 0; width: 100%; padding-left: 10px; padding-right: 10px; font-size: clamp(18px, 3.6vh, 26px); white-space: nowrap; }
.arow { display: flex; gap: 10px; width: 100%; align-items: flex-start; justify-content: center; } .acol { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: stretch; gap: 2px; } .acol .btn { margin-bottom: 4px; }
.soulrow { display: flex; align-items: center; gap: 0; width: 100%; padding-left: 10px; }
.soulrow img { width: clamp(40px, 7vh, 54px); height: clamp(40px, 7vh, 54px); margin-right: -14px; position: relative; z-index: 2; } .soulrow .pbar { flex: 1; }
.d-right { display: flex; flex-direction: column; gap: 10px; padding-top: 2vh; min-width: 0; overflow-y: auto; }
.d-right h3 { margin: 0; font-size: clamp(20px, 3.4vh, 28px); color: var(--gold); -webkit-text-stroke: 4px var(--ink); } .d-right h3 small { color: var(--mut); font-size: .7em; }
.atk-row { --c: #fff; position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 16px; background: linear-gradient(rgba(14,18,70,.9), rgba(10,14,56,.9)); border: 4px solid var(--ink); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent), 0 4px 0 rgba(0,0,0,.3); }
.atk-row .ai { flex: none; width: clamp(40px, 6.6vh, 54px); aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 35% 28%, #fff9, transparent 45%), var(--c); display: grid; place-items: center; font-size: clamp(22px, 3.6vh, 30px); }
.a-main { flex: 1; min-width: 0; } .a-main b { display: block; font-family: var(--font); font-weight: 400; font-size: clamp(15px, 2.6vh, 20px); color: var(--c); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; line-height: 1.05; } .a-main small { color: #cdd4ff; font-size: clamp(11px, 1.8vh, 14px); line-height: 1.25; display: block; margin-top: 2px; }
.a-mana { display: flex; align-items: center; gap: 2px; font-family: var(--font); font-size: clamp(16px, 2.6vh, 22px); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; } .a-mana .ico { font-size: 1.3em; }
.statbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.stat { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 6px; border-radius: 16px; background: var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,.16); } .stat .ico { font-size: clamp(26px, 4.4vh, 38px); } .stat b { font-size: clamp(20px, 3.6vh, 30px); -webkit-text-stroke: 3px #000; }
.locked-note { text-align: center; color: var(--mut); font-size: 14px; }

/* ───── shop ───── */
.shop-body { position: absolute; left: 0; right: 0; top: calc(80px + var(--safe-t)); bottom: 0; overflow-y: auto; padding: 14px calc(18px + var(--safe-r)) 30px calc(18px + var(--safe-l)); display: grid; gap: 16px; align-content: start; max-width: 940px; margin: 0 auto; }
.banner, .soon { padding: 20px; text-align: center; } .banner { background: linear-gradient(#8b3bd8, #4a1fa0); border: 5px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.3); }
.banner h3 { margin: 0 0 6px; font-size: clamp(30px, 5.4vh, 46px); color: var(--gold); -webkit-text-stroke: 6px var(--ink); } .banner p, .soon p { color: #e8dcff; margin: 4px 0 10px; }
.rates { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; } .rates span { background: var(--ink); border: 3px solid var(--rc); color: var(--rc); border-radius: 14px; padding: 2px 12px 3px; font-family: var(--font); font-size: 15px; }
.soon { opacity: .6; background: linear-gradient(#2f3fb8, #1c2685); border: 4px solid var(--ink); border-radius: 22px; } .soon h3 { margin: 0; }

/* toast + rotate */
#toast { position: fixed; left: 50%; bottom: 14vh; transform: translateX(-50%) translateY(20px); background: var(--ink); border: 4px solid #ffffff30; padding: 10px 26px; border-radius: 20px; z-index: 80; opacity: 0; transition: .25s; pointer-events: none; font-family: var(--font); font-weight: 400; font-size: 20px; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#rotate { position: fixed; inset: 0; z-index: 90; background: var(--ink); display: none; align-items: center; justify-content: center; text-align: center; font-family: var(--font); font-size: 26px; color: var(--gold); flex-direction: column; gap: 14px; }
#rotate .ico { font-size: 80px; animation: spin 3s linear infinite; }
@media (orientation: portrait) and (max-width: 700px) { body[data-screen="battle"] #rotate { display: flex; } }

/* ───── BATTAGLIA ───── */
#screen-battle { background: #000; touch-action: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--font); font-weight: 400; }
#hud button { pointer-events: auto; touch-action: none; }
.b-top { position: absolute; top: calc(8px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; align-items: flex-start; gap: 10px; }
.b-btn { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(#8a93c8, #4a5399); border: 4px solid var(--ink); box-shadow: 0 5px 0 #242b66, inset 0 3px 0 rgba(255,255,255,.45); color: #fff; display: grid; place-items: center; font-size: 28px; }
.b-btn.down, .b-atk.down { filter: brightness(1.4); transform: translateY(3px) scale(.95); }
.b-info { flex: 1; text-align: center; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.b-title { font-size: clamp(16px, 2.8vh, 24px); letter-spacing: 3px; color: var(--gold); }
.b-sub { font-size: clamp(18px, 3.2vh, 28px); display: flex; gap: 8px; align-items: center; justify-content: center; } .b-sub .ico { font-size: 1.1em; }
.b-bars { display: grid; gap: 4px; width: min(340px, 90%); margin: 4px auto 0; }
.zb { display: grid; grid-template-columns: 110px 1fr 40px; gap: 6px; align-items: center; font-size: 14px; } .zb span { text-align: right; display: flex; justify-content: flex-end; gap: 4px; align-items: center; } .zb div { height: 14px; background: var(--ink); border-radius: 8px; overflow: hidden; border: 3px solid var(--ink); } .zb i { display: block; height: 100%; } .zb em { font-style: normal; text-align: left; }
.b-feed { width: 210px; font-size: 15px; text-align: right; display: grid; gap: 3px; justify-items: end; }
.b-feed div { background: var(--ink); border-radius: 12px; padding: 1px 12px 3px; animation: tilein .25s; display: flex; gap: 6px; align-items: center; } .b-feed .ico { font-size: 1.1em; }
.b-banner { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-size: clamp(34px, 9vh, 82px); text-shadow: 0 6px 0 var(--ink), 0 0 36px currentColor; opacity: 0; transform: scale(.7); transition: .2s; letter-spacing: 3px; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.b-banner small { display: block; font-size: .34em; color: #fff; letter-spacing: 4px; -webkit-text-stroke: 4px var(--ink); }
.b-banner.show { opacity: 1; transform: scale(1); }
.b-bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); display: flex; align-items: flex-end; justify-content: space-between; }
.b-pad { display: none; gap: 14px; } .b-pad .b-btn { width: 80px; height: 80px; font-size: 40px; }
@media (pointer: coarse) { .b-pad { display: flex; } }
.b-mid { position: absolute; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); width: clamp(190px, 30vw, 440px); }
.b-mana { position: relative; height: 34px; border-radius: 18px; background: var(--ink); border: 4px solid var(--ink); box-shadow: 0 0 0 2px rgba(255,255,255,.22); overflow: hidden; }
.b-mana-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#f0a8ff, #b02cf0 55%, #8a14c8); transition: width .08s linear; box-shadow: inset 0 3px 0 rgba(255,255,255,.5); }
.b-mana-ticks { position: absolute; inset: 0; display: flex; } .b-mana-ticks i { flex: 1; border-right: 2px solid rgba(14,18,48,.7); } .b-mana-ticks i:last-child { border: 0; }
.b-mana-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; } .b-mana-num .mn { font-size: 15px; }
.b-mana-fill { overflow: hidden; background: linear-gradient(#e8c2ff, #a83cf0 55%, #6a1cc0) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.5), 0 0 12px rgba(170, 80, 255, .6); }
.b-mana-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.38) 50%, transparent 70%); background-size: 220% 100%; animation: mnshine 2.4s linear infinite; }
@keyframes mnshine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.b-mana-ticks i { border-right-color: rgba(30, 6, 70, .55) !important; }
.b-right { display: flex; align-items: flex-end; gap: 12px; margin-left: auto; }
.b-move { display: grid; gap: 8px; } .b-move .b-btn { width: 68px; height: 68px; position: relative; font-size: 36px; } .b-move small { position: absolute; bottom: 1px; font-size: 10px; opacity: .85; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.b-move .b-btn.off { opacity: .5; }
.b-move .b-btn { overflow: hidden; }
.b-move .m { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); font-size: 12px; line-height: 0; } .b-move small { bottom: auto !important; top: 3px; left: 5px; }
.b-move .b-btn .ico:first-child { margin-top: -12px; }
.b-move .cdov { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(14,18,48,.7); pointer-events: none; }
.b-acts { display: grid; grid-template-columns: repeat(3, auto); gap: 9px; direction: rtl; } .b-acts > * { direction: ltr; }
.b-atk { position: relative; width: 78px; height: 78px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.75) 0%, transparent 42%), radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 85%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000)); border: 5px solid var(--ink); box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 0 0 3px rgba(255,255,255,.35); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; transition: transform .06s, filter .12s; }
.b-atk .ai { font-size: 36px; margin-top: -4px; } .b-atk .n { display: none; }
/* simbolo del mana: cristallo viola con il numero bianco in grassetto al centro */
.mn { position: relative; display: inline-grid; place-items: center; line-height: 1; vertical-align: middle; }
.mn .ico { width: 1.7em; height: 1.7em; font-size: 1em !important; vertical-align: baseline; filter: drop-shadow(0 2px 2px rgba(20, 0, 60, .7)) drop-shadow(0 0 5px rgba(170, 90, 255, .65)); }
.mn b { position: absolute; inset: 0; display: grid; place-items: center; padding-top: .1em; color: #fff; font-weight: 900; font-size: .8em; letter-spacing: -.02em; -webkit-text-stroke: 2.6px #2a0a5a; paint-order: stroke fill; text-shadow: 0 1px 0 #2a0a5a; }
.b-atk .m { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); font-size: 13px; line-height: 0; }
.b-atk .ai { margin-top: -14px !important; }
.b-atk .k { position: absolute; top: 3px; left: 5px; font-size: 12px; opacity: .95; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.b-atk .cdov { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(14,18,48,.7); pointer-events: none; }
.b-atk.off { filter: grayscale(.85) brightness(.6); } .b-atk.ready { box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 0 0 3px rgba(255,255,255,.35), 0 0 20px var(--c); }
.b-acts .b-atk[data-a="a0"] { width: 92px; height: 92px; } .b-acts .b-atk[data-a="a0"] .ai { font-size: 44px; }
.b-pause-ov { position: absolute; inset: 0; background: rgba(6,8,34,.8); display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.b-pause-box { display: grid; gap: 14px; text-align: center; } .b-pause-box h2 { margin: 0 0 6px; font-size: 56px; color: var(--gold); -webkit-text-stroke: 7px var(--ink); }
.b-pause-ov.hidden { display: none; }
.b-pause-snd { display: flex; gap: 12px; justify-content: center; }
.b-pause-snd button { display: flex; align-items: center; gap: 8px; padding: 8px 18px 10px; border-radius: 16px; background: linear-gradient(#8a93c8, #4a5399); border: 4px solid var(--ink); box-shadow: 0 5px 0 #242b66; color: #fff; font-size: 20px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; } .b-pause-snd button .ico { font-size: 1.5em; }
.b-pause-snd button.off { opacity: .5; }

@media (max-width: 900px) {
  #screen-detail .dgrid { grid-template-columns: minmax(150px, 26%) 1fr minmax(180px, 36%); gap: 10px; }
  .atk-row .a-main small { display: none; }
}
@media (max-width: 820px), (max-height: 520px) {
  .mode-row { grid-template-columns: repeat(2, 1fr); }
  .b-mid { bottom: calc(100px + var(--safe-b)); width: clamp(160px, 30vw, 300px); }
  .b-atk { width: 62px; height: 62px; } .b-acts .b-atk[data-a="a0"] { width: 74px; height: 74px; } .b-atk .ai { font-size: 30px; }
  .b-move .b-btn { width: 56px; height: 56px; font-size: 30px; } .b-pad .b-btn { width: 68px; height: 68px; font-size: 34px; }
  .b-feed { width: 140px; font-size: 12px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  #screen-detail .dgrid { grid-template-columns: 1fr; grid-auto-rows: auto; overflow-y: auto; }
  .d-mid { min-height: 52vh; }
}
@media (pointer: fine) { .b-move small, .b-atk .k { display: block; } }
@media (pointer: coarse) { .b-atk .k, .b-move small { display: none; } }

/* ───── Profilo ───── */
.profile { cursor: pointer; transition: transform .1s; } .profile:hover { transform: translateY(-2px); }
#modal.profile .modal-box { width: min(880px, 100%); }
.phead { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; text-align: left; }
.avatar.big { width: clamp(70px, 14vh, 100px); }
.phead h2 { margin: 0 0 6px; }
.ptot { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: clamp(14px, 2.4vh, 18px); color: var(--mut); }
.ptot span { display: inline-flex; align-items: center; gap: 6px; } .ptot .ico { width: 1.5em; height: 1.5em; } .ptot b { font-family: var(--font); font-weight: 400; color: #fff; font-size: 1.25em; }
.plist { display: grid; gap: 10px; }
.prow { --mc: #3b9dff; display: grid; grid-template-columns: minmax(150px, 26%) 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: linear-gradient(#1a2275, #10165a); border: 4px solid var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.35), inset 0 0 0 3px color-mix(in srgb, var(--mc) 50%, transparent); text-align: left; }
.pmode { display: flex; align-items: center; gap: 10px; } .pmode b { display: block; font-family: var(--font); font-weight: 400; font-size: clamp(17px, 3vh, 24px); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; } .pmode small { color: var(--mut); font-size: 13px; }
.pmode .mi { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 35% 28%, #fff9, transparent 45%), var(--mc); display: grid; place-items: center; font-size: 28px; }
.pgrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pst { min-width: 84px; flex: 1 1 84px; max-width: 130px; padding: 6px 8px; border-radius: 12px; background: rgba(8,10,48,.7); display: flex; flex-direction: column; align-items: center; gap: 0; }
.pst .ico { width: 1.5em; height: 1.5em; font-size: 18px; } .pst b { font-family: var(--font); font-weight: 400; font-size: clamp(18px, 3.2vh, 24px); } .pst small { color: var(--mut); font-size: 12px; }
@media (max-width: 820px), (max-height: 520px) { .prow { grid-template-columns: 1fr; } .pgrid { justify-content: flex-start; } }
/* banner speciale "Azrael Arise" */
.azb { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 20px; align-items: center; padding: 16px; background: linear-gradient(#7a1018, #2a0508); border: 5px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(255,120,100,.3); }
.azb-img { width: 100%; height: auto; border-radius: 14px; display: block; box-shadow: 0 6px 0 rgba(0,0,0,.4); }
.azb-info { text-align: center; } .azb-info h3 { margin: 0 0 6px; font-size: clamp(28px, 5vh, 44px); color: #ff5a4a; -webkit-text-stroke: 6px var(--ink); } .azb-info p { color: #ffd9d4; margin: 4px 0 12px; }
.azb .btn-row { margin-top: 14px; }
@media (max-width: 560px) { .azb { grid-template-columns: 1fr; } .azb-img { max-width: 220px; margin: 0 auto; } }
.azb.x10 { background: linear-gradient(#0a6e3c, #052a1e); box-shadow: 0 8px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(120,255,170,.3); } .azb.x10 .azb-info h3 { color: #4cd964; } .azb.x10 .azb-info p { color: #d4ffe2; }
.x10-img { aspect-ratio: 535 / 836; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--font); font-size: clamp(30px, 6vh, 46px); line-height: 1; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; padding: 0 8px; background: linear-gradient(135deg, #0a2a66 0%, #04a64f 50%, #c89400 100%); border: 4px solid var(--ink); }

/* ═════════════ TEMA MEDIEVALE (sostituisce l'aspetto "cartoon") ═════════════ */
@font-face { font-family: "Cinzel"; font-weight: 400 900; src: url(../assets/fonts/Cinzel.ttf) format("truetype"); font-display: block; }
:root {
  --ink: #0b0806; --navy: #2a1d14; --navy2: #17110c; --mut: #cdb994;
  --gold: #e6b45a; --gold2: #b27a22; --green: #6fb85a; --red: #c8323f; --blue: #5f94c8; --purple: #8e62c8;
  --bronze: #9a7239; --wood1: #34261a; --wood2: #1b140e;
  --font: "Cinzel", Georgia, "Times New Roman", serif;
}
html { font-variation-settings: "wght" 700; }
*, *::before, *::after { -webkit-text-stroke: 0 !important; paint-order: normal !important; }
body { background: #0c0a08; text-shadow: 0 1px 3px rgba(0,0,0,.75); }
.ico { filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.st { text-shadow: 0 3px 6px rgba(0,0,0,.85), 0 0 1px #000; letter-spacing: 2px; }
h1, h2, h3, .btn, .play-btn, .dname, .ribbon, .cname, .tag { text-transform: uppercase; letter-spacing: 1.5px; }

#loading { background: radial-gradient(circle at 50% 40%, #3a2a1a, #0a0806 72%); }
#loading .logo { color: var(--gold); text-shadow: 0 4px 0 #000, 0 0 40px rgba(230,180,90,.45); letter-spacing: 8px; }
.lbar { border-radius: 4px; border: 2px solid var(--bronze); background: #0b0806; box-shadow: none; } .lbar i { background: linear-gradient(#f2cf86, #b27a22); }

/* pulsanti: metallo e bronzo, angoli netti */
.btn { --c1: #f0c56e; --c2: #b27a22; --lip: #4f330c; border-radius: 8px; border: 3px solid #1a1007; color: #fff8e6;
  box-shadow: 0 5px 0 var(--lip), 0 5px 0 3px #1a1007, inset 0 2px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(0,0,0,.2); text-shadow: 0 2px 2px rgba(0,0,0,.7); }
.btn.g { --c1: #9fd47a; --c2: #3d7a2c; --lip: #1d4214; }
.btn.b { --c1: #9dbde0; --c2: #3d5f8a; --lip: #1c3150; }
.btn.r { --c1: #e8707a; --c2: #8a1624; --lip: #4a0a12; }
.btn.p { --c1: #bf9ae8; --c2: #5e3a98; --lip: #2e1a52; }
.btn.k { --c1: #8d887a; --c2: #4a463d; --lip: #25231e; }
.chip { border-radius: 6px; background: linear-gradient(var(--wood1), var(--wood2)); border: 2px solid var(--bronze); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), 0 3px 6px rgba(0,0,0,.5); }
.sqbtn { border-radius: 8px; border: 3px solid #1a1007; background: linear-gradient(#8d887a, #4a463d); box-shadow: 0 4px 0 #25231e, 0 4px 0 3px #1a1007, inset 0 2px 0 rgba(255,255,255,.35); }
.sqbtn.y { background: linear-gradient(#f0c56e, #b27a22); box-shadow: 0 4px 0 #4f330c, 0 4px 0 3px #1a1007, inset 0 2px 0 rgba(255,255,255,.45); }
.pbar { border-radius: 4px; border: 2px solid var(--bronze); background: #0b0806; box-shadow: none; } .pbar i { border-radius: 2px; background: linear-gradient(#8fd0e8, #2a7fb0); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); }
.pbar.gold i { background: linear-gradient(#f2cf86, #b27a22); } .pbar.green i { background: linear-gradient(#a8d98a, #3d7a2c); }
.panel, .modal-box { background: linear-gradient(var(--wood1), var(--wood2)); border: 3px solid var(--bronze); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.65), inset 0 0 0 2px #0b0806, inset 0 2px 0 rgba(255,220,150,.15); }
#modal { background: rgba(6,4,2,.78); }
.modal-box h2, .modal-box h1 { color: var(--gold); text-shadow: 0 3px 6px rgba(0,0,0,.8); }
.topbar .profile, .profile { border-radius: 8px; background: linear-gradient(var(--wood1), var(--wood2)); border: 2px solid var(--bronze); box-shadow: 0 3px 8px rgba(0,0,0,.55); }
.xpbar { border-radius: 2px; border: 1px solid var(--bronze); } .xpbar i { background: linear-gradient(#f2cf86, #b27a22); }
.modebtn, .side-btn, .mode-card, .prow, .atk-row, .rw, .stat, .descp, .rolepill, .pst { border-radius: 8px; border: 2px solid var(--bronze); background: linear-gradient(rgba(52,38,26,.94), rgba(24,17,11,.94)); box-shadow: 0 4px 10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,150,.18); }
.side-btn { box-shadow: 0 5px 12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.25); } .side-btn:active { box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.mode-card.on { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(230,180,90,.5); }
.modebtn .mi, .mode-card .mode-ico, .pmode .mi { border: 3px solid #1a1007; }
.play-btn { border-radius: 10px; border: 4px solid #1a1007; background: linear-gradient(#f6d58f, #d99a2c 55%, #a8661a); color: #2a1604; text-shadow: 0 1px 0 rgba(255,255,255,.4); letter-spacing: 6px;
  box-shadow: 0 8px 0 #4f330c, 0 8px 0 4px #1a1007, inset 0 3px 0 rgba(255,255,255,.55), 0 0 40px rgba(230,180,90,.45); }
.play-btn:active { box-shadow: 0 2px 0 #4f330c, 0 2px 0 4px #1a1007; }
.card { border-radius: 10px; border: 3px solid #1a1007; box-shadow: 0 6px 14px rgba(0,0,0,.6), inset 0 0 0 2px color-mix(in srgb, var(--rc) 70%, #000); }
.card::before { opacity: .35; }
.card.sel { box-shadow: 0 6px 14px rgba(0,0,0,.6), 0 0 0 3px var(--gold), 0 0 26px 4px var(--rc); }
.card .cname { background: linear-gradient(transparent, rgba(8,6,4,.92) 55%); }
.filters button { border-radius: 6px; background: var(--wood2); }
.drop, .tile { border-radius: 10px; border: 3px solid #1a1007; box-shadow: 0 6px 14px rgba(0,0,0,.55); }
.banner, .azb, .soon { border: 3px solid var(--bronze); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,150,.2); }
.banner { background: linear-gradient(#4a3320, #1f150d); } .banner h3 { color: var(--gold); }
.azb { background: linear-gradient(#5a1620, #1d070b); } .azb.x10 { background: linear-gradient(#1f4a34, #0a1d14); }
.azb-img { border-radius: 6px; } .x10-img { border-radius: 6px; border: 2px solid var(--bronze); background: linear-gradient(135deg, #1c3a66 0%, #2c7a4a 50%, #b27a22 100%); }
.soon { background: linear-gradient(var(--wood1), var(--wood2)); }
.rates span { border-radius: 5px; background: rgba(8,6,4,.85); border-width: 2px; }
.levelup { border-radius: 8px; background: linear-gradient(#9dbde0, #3d5f8a); border: 3px solid #1a1007; }
#toast { border-radius: 8px; background: var(--wood2); border: 2px solid var(--bronze); }

/* HUD di battaglia */
.b-btn { border-radius: 10px; border: 3px solid #1a1007; background: linear-gradient(#8d887a, #4a463d); box-shadow: 0 4px 0 #25231e, inset 0 2px 0 rgba(255,255,255,.35); }
.b-info { text-shadow: 0 2px 6px rgba(0,0,0,.95), 0 0 2px #000; }
.b-title { color: var(--gold); letter-spacing: 5px; }
.zb div { border-radius: 3px; border: 2px solid var(--bronze); background: #0b0806; }
.b-feed div { border-radius: 6px; background: rgba(11,8,6,.82); border: 1px solid rgba(154,114,57,.6); }
.b-banner { text-shadow: 0 4px 10px rgba(0,0,0,.9), 0 0 36px currentColor; }
.b-mana { border-radius: 6px; border: 2px solid var(--bronze); background: #0b0806; box-shadow: 0 3px 8px rgba(0,0,0,.6); }
.b-mana-fill { background: linear-gradient(#d9a8ff, #8a3cd0 55%, #5e1c9a); }
.b-atk { border: 4px solid #1a1007; box-shadow: 0 5px 8px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.3); }
.b-atk.ready { box-shadow: 0 5px 8px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.35), 0 0 18px var(--c); }
.b-pause-ov { background: rgba(6,4,2,.82); } .b-pause-box h2 { color: var(--gold); letter-spacing: 6px; }
.b-pause-snd button { border-radius: 8px; border: 3px solid #1a1007; background: linear-gradient(#8d887a, #4a463d); box-shadow: 0 4px 0 #25231e; }

/* sfondo dei menu: pietra scura con braci */
.bgfx { background: radial-gradient(ellipse at 50% 58%, #4b3523 0%, #281b11 42%, #0e0906 100%); }
.bgfx .rays { background: repeating-conic-gradient(from 0deg, rgba(230,180,90,.07) 0 6deg, transparent 6deg 18deg); }
.bgfx .grid { background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 64px), repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 2px, transparent 2px 96px); animation: none; inset: 0; }
.bgfx .dots { opacity: .55; background-image: radial-gradient(circle, rgba(255,190,90,.95) 0 1.5px, transparent 2.5px), radial-gradient(circle, rgba(255,120,40,.85) 0 2px, transparent 3px), radial-gradient(circle, rgba(255,230,160,.8) 0 1px, transparent 2px); }
.bgfx.shop { background: radial-gradient(ellipse at 50% 42%, #5a2a2a 0%, #2a1212 45%, #0e0606 100%); }
.bgfx.dark { background: radial-gradient(ellipse at 50% 50%, #33261a 0%, #17100a 55%, #0a0705 100%); }

/* schermata Comandi */
#modal.controls .modal-box { width: min(620px, 100%); }
.kinfo { margin: -4px 0 10px; color: var(--mut, #cdb88a); font-size: clamp(12px, 2.2vh, 15px); }
.kgrid { display: grid; gap: 6px; text-align: left; }
.krow { display: grid; grid-template-columns: 1fr 112px 112px; gap: 8px; align-items: center; }
.krow.kh { color: var(--gold); font-size: 12px; text-align: center; letter-spacing: 1px; text-transform: uppercase; }
.krow.dim { opacity: .4; }
.krow .kn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.krow .kn .ico { width: 26px; height: 26px; flex: none; }
.krow .kn b { font-size: clamp(13px, 2.4vh, 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keycap { height: clamp(30px, 5vh, 38px); border-radius: 7px; border: 2px solid #1a1007; background: linear-gradient(#8d887a, #4a463d); color: #fff; font-size: clamp(13px, 2.4vh, 16px); box-shadow: 0 3px 0 #25231e, inset 0 2px 0 rgba(255,255,255,.3); }
.keycap.empty { opacity: .55; }
.keycap.wait { background: linear-gradient(#e6b45a, #9a7239); color: #1a1007; animation: kblink .8s infinite alternate; }
@keyframes kblink { to { filter: brightness(1.25); } }
@media (pointer: coarse) { #modal.controls .kinfo { display: none; } }

/* home: seconda fila di pulsanti laterali */
.side-btn { top: 36%; }

/* Trophy Road */
#screen-road, #screen-board { display: none; }
#screen-road.active, #screen-board.active { display: block; }
.road-body { position: absolute; left: 0; right: 0; top: calc(64px + var(--safe-t)); bottom: 0; overflow-x: auto; overflow-y: hidden; padding: 0 calc(24px + var(--safe-r)) 0 calc(24px + var(--safe-l)); display: flex; align-items: center; -webkit-overflow-scrolling: touch; }
.road { display: flex; align-items: center; gap: 0; padding: 0 40px; }
.rt { position: relative; width: clamp(104px, 20vh, 150px); flex: none; margin: 0 clamp(14px, 3vh, 26px); padding: 10px 8px 12px; border-radius: 8px; border: 2px solid var(--bronze); background: linear-gradient(rgba(52,38,26,.96), rgba(24,17,11,.96)); box-shadow: 0 4px 10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,150,.18); text-align: center; display: grid; gap: 6px; justify-items: center; }
.rt::before { content: ""; position: absolute; top: 50%; left: calc(-1 * clamp(28px, 6vh, 52px)); width: clamp(28px, 6vh, 52px); height: 8px; transform: translateY(-50%); background: #3a2d1e; border-top: 2px solid #120c06; border-bottom: 2px solid #120c06; }
.rt:first-child::before { display: none; }
.rt.claimed::before, .rt.ready::before { background: linear-gradient(#f2cf86, #9a7239); }
.rt-n { display: flex; align-items: center; gap: 4px; font-size: clamp(14px, 2.6vh, 19px); color: #f2cf86; } .rt-n .ico { width: 20px; height: 20px; }
.rt-r { width: clamp(46px, 9vh, 70px); height: clamp(46px, 9vh, 70px); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 45%, #000) 0%, #120c06 75%); border: 3px solid var(--rc); } .rt-r .ico { width: 62%; height: 62%; }
.rt-d { font-size: clamp(11px, 2vh, 14px); line-height: 1.15; min-height: 2.3em; display: grid; place-items: center; color: var(--rc); }
.rt-b { padding: 5px 10px; font-size: clamp(12px, 2.2vh, 16px); animation: pulse 1.2s ease-in-out infinite; }
.rt-s { height: 30px; display: grid; place-items: center; } .rt-s .ico { width: 26px; height: 26px; } .rt-s:not(.ok) { opacity: .55; }
.rt.locked { filter: saturate(.55) brightness(.85); }
.rt.claimed { opacity: .72; }
.rt.ready { border-color: #f2cf86; box-shadow: 0 0 18px rgba(242,207,134,.55), 0 4px 10px rgba(0,0,0,.55); }
.road-next b { color: #f2cf86; }

/* Classifica */
.lb-list { position: absolute; left: 50%; transform: translateX(-50%); width: min(720px, 100% - 24px); top: calc(64px + var(--safe-t)); bottom: calc(60px + var(--safe-b, 0px)); overflow-y: auto; display: grid; gap: 5px; align-content: start; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; }
.lb { display: grid; grid-template-columns: 54px 40px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 8px; border: 2px solid #3a2d1e; background: linear-gradient(rgba(52,38,26,.94), rgba(24,17,11,.94)); }
.lb-r { display: flex; align-items: center; gap: 2px; font-size: clamp(16px, 2.8vh, 22px); color: #cdb88a; } .lb-r .ico { width: 18px; height: 18px; }
.lb img { width: 40px; height: 40px; border-radius: 6px; border: 2px solid var(--bronze); object-fit: cover; background: #120c06; }
.lb-n { font-size: clamp(14px, 2.6vh, 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.lb-n em { font-style: normal; font-size: 11px; background: #f2cf86; color: #1a1007; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.lb-t { display: flex; align-items: center; gap: 4px; min-width: 76px; justify-content: flex-end; color: #f2cf86; font-size: clamp(15px, 2.8vh, 20px); } .lb-t .ico { width: 20px; height: 20px; }
.lb-l .lv { font-size: 13px; }
.lb.top1 { border-color: #ffc83d; background: linear-gradient(rgba(120,88,20,.55), rgba(40,28,8,.95)); } .lb.top1 .lb-r { color: #ffc83d; }
.lb.top2 { border-color: #d3d8e2; } .lb.top2 .lb-r { color: #d3d8e2; }
.lb.top3 { border-color: #cd8a4f; } .lb.top3 .lb-r { color: #cd8a4f; }
.lb.me { border-color: #f2cf86; background: linear-gradient(rgba(90,66,30,.9), rgba(40,28,12,.96)); }
.lb-me-bar { position: absolute; left: 50%; transform: translateX(-50%); width: min(720px, 100% - 24px); bottom: calc(8px + var(--safe-b, 0px)); grid-template-columns: 54px 40px 1fr auto; box-shadow: 0 0 14px rgba(242,207,134,.4); z-index: 3; }
@media (max-height: 420px) { .lb img { width: 32px; height: 32px; } .lb { padding: 4px 10px; } }
.side-btn.right .badge { right: -2px; }

/* Rank */
.rankico { display: block; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.chip.rankchip { gap: 8px; padding-left: 8px; cursor: pointer; }
.chip.rankchip .rkn { display: grid; line-height: 1.05; text-align: left; } .chip.rankchip .rkn small { font-size: 11px; color: #cdb88a; }
.prank { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; text-align: left; }
.prank > div { flex: 1; min-width: 0; } .prank b { color: var(--rc); font-size: clamp(18px, 3.4vh, 26px); }
.prank small { color: #cdb88a; font-size: 13px; }
.rkbar { height: 12px; margin: 5px 0; border-radius: 6px; background: #120c06; border: 2px solid #3a2d1e; overflow: hidden; } .rkbar i { display: block; height: 100%; background: linear-gradient(#f2cf86, #9a7239); }
.rgate { flex: none; width: clamp(96px, 18vh, 130px); margin: 0 clamp(14px, 3vh, 26px); display: grid; justify-items: center; gap: 2px; text-align: center; opacity: .5; filter: saturate(.5); }
.rgate b { color: var(--rc); font-size: clamp(14px, 2.6vh, 19px); } .rgate small { color: #cdb88a; font-size: 12px; }
.rgate.on { opacity: 1; filter: none; }
.lb-t .rankico { margin-right: 2px; }
.rgate .rankico { height: clamp(70px, 14vh, 100px); width: auto; }
.prank .rankico { height: clamp(60px, 11vh, 84px); width: auto; } .lb-t .rankico { height: 30px; width: auto; }

/* Tier degli eroi */
.tstars { display: inline-flex; gap: 1px; justify-content: center; }
.tstars svg polygon { fill: var(--tc); stroke: #120c06; stroke-width: 1.6; } .tstars svg.off polygon { fill: #2a2118; stroke: #4a3d2c; }
.tstars.t5 svg { filter: drop-shadow(0 0 3px #ff5a4a); }
.card .tstars { position: absolute; left: 0; right: 0; bottom: 30px; }
.card.tmax { box-shadow: 0 0 0 2px #ff5a4a, 0 0 16px rgba(255,90,74,.7); }
.tierbox { margin-top: 10px; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--tc); background: linear-gradient(rgba(52,38,26,.94), rgba(24,17,11,.94)); text-align: left; display: grid; gap: 6px; }
.tierbox .th { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .tierbox .th b { color: var(--tc); font-size: clamp(15px, 2.8vh, 20px); }
.tierbox small { color: #cdb88a; font-size: clamp(11px, 2vh, 13px); } .tierbox .tneed { color: #ff9a8a; }
.tierbox .btn { padding: 6px 10px; font-size: clamp(13px, 2.4vh, 16px); display: flex; align-items: center; justify-content: center; gap: 4px; } .tierbox .btn .ico { width: 20px; height: 20px; }
.tierbox.max { box-shadow: 0 0 16px rgba(255,90,74,.55); background: linear-gradient(rgba(90,30,26,.9), rgba(24,17,11,.96)); }
.herotr { margin: 6px 0; color: #cdb88a; font-size: clamp(14px, 2.6vh, 18px); } .herotr b { color: #f2cf86; } .herotr .tup { color: #ff9a6a; }
.tbar { height: 22px; } .tbar b { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; } .tbar b .ico { width: 14px; height: 14px; }

/* simboli dei Tier */
.card .tieremb { position: absolute; top: 48px; left: 3px; z-index: 2; line-height: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.card .tieremb.t0 { opacity: .7; }
.card .tieremb.t5 { animation: tglow 1.6s ease-in-out infinite alternate; } @keyframes tglow { to { filter: drop-shadow(0 0 8px #ff5a4a); } }
.tieremb-svg { display: block; }
.tierbox .th { justify-content: flex-start; } .tierbox .th b { flex: 1; } .tierbox .th .tstars { display: none; }

/* ───── SFONDI 3D REALISTICI (tools/render-bg.html) ───── */
.bgfx { background: #0c0912 url(../assets/ui/bg_hall.jpg) 50% 60% / cover no-repeat; animation: bgdrift 46s ease-in-out infinite alternate; transform-origin: 50% 70%; }
.bgfx.shop { background-image: url(../assets/ui/bg_vault.jpg); }
.bgfx .rays, .bgfx .grid { display: none; }
.bgfx::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 58%, transparent 38%, rgba(6,3,12,.62) 100%), linear-gradient(rgba(6,3,12,.45), transparent 22%, transparent 70%, rgba(6,3,12,.5)); }
.bgfx.dark { inset: -26px; filter: blur(4px) saturate(1) brightness(.9); animation: none; }
.bgfx.dark::after { background: linear-gradient(rgba(8,5,14,.4), rgba(8,5,14,.5)); }
.bgfx .dots { opacity: .7; mix-blend-mode: screen; }
@keyframes bgdrift { from { transform: scale(1.0) translate3d(0, 0, 0); } to { transform: scale(1.07) translate3d(-1.2%, -1%, 0); } }
@media (prefers-reduced-motion: reduce) { .bgfx { animation: none; } }
/* pannelli in vetro scuro */
.chip, .side-btn, .modebtn { background: linear-gradient(rgba(46,33,54,.62), rgba(14,9,20,.8)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,208,140,.38); border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(0,0,0,.35); }
.chip:active, .side-btn:active { transform: translateY(1px); }
.filters button[data-f="-1"].on { background: linear-gradient(#f0cf7a, #b6832d); color: #2a1808; -webkit-text-stroke: 0; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.filters button { background: rgba(14,9,20,.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.filters button.on { background: var(--rc, #fff); }
.bgfx.dark { background: #0c0912 url(../assets/ui/bg_hall.jpg) 50% 60% / cover no-repeat; }
.bgfx.shop { background: #0c0912 url(../assets/ui/bg_vault.jpg) 50% 60% / cover no-repeat; }

/* barra del Tier nella scheda eroe (sopra la barra delle souls) */
.tierrow { padding-left: 4px; margin-bottom: 4px; }
.tierrow .tieremb-svg { height: clamp(40px, 8.4vh, 58px); width: auto; margin-right: -12px; position: relative; z-index: 2; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.tierrow .pbar { height: clamp(20px, 3.8vh, 26px); } .tierrow .pbar b { font-size: clamp(11px, 2vh, 14px); }
.tierrow .pbar i { background: linear-gradient(#fff, var(--tc, #e0a020)); }
.tierrow.max .pbar { box-shadow: 0 0 12px var(--tc); }

/* Rinascita: velo rosso leggero + "Di nuovo in gioco tra 3 2 1" a centro schermo */
.b-redveil { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease; background: radial-gradient(ellipse at 50% 50%, rgba(200, 20, 30, .12) 0%, rgba(200, 20, 30, .26) 55%, rgba(120, 0, 10, .5) 100%); }
.b-redveil.on { opacity: 1; }
.b-resp { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity .25s; color: #fff; }
.b-resp.on { opacity: 1; }
.b-resp small { display: block; font-size: clamp(16px, 4.2vh, 34px); letter-spacing: .18em; text-transform: uppercase; text-shadow: 0 2px 0 #000, 0 -2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 0 26px rgba(255, 60, 60, .9); }
.b-resp b { display: block; font-weight: 400; line-height: 1; font-size: clamp(90px, 28vh, 240px); color: #ffe3e3; text-shadow: 0 5px 0 #7a0a14, 0 -3px 0 #000, 4px 0 0 #000, -4px 0 0 #000, 0 9px 0 #000, 0 0 44px #ff3b3b; animation: bresp 1s ease-out both; }
.b-resp b[hidden] { display: none; }
@keyframes bresp { 0% { transform: scale(2.2); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 80% { transform: scale(.94); opacity: 1; } 100% { transform: scale(.8); opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .b-resp b { animation: none; } .b-redveil { transition: none; } }

/* boost (Survival, Duo, Trio): simbolo della statistica e moltiplicatore accanto */
.bst { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 999px; background: rgba(11,8,6,.55); border: 1px solid rgba(154,114,57,.55); opacity: .72; transition: opacity .2s; }
.bst .ico { width: 1.15em; height: 1.15em; }
.bst b { font-size: .8em; letter-spacing: .5px; }
.bst.on { opacity: 1; border-color: #ffd36b; box-shadow: 0 0 10px rgba(255,211,107,.45); }
.bst-dmg.on b { color: #ffab84; } .bst-spd.on b { color: #ffe36b; } .bst-mana.on b { color: #d9b4ff; }
.pks-img.skin { width: auto; aspect-ratio: auto; } .pks-img.skin img { width: min(30vh, 220px); height: auto; aspect-ratio: 5 / 7; object-fit: cover; object-position: top; border-radius: 14px; border: 3px solid var(--rc); }
.pks-h.pks-w { color: var(--rc); }

/* suggerimento "trascina per ruotare" sotto l'eroe 3D (sparisce dopo il primo giro) */
.spin-hint { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); z-index: 4; padding: 4px 12px; border-radius: 999px; background: rgba(10, 6, 14, .72); border: 1px solid rgba(233, 189, 90, .6); color: #f6e2b6; font: 700 clamp(10px, 1.9vh, 13px) var(--font, system-ui); letter-spacing: .5px; text-transform: uppercase; pointer-events: none; white-space: nowrap; animation: spinhint 2.4s ease-in-out infinite; }
@keyframes spinhint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ───── TIER MAX + SUPER TROPHIES: tutto cromato arcobaleno (azzurro, giallo, rosso, viola) ───── */
@keyframes rbwmove { to { background-position: 200% 0; } }
@keyframes rbwglow { 0%, 100% { box-shadow: 0 0 0 2px #4fd2ff, 0 0 16px rgba(79,210,255,.75); } 25% { box-shadow: 0 0 0 2px #ffe94d, 0 0 16px rgba(255,233,77,.75); } 50% { box-shadow: 0 0 0 2px #ff3d55, 0 0 16px rgba(255,61,85,.75); } 75% { box-shadow: 0 0 0 2px #b255ff, 0 0 16px rgba(178,85,255,.75); } }
.rbw { background: linear-gradient(100deg, #4fd2ff 0%, #fff 14%, #ffe94d 30%, #ff3d55 50%, #ffd0f0 62%, #b255ff 80%, #4fd2ff 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; -webkit-text-stroke: 0; text-shadow: none; filter: drop-shadow(0 1px 0 #120c06) drop-shadow(0 0 2px #120c06); animation: rbwmove 3.5s linear infinite; font-weight: 900; }
.card.tmax { animation: rbwglow 5s linear infinite; }
.tierbox.max { background: linear-gradient(rgba(54,30,84,.92), rgba(18,10,28,.96)); animation: rbwglow 5s linear infinite; border-color: transparent; }
.souls.tierc.max .pbar i, .tierrow.max .pbar i, .rbw-bar i { background: linear-gradient(90deg, #4fd2ff, #fff, #ffe94d, #ff3d55, #ffd0f0, #b255ff, #4fd2ff); background-size: 200% 100%; animation: rbwmove 3s linear infinite; }
.card .souls.tierc.max .pbar, .tierrow.max .pbar, .rbw-bar { box-shadow: 0 0 10px rgba(178,85,255,.7); }
.tmax-svg, .supico { filter: drop-shadow(0 0 5px rgba(178,85,255,.8)); }
.hm-sup { border-color: #b255ff; background: linear-gradient(180deg, rgba(60,30,100,.95), rgba(20,10,40,.95)); }
.hm-sup .hm-ric .supico { height: clamp(18px, 4.6vh, 30px); width: auto; }
.hm-tl .hm-sup { grid-column: span 2; justify-content: flex-start; gap: 8px; }
.lb-tabs { display: flex; gap: 6px; margin-left: 12px; } .lb-tabs button { padding: 4px 14px 5px; border-radius: 999px; border: 2px solid #5a4630; background: rgba(20,13,8,.85); color: #cdb88a; font-weight: 800; font-size: clamp(12px, 2.4vh, 16px); cursor: pointer; }
.lb-tabs button.on { border-color: #fff; background: rgba(60,30,100,.9); color: #fff; box-shadow: 0 0 10px rgba(178,85,255,.7); }
.sroad .rt { background-image: linear-gradient(rgba(44,22,70,.92), rgba(16,9,28,.96)); }
.rs-hr .rs-d.neg { color: #ff6a6a; }
.pm-super .pm-title { background: linear-gradient(100deg, #4fd2ff, #fff, #ffe94d, #ff3d55, #b255ff, #4fd2ff); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: rbwmove 3s linear infinite; }
.pbar .rbw { background: none; -webkit-text-fill-color: #fff; color: #fff; animation: none; filter: drop-shadow(0 0 2px #120c06) drop-shadow(0 1px 0 #120c06); }
.lb-tabs { margin-left: 6px; } .lb-tabs button { padding: 3px 10px 4px; }
