/* =========================================================
   NaruBonk - interfaccia
   Pannelli color inchiostro caldo con bordo dorato, motivo a spirali
   (il vortice di Konoha), notifiche a timbro rosso (hanko),
   logo a coprifronte, pulsanti a pillola con ombra "3D".
   ========================================================= */
:root {
  --bg: #17120f;
  --card: #241d19;
  --card-2: #2e2520;
  --card-3: #3a2f28;
  --line: rgba(255, 220, 170, 0.08);
  --line-2: rgba(255, 220, 170, 0.16);
  --text: #fbf1e2;
  --muted: #b5a28c;
  --ink: #17120f;

  --red: #ff4d5e;
  --red-d: #c42a3c;
  --orange: #ff9a2e;
  --orange-d: #c86a12;
  --yellow: #ffc93c;
  --green: #3fd47a;
  --green-d: #1f9a51;
  --blue: #3d8bff;
  --blue-d: #2160c8;
  --purple: #8a5cff;
  --purple-d: #5b36c4;
  --pink: #ff5fa8;
  --cyan: #46d6e8;

  --hp: #3fd47a;
  --xp: #3d8bff;
  --gold: #ffc93c;
  --good: #3fd47a;
  --accent: var(--orange);
  --accent-2: var(--yellow);

  /* motivo a spirali (il nome resta --stripes perche e usato ovunque) */
  --stripes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.17' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M11 11a1.5 1.5 0 1 1 1.5 1.5a3.5 3.5 0 0 1-3.5-3.5a5.5 5.5 0 0 1 5.5-5.5a7.5 7.5 0 0 1 7.5 7.5'/%3E%3Cpath d='M33 33a1.5 1.5 0 1 1 1.5 1.5a3.5 3.5 0 0 1-3.5-3.5a5.5 5.5 0 0 1 5.5-5.5a7.5 7.5 0 0 1 7.5 7.5'/%3E%3C/g%3E%3C/svg%3E");
  --stripes-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.06' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M11 11a1.5 1.5 0 1 1 1.5 1.5a3.5 3.5 0 0 1-3.5-3.5a5.5 5.5 0 0 1 5.5-5.5a7.5 7.5 0 0 1 7.5 7.5'/%3E%3Cpath d='M33 33a1.5 1.5 0 1 1 1.5 1.5a3.5 3.5 0 0 1-3.5-3.5a5.5 5.5 0 0 1 5.5-5.5a7.5 7.5 0 0 1 7.5 7.5'/%3E%3C/g%3E%3C/svg%3E");
  --display: 'Lilita One', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --r: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
img { image-rendering: pixelated; }

/* Testo "chunky" con contorno scuro */
.outline, h1, h2, .timer, #banner, .dmg, .ribbon span, .tile b, .lvl-title {
  paint-order: stroke fill;
  -webkit-text-stroke: 0;
}

kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px;
  background: #f3f5fb; color: var(--ink); border-radius: 6px; font: 900 11px/1 var(--body);
  box-shadow: 0 2px 0 #b5a28c; white-space: nowrap;
}

/* ---------------- Mattoncini comuni ---------------- */
.box {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden;
}
.box-head {
  --hc: var(--blue);
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--stripes), linear-gradient(90deg, var(--hc), color-mix(in srgb, var(--hc) 70%, #fff 0%));
  font: 400 17px/1 var(--display); letter-spacing: .3px; color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.box-head small { margin-left: auto; font: 800 11px/1 var(--body); opacity: .9; }
.box-body { padding: 14px; }
.label { font: 900 11px/1 var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  background: var(--chip, var(--card-3)); color: #fff; font: 800 12px/1.3 var(--body);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}

.bar { position: relative; height: 16px; border-radius: 99px; background: #0f0b09; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0,0,0,.5); }
.bar > span { position: absolute; inset: 0; text-align: center; font: 900 11px/16px var(--body); text-shadow: 0 1px 2px #000; }
.meter { position: relative; height: 14px; border-radius: 99px; background: #0f0b09; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(180deg, #5ef09a, var(--green)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.meter b { position: absolute; inset: 0; text-align: center; font: 900 10px/14px var(--body); text-shadow: 0 1px 2px #000; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }

.hud-player {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px;
  width: min(330px, 42vw); padding: 8px 14px 8px 8px; border-radius: 22px;
  background: linear-gradient(90deg, rgba(36, 29, 25, .92), rgba(36, 29, 25, .55)); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hud-pic {
  position: relative; flex: none; width: 62px; height: 62px; border-radius: 50%;
  background: var(--stripes), radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--pc, #3d8bff) 85%, #fff), var(--pc, #3d8bff));
  border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.35);
  display: grid; place-items: center; overflow: visible;
}
.hud-pic img { width: 58px; height: 49px; margin-top: 2px; }
#lvl {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 99px; padding: 2px 8px; font: 900 10px/1.3 var(--body); white-space: nowrap;
  border: 2px solid #fff;
}
.hud-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hud-name { font: 400 18px/1 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-info .bar.hp { height: 16px; }
.hud-info .bar.xp { height: 7px; }
#hp-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, #6ff5a6, var(--hp)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); transition: width 0.1s; }
#shield-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(140, 200, 255, 0.75); }
#hp-text { position: absolute; inset: 0; text-align: center; font: 900 11px/16px var(--body); text-shadow: 0 1px 2px #000; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #2f6fe0, #6db3ff); transition: width 0.12s; }

.hud-center {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 22px 8px; border-radius: 0 0 20px 20px; min-width: 220px;
  background: rgba(36, 29, 25, .88); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hud-mode { font: 800 11px/1.2 var(--body); color: var(--muted); white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.hud-goal {
  padding: 3px 12px; border-radius: 99px; background: rgba(15, 11, 9, .85); color: var(--gold);
  font: 900 13px/1.4 var(--body); white-space: nowrap;
}
.hud-goal.hidden { display: none; }
.timer { font: 400 34px/1 var(--display); letter-spacing: 1px; text-shadow: 0 3px 0 rgba(0,0,0,.45); }
.stats { display: flex; gap: 6px; }
.stats > span {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px;
  background: #0f0b09; font: 900 13px/1.4 var(--body);
}
#ryo { color: var(--gold); }
#curses b { color: #ff7d8b; }

#bossbar { position: absolute; top: 106px; left: 50%; transform: translateX(-50%); width: min(560px, 80vw); text-align: center; }
#boss-name {
  display: inline-block; margin-bottom: -2px; padding: 4px 16px 6px; border-radius: 12px 12px 0 0;
  background: var(--stripes), linear-gradient(90deg, var(--purple-d), var(--purple));
  font: 400 16px/1 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
#bossbar .bar { position: relative; height: 18px; border: 3px solid var(--card); box-shadow: var(--shadow); }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(180deg, #ff7d8b, var(--red)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); transition: width .1s; }
#boss-hp {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 900 11px/1 var(--body); color: #fff; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 3px rgba(0,0,0,.5);
  pointer-events: none;
}

/* Serie di KO (sotto il contatore dei nemici): il numero cresce di colore con la serie */
#streak {
  display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap;
  position: absolute; top: 100px; left: 12px; width: 128px; padding: 4px 10px 6px; border-radius: 12px;
  background: rgba(15, 11, 9,.72); box-shadow: var(--shadow); --sc: var(--gold);
}
#streak.hidden { display: none; }
#streak b { font: 400 22px/1 var(--display); color: var(--sc); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
#streak small { font: 900 11px/1 var(--body); color: #f2e8d8; text-transform: uppercase; letter-spacing: .04em; }
#streak .bar { flex-basis: 100%; height: 4px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
#streak .bar i { display: block; height: 100%; background: var(--sc); }
#streak.streak-t2 { --sc: var(--orange); }
#streak.streak-t3 { --sc: #ff5a6a; }
#streak.streak-t4 { --sc: #c88bff; }
#streak.pop b { animation: streak-pop .18s ease-out; }
@keyframes streak-pop { from { transform: scale(1.35); } to { transform: scale(1); } }

#minimap {
  position: absolute; top: 12px; right: 12px; width: 150px; height: 150px; border-radius: 50%;
  border: 5px solid var(--card); outline: 2px solid var(--line-2); box-shadow: var(--shadow);
}

#event {
  position: absolute; top: 176px; right: 12px; width: 220px; border-radius: 16px; overflow: hidden;
  background: rgba(36, 29, 25, .94); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .3s ease-out;
}
.ev-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  background: var(--stripes), linear-gradient(90deg, var(--orange-d), var(--orange));
}
.ev-head b { flex: 1; font: 400 15px/1 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.ev-head small { font: 900 12px/1 var(--body); background: rgba(0,0,0,.25); padding: 3px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
#ev-text { font-size: 12px; padding: 8px 10px 6px; color: #f0e4d2; }
#event .bar { height: 8px; margin: 0 10px 10px; }
#ev-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--yellow)); transition: width .15s; }

.bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.slots { display: grid; grid-auto-flow: column; grid-auto-columns: 42px; gap: 5px; padding: 6px; border-radius: 14px; background: rgba(36, 29, 25, .7); border: 1px solid var(--line); }
.slot {
  position: relative; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 21px;
  background: var(--stripes-soft), var(--card-3); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.slot.empty { background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 2px rgba(255,255,255,.06); }
.slot i { position: absolute; bottom: -5px; right: -5px; font: 900 9px/1 var(--body); font-style: normal; background: var(--yellow); color: var(--ink); border-radius: 99px; padding: 3px 5px; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
#slots-p .slot:not(.empty) { background: var(--stripes-soft), #3d3029; }
.abilities { display: flex; gap: 10px; }
.ab {
  position: relative; width: 62px; height: 62px; border-radius: 50%; overflow: hidden;
  background: var(--card-2); border: 4px solid var(--card); outline: 2px solid var(--line-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.ab span { position: relative; font: 400 22px/1 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.ab small { position: relative; font: 900 8px/1.2 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.ab .cd { position: absolute; left: 0; right: 0; top: 0; height: 0; background: rgba(0,0,0,.65); }
.ab .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--stripes), linear-gradient(0deg, var(--purple-d), var(--purple)); opacity: .8; }
.ab.ult.ready { outline-color: var(--yellow); box-shadow: 0 0 22px var(--purple), 0 0 0 4px rgba(255, 201, 60, .35); animation: pulse 0.9s infinite alternate; }
.ab.ult.ready .fill { opacity: 1; }
.ab.ult.ready small { color: #fff; }
@keyframes pulse { to { transform: scale(1.07); } }
.ab .auto-badge { display: none; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); font: 900 7px/1 var(--body); letter-spacing: .5px; padding: 2px 4px; border-radius: 99px; background: var(--yellow); color: var(--ink); }
.ab.ult.auto .auto-badge { display: block; }
/* Chiamata della Squadra (game.teamCallUse): barra verde della Foglia */
.ab.team .fill { background: var(--stripes), linear-gradient(0deg, #2a7a3a, #6ad05a); }
.ab.team.ready { outline-color: var(--yellow); box-shadow: 0 0 22px #6ad05a, 0 0 0 4px rgba(255, 201, 60, .35); animation: pulse 0.9s infinite alternate; }
.ab.team.ready .fill { opacity: 1; }
.ab.team.ready small { color: #fff; }
#touch-btns button.ready { border-color: #6ad05a; box-shadow: 0 0 0 3px #6ad05a, 0 0 24px #6ad05a; animation: pulse 0.9s infinite alternate; }
.uc-band.uc-team img { height: 115%; }
.uc-band.uc-team img.uc-mate { height: 80%; margin-left: -2%; }
.uc-band.uc-team .uc-txt { flex: none; }

#banner {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%) scale(.8);
  font: 400 clamp(24px, 4.2vw, 44px)/1.1 var(--display); text-align: center; white-space: nowrap; color: #fff;
  -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0,0,0,.35); opacity: 0; transition: opacity .25s, transform .25s;
}
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(255, 77, 94, 0.9); opacity: 0; }
#vignette.hit { animation: hit .45s ease-out; }
@keyframes hit { from { opacity: 1; } to { opacity: 0; } }
.evo-flash {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 55%, #fff 0%, var(--fc) 35%, transparent 75%);
  box-shadow: inset 0 0 220px var(--fc);
  animation: evo-flash 1.3s ease-out forwards;
}
.evo-warn { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
  background: radial-gradient(circle at 50% 55%, transparent 25%, rgba(8, 6, 20, .6) 80%);
  box-shadow: inset 0 0 180px color-mix(in srgb, var(--fc) 55%, transparent);
  animation: evo-in .35s ease-out, evo-glow .5s ease-in-out infinite alternate; }
.evo-warn .bar { position: absolute; left: 0; right: 0; height: 11vh; background: #07060c; animation: evo-bar .4s ease-out both; }
.evo-warn .bar.top { top: 0; --from: -100%; }
.evo-warn .bar.bot { bottom: 0; --from: 100%; }
.evo-msg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; width: min(92vw, 720px);
  color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 rgba(0,0,0,.35);
  animation: evo-msg .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.evo-msg small { display: block; font: 400 clamp(14px, 2vw, 20px)/1.2 var(--display); opacity: .85; }
.evo-msg b { display: block; font: 400 clamp(20px, 3.6vw, 38px)/1.15 var(--display); margin: 4px 0; }
.evo-msg span { display: inline-block; font: 400 clamp(16px, 2.6vw, 26px)/1.2 var(--display); color: var(--fc);
  animation: evo-title .5s ease-in-out infinite alternate; }
@keyframes evo-in { from { opacity: 0; } }
@keyframes evo-glow { to { box-shadow: inset 0 0 260px var(--fc); } }
@keyframes evo-bar { from { transform: translateY(var(--from)); } }
@keyframes evo-msg { from { opacity: 0; transform: translate(-50%, -16px) scale(.85); } }
@keyframes evo-title { to { transform: scale(1.08); filter: brightness(1.4); } }
@keyframes evo-flash { 0% { opacity: 0; } 8% { opacity: .95; } 30% { opacity: .55; } 100% { opacity: 0; } }

#dmg-layer { position: absolute; inset: 0; overflow: hidden; }
.dmg {
  position: absolute; left: 0; top: 0; font: 400 17px/1 var(--display); color: #fff; white-space: nowrap; will-change: transform;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.dmg.crit { color: var(--yellow); font-size: 24px; }
.dmg.hurt { color: var(--red); font-size: 21px; }
.dmg.heal { color: var(--green); font-size: 21px; }
.dmg.dot { font-size: 13px; opacity: .85; }
/* efficacia e reazioni Kekkei Genkai (combat.js): il colore arriva dallo stile in linea */
.dmg.eff { font-size: 15px; z-index: 1; }
.dmg.react { font-size: 26px; z-index: 2; -webkit-text-stroke: 5px var(--ink); animation: mega-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
/* Critico mega (power.js): numero enorme che "esplode" (scale non tocca il transform della posizione) */
.dmg.mega {
  color: #ff3b5a; font-size: 42px; -webkit-text-stroke: 6px var(--ink); text-align: center; z-index: 2;
  text-shadow: 0 0 18px rgba(255, 210, 63, .85); animation: mega-pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
.dmg.mega::before { content: 'SENJUTSU!'; display: block; font-size: 18px; color: var(--yellow); -webkit-text-stroke: 4px var(--ink); margin-bottom: 2px; }
@keyframes mega-pop { from { scale: 2.4; rotate: -8deg; } to { scale: 1; rotate: 0deg; } }

/* Unione di jutsu e Pergamene tecniche (power.js) */
.slot.union { box-shadow: inset 0 0 0 2px #ffd23f, inset 0 -3px 0 rgba(0,0,0,.25); background: var(--stripes-soft), #3a3352; }
.slot.union span { position: absolute; font-size: .72em; line-height: 1; }
.slot.union span:nth-of-type(1) { left: 3px; top: 3px; }
.slot.union span:nth-of-type(2) { right: 3px; bottom: 6px; }
.slot.union i { right: auto; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #ffd23f; }
.slot i.tm { background: #7fd8ff; }
.union-mark { display: inline-flex; vertical-align: -2px; margin-left: 3px; }
.power-end { margin-top: 8px; }

#touch-btns, #joystick { display: none; }
@media (pointer: coarse) {
  #touch-btns { display: grid; grid-template-columns: repeat(2, 64px); gap: 10px; position: absolute; right: 18px; bottom: 120px; pointer-events: auto; }
  #touch-btns button { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--card); background: var(--card-2); font: 400 22px/1 var(--display); box-shadow: var(--shadow); }
  #joystick { display: block; position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); background: rgba(0,0,0,.25); opacity: 0; }
  #joystick.on { opacity: 1; }
  #joystick .knob { position: absolute; left: 30px; top: 30px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.7); }
  #minimap { width: 100px; height: 100px; }
  #event { top: 124px; width: 170px; }
}

/* ---------------- Schermate ---------------- */
#overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
#overlay.on { display: flex; background: radial-gradient(ellipse at center, rgba(23, 18, 15, 0.45), rgba(23, 18, 15, 0.9)); }
#overlay.on.home-mode { background: linear-gradient(90deg, rgba(23, 18, 15, .8), rgba(23, 18, 15, .25) 60%, rgba(23, 18, 15, .55)); }
.screen { width: 100%; max-width: 1180px; margin: auto; animation: rise .3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
h2 { font: 400 clamp(26px, 4vw, 38px)/1.1 var(--display); margin: 0 0 12px; text-align: center; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.sub { color: var(--muted); text-align: center; margin: 0 0 16px; line-height: 1.45; font-size: 14px; font-weight: 700; }
.sub b { color: var(--text); }
.menu { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 16px; }
.menu .btn { min-width: 240px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Intestazione: Esc Indietro + nastro inclinato */
.screen-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.back {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 7px 14px 7px 7px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line-2); font: 900 14px/1 var(--body); box-shadow: 0 3px 0 rgba(0,0,0,.35);
  transition: transform .1s;
}
.back:hover { transform: translateY(-2px); }
.ribbon {
  --rc: var(--red);
  display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 26px 10px; transform: skewX(-8deg);
  background: var(--stripes), linear-gradient(90deg, var(--rc), color-mix(in srgb, var(--rc) 70%, var(--orange)));
  border-radius: 12px; box-shadow: 0 5px 0 color-mix(in srgb, var(--rc) 55%, #000), var(--shadow);
}
.ribbon > * { transform: skewX(8deg); }
.ribbon span { font: 400 clamp(24px, 3.4vw, 34px)/1 var(--display); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.ribbon small { font: 900 13px/1 var(--body); color: #fff; opacity: .9; }
.head-extra { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.coin-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 99px; background: var(--card);
  border: 1px solid var(--line-2); font: 400 20px/1 var(--display); color: var(--gold); box-shadow: 0 3px 0 rgba(0,0,0,.35);
}

/* Pulsanti a pillola */
.btn {
  --bc: var(--card-3); --bd: #201a16;
  cursor: pointer; border: 0; background: var(--bc); border-radius: 99px; padding: 11px 22px; color: #fff;
  font: 900 15px/1.1 var(--body); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 4px 0 var(--bd);
  transition: transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 1px 0 var(--bd); }
.btn small { font-weight: 800; opacity: .8; }
.btn kbd { margin-left: 4px; }
.btn.primary { --bc: var(--red); --bd: var(--red-d); background: var(--stripes-soft), linear-gradient(180deg, #ff6b7a, var(--red)); }
.btn.go { --bc: var(--green); --bd: var(--green-d); background: linear-gradient(180deg, #5ef09a, var(--green)); color: #0d2a19; }
.btn.go small { color: #0d2a19; }
.btn.blue { --bc: var(--blue); --bd: var(--blue-d); background: linear-gradient(180deg, #6aa8ff, var(--blue)); }
.btn.big { font: 400 22px/1 var(--display); padding: 14px 32px; letter-spacing: .3px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.ghost { --bc: var(--card); }
.btn.danger { --bc: var(--red); --bd: var(--red-d); }
.btn.disabled { opacity: .4; cursor: not-allowed; transform: none; filter: grayscale(.6); }

/* ---------------- Home ---------------- */
.home { display: grid; grid-template-columns: minmax(0, 600px) 320px; justify-content: space-between; align-items: center; gap: 30px; max-width: 1240px; }
/* Logo a coprifronte, intero: fascia di stoffa blu con le estremita che girano dietro la testa,
   nodo con le code a destra, placca di metallo con rivetti, lettere sfumate con contorno spesso,
   la O di Bonk e il vortice di Konoha. Misure in em: tutto scala con il font-size di .logo */
.logo { position: relative; display: inline-block; margin: 0 0 22px 0; padding: .14em .5em 0 .06em; font: 400 clamp(52px, 8vw, 92px)/1 var(--display); }
.logo-mark { position: relative; display: inline-block; isolation: isolate; rotate: -3deg; padding: 0 .82em; }
.logo-band {
  position: absolute; left: 0; right: 0; top: 50%; height: .62em; margin-top: -.27em; border-radius: .34em / .31em; z-index: -2;
  background:
    linear-gradient(90deg, rgba(0,0,0,.55), transparent 9%, transparent 91%, rgba(0,0,0,.55)),
    linear-gradient(180deg, #3a4f8a, #1f2d5e 60%, #141c3a);
  box-shadow: 0 .07em 0 rgba(0,0,0,.35);
}
.logo-band::before { content: ''; position: absolute; inset: .07em .2em; border-block: 2px dashed rgba(255,255,255,.14); }
/* nodo e code che svolazzano */
.logo-knot { position: absolute; right: .2em; top: 50%; width: .3em; height: .48em; margin-top: -.2em; border-radius: .1em; z-index: -1; background: linear-gradient(180deg, #2c3d74, #18224a); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.logo-tail {
  position: absolute; left: .18em; top: .2em; width: .72em; height: .2em; border-radius: 0 .12em .12em 0;
  background: linear-gradient(90deg, #1f2d5e, #3a4f8a); box-shadow: 0 .04em 0 rgba(0,0,0,.3);
  transform-origin: left center; animation: logo-flap 1.7s ease-in-out infinite;
}
.logo-tail.b { top: .26em; width: .58em; animation-delay: -.7s; animation-name: logo-flap-b; }
@keyframes logo-flap { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(32deg) scaleX(.9); } }
@keyframes logo-flap-b { 0%, 100% { transform: rotate(48deg) scaleX(.92); } 50% { transform: rotate(64deg); } }
/* placca metallica con riflesso che passa ogni tanto */
.logo-plate {
  position: absolute; left: .9em; right: .9em; top: 50%; height: 1.12em; margin-top: -.5em; border-radius: .16em; overflow: hidden; z-index: -1;
  background: linear-gradient(180deg, #f4f7fa, #c3ccd5 42%, #8f9aa6 56%, #cdd5dc);
  box-shadow: inset 0 0 0 .045em var(--ink), inset 0 .1em 0 .1em rgba(255,255,255,.3), 0 .08em 0 rgba(0,0,0,.4);
}
.logo-plate::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 48%, transparent 60%);
  animation: plate-shine 7s ease-in-out 1.5s infinite;
}
@keyframes plate-shine { 0%, 82% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.logo-plate i {
  position: absolute; width: .12em; height: .12em; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #7a8490); box-shadow: 0 0 0 2px var(--ink);
}
.logo-plate i:nth-child(1) { left: .12em; top: .12em; } .logo-plate i:nth-child(2) { right: .12em; top: .12em; }
.logo-plate i:nth-child(3) { left: .12em; bottom: .12em; } .logo-plate i:nth-child(4) { right: .12em; bottom: .12em; }
/* scritta: ogni lettera ha il contorno scuro dietro e il riempimento sfumato davanti */
.logo h1 { position: relative; margin: 0; padding: 0 .2em; display: flex; align-items: center; white-space: nowrap; font: inherit; line-height: 1.15; letter-spacing: .01em; }
.logo .lw { display: inline-block; isolation: isolate; }
.logo .ll { position: relative; display: inline-block; color: transparent; -webkit-background-clip: text; background-clip: text; }
.logo .ll::before { content: attr(data-t); position: absolute; left: 0; top: 0; z-index: -1; color: var(--ink); -webkit-text-stroke: .16em var(--ink); text-shadow: 0 .09em 0 rgba(0,0,0,.4); }
.logo .ll.org { background-image: linear-gradient(180deg, #ffe066 0%, #ffb02a 42%, #ff7a12 58%, #e8560a 100%); }
.logo .ll.wht { background-image: linear-gradient(180deg, #fff 0%, #fff 45%, #d7e0ea 58%, #b9c6d4 100%); }
/* la O: cerchio e ombra fermi, gira solo la spirale */
.logo-o { width: .74em; height: .74em; margin: .05em .03em 0; flex: none; filter: drop-shadow(0 .09em 0 rgba(0,0,0,.4)); }
.logo-o circle { fill: url(#logo-og); stroke: var(--ink); stroke-width: 9; }
.logo-o path { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linecap: round; transform-box: view-box; transform-origin: 50% 50%; animation: logo-spin 9s linear infinite; }
.logo:hover .logo-o path { animation-duration: .9s; }
@keyframes logo-spin { to { transform: rotate(360deg); } }
/* sottotitolo tra due kunai */
.logo-tag {
  position: relative; display: flex; gap: 9px; align-items: center; margin: 14px 0 0 .82em;
  font: 900 13px/1 var(--body); letter-spacing: 2.5px; text-transform: uppercase; color: #ffe2b8; text-shadow: 0 2px 4px #000;
}
.logo-tag .ver-chip { margin-left: 4px; letter-spacing: 0; text-transform: none; }
.kunai { width: 36px; height: 9px; flex: none; background: linear-gradient(90deg, var(--ink) 0 30%, #d3dae1 30%); clip-path: polygon(0 35%, 30% 35%, 30% 0, 100% 50%, 30% 100%, 30% 65%, 0 65%); filter: drop-shadow(0 1px 0 #000); }
.kunai.r { transform: scaleX(-1); }
@media (max-width: 640px) {
  .logo-tag { gap: 6px; margin-top: 12px; font-size: 11px; letter-spacing: 1.2px; white-space: nowrap; }
  .kunai { width: 22px; height: 7px; }
  .home .logo { font-size: 40px; padding-left: .25em; }
}

.tiles { display: grid; grid-template-columns: 1.35fr 1fr .8fr; gap: 10px; }
.tile-col { display: flex; flex-direction: column; gap: 10px; }
.tile {
  --tc: var(--blue);
  position: relative; cursor: pointer; border: 3px solid rgba(255,255,255,.18); border-radius: 18px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; text-align: left; overflow: hidden; color: #fff;
  background: var(--stripes), linear-gradient(135deg, color-mix(in srgb, var(--tc) 80%, #fff), var(--tc) 55%, color-mix(in srgb, var(--tc) 70%, #000));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--tc) 45%, #000), var(--shadow); transition: transform .12s, border-color .15s;
}
.tile:hover { transform: translateY(-3px) rotate(-.4deg); border-color: #fff; }
.tile b { display: block; font: 400 19px/1.05 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.tile small { display: block; font: 800 11px/1.25 var(--body); opacity: .92; margin-top: 3px; }
.tile-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 3px rgba(255,255,255,.25); }
.tile.play { min-height: 130px; border-color: rgba(255,255,255,.55); }
.tile.play b { font-size: 34px; }
.tile.play .tile-ico { width: 62px; height: 62px; font-size: 30px; background: var(--ink); }
.tile.tall { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.tile-col .tile { flex: 1; padding: 9px 12px; }
.tile-col .tile b { font-size: 16px; }
.tile-col .tile .tile-ico { width: 34px; height: 34px; font-size: 17px; }

.squares { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 12px; }
.square {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 74px; padding: 8px 4px; border-radius: 16px; border: 0; color: #fff; text-align: center;
  background: rgba(36, 29, 25, .92); box-shadow: inset 0 -4px 0 var(--sq, var(--blue)), var(--shadow); transition: transform .12s;
}
button.square:hover { transform: translateY(-3px); }
div.square { cursor: default; }
.square .sq-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 16px; }
.square b { font: 400 14px/1 var(--display); }
.square small { font: 800 10px/1 var(--body); color: var(--muted); }

/* Riquadro saga a destra, stile classifica */
.saga-card { border-radius: 20px; }
.saga-card .box-head { --hc: var(--orange); padding: 12px 14px; font-size: 22px; }
.saga-card .box-head small { font-size: 11px; }
.saga-list { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.saga-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--card-2); border: 2px solid transparent;
}
.saga-row.cur { border-color: var(--yellow); background: var(--stripes-soft), var(--card-3); }
.saga-row.locked { opacity: .5; }
.saga-row.locked img { filter: brightness(0) opacity(.5); }
.saga-row .num { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card); font: 900 11px/1 var(--body); }
.saga-row.done .num { background: var(--green); color: var(--ink); }
.saga-row img { width: 46px; height: 39px; flex: none; }
.saga-row div { flex: 1; min-width: 0; }
.saga-row b { display: block; font: 400 14px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saga-row small { display: block; font: 800 11px/1.2 var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saga-card .btn { width: calc(100% - 20px); margin: 4px 10px 12px; }

.foot { margin-top: 14px; color: var(--muted); font-size: 12px; text-shadow: 0 1px 4px #000; }

/* ---------------- Saga ---------------- */
.chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.chapter {
  cursor: pointer; text-align: left; padding: 0; background: var(--card); border: 3px solid var(--line); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; position: relative; transition: transform .12s, border-color .15s; box-shadow: var(--shadow);
}
.chapter:hover { transform: translateY(-3px); }
.chapter.sel { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 201, 60, .25), var(--shadow); }
.chapter.locked { cursor: not-allowed; transform: none; }
.chapter.locked .ch-art { filter: grayscale(1) brightness(.6); }
.chapter.locked .ch-boss { filter: brightness(0) opacity(.6); }
.ch-art {
  --tc: var(--red); position: relative; height: 112px; display: grid; place-items: center;
  background: var(--stripes), radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--tc) 75%, #fff), var(--tc) 60%, color-mix(in srgb, var(--tc) 60%, #000));
}
.chapter.done .ch-art { --tc: var(--green); }
.ch-num {
  position: absolute; top: 8px; left: 8px; padding: 4px 10px; border-radius: 99px; background: var(--ink);
  font: 900 11px/1 var(--body); letter-spacing: .8px; text-transform: uppercase; color: #fff;
}
.ch-boss { width: 117px; height: 99px; filter: drop-shadow(0 5px 0 rgba(0,0,0,.3)); }
.ch-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ch-name { font: 400 19px/1.1 var(--display); }
.ch-place { font-size: 12px; color: var(--muted); }
.ch-foe { font-size: 12px; color: #e8dcc8; }
.ch-foe b { color: #ff8b97; }
.ch-unlock { font-size: 12px; color: var(--green); }
.ch-state { margin-top: auto; padding-top: 6px; }
.ch-state .chip { --chip: var(--card-3); }
.chapter.done .ch-state .chip { --chip: var(--green-d); }
.chapter.sel .ch-state .chip { --chip: var(--red); }

.bottom-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-top: 16px;
  padding: 12px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.bottom-bar .sub { margin: 0; text-align: left; }

/* ---------------- Selezione ninja ---------------- */
.select-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.hero { padding: 16px; }
.hero-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.hero-pic {
  position: relative; width: 150px; height: 150px; flex: none; border-radius: 18px; border: 4px solid #fff; display: grid; place-items: center;
  background: var(--stripes), radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 65%, color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: 0 5px 0 rgba(0,0,0,.35);
}
.hero-pic img { width: 130px; height: 110px; filter: drop-shadow(0 5px 0 rgba(0,0,0,.25)); }
.hero-pic::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 14px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.2); z-index: -1; }
.hero-id { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.hero-tag { font: 900 11px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hero-name { font: 400 40px/1 var(--display); }
.hero-title { font-size: 14px; color: #e8dcc8; }
.hero-id .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-stats { min-width: 200px; flex: 1; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 12px; }
.hero-stats span { color: #e8dcc8; }
.hero-stats .meter { height: 9px; }
.hero-stats .meter i { background: linear-gradient(90deg, var(--blue-d), var(--blue)); box-shadow: none; }
.hero-stats b { text-align: right; font-weight: 900; }
.hero-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.hero-cols .box { box-shadow: none; background: var(--card-2); }
.hero-cols .box-head { font-size: 15px; padding: 7px 12px; }
.hero-cols p { margin: 0; font-size: 13px; line-height: 1.45; color: #e8dcc8; }
.hero-cols p + p { margin-top: 6px; }
.hero-cols p b { color: #fff; }
.evo-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.evo-line span { padding: 3px 8px; border-radius: 99px; background: var(--card-3); }
.evo-line i { font-style: normal; color: var(--muted); }
.evo-special { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--card-3); font-size: 12px; display: grid; gap: 2px; }
.evo-special small { color: var(--muted); }

.roster .box-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rtile {
  --c: var(--blue);
  position: relative; cursor: pointer; aspect-ratio: 1; border-radius: 14px; border: 3px solid rgba(255,255,255,.18); padding: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: var(--stripes), linear-gradient(160deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 65%, #000));
  box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .12s;
}
.rtile:hover { transform: translateY(-3px); }
.rtile.sel { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,201,60,.35), 0 4px 0 rgba(0,0,0,.35); }
.rtile img { width: 92%; height: auto; margin-bottom: auto; margin-top: 6%; }
.rtile b { width: 100%; padding: 3px 0 5px; background: rgba(0,0,0,.35); font: 400 13px/1 var(--display); }
.rtile.locked { cursor: not-allowed; background: var(--card-3); }
.rtile.locked img { filter: brightness(0) opacity(.4); }
.rtile.locked b { color: var(--muted); }
.rtile .lock { position: absolute; top: 5px; right: 6px; font-size: 13px; }
.roster .box-foot { padding: 0 14px 14px; }

.opt-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  cursor: pointer; border: 2px solid transparent; border-radius: 99px; padding: 7px 16px; font: 900 13px/1.1 var(--body);
  background: var(--card-3); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.pill small { color: var(--gold); font-weight: 800; }
.pill.sel { border-color: var(--yellow); background: var(--stripes-soft), #4a3a30; }
.pill.summon { display: inline-flex; align-items: center; gap: 6px; padding: 3px 14px 3px 5px; }
.pill.summon img, .seal-row img { width: 34px; height: 29px; }
.opts { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 240px; }
.opts .lbl { font: 900 11px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-right: 4px; }

/* ---------------- Dojo ---------------- */
.dojo-cats { display: flex; flex-direction: column; gap: 16px; }
.dojo-cat h3 { margin: 0 0 8px; font: 900 12px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.dojo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.dojo-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.dojo-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--card-3); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.dojo-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dojo-info b { font: 400 17px/1.1 var(--display); }
.dojo-info small { color: var(--muted); font-size: 12px; }
.dojo-info .meter { margin-top: 5px; height: 12px; }
.dojo-info .meter b { font: 900 9px/12px var(--body); }
.dojo-row .btn { flex: none; }
.dojo-row .btn.primary { --bc: var(--yellow); --bd: #b8860b; background: linear-gradient(180deg, #ffe07a, var(--yellow)); color: var(--ink); }

/* ---------------- Bestiario ---------------- */
.dex-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.beasts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 66vh; overflow-y: auto; padding: 14px; }
.beast {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 14px; padding: 6px 4px 18px; border: 3px solid rgba(255,255,255,.12);
  background: var(--stripes), linear-gradient(160deg, #6aa8ff, var(--blue) 60%, var(--blue-d));
}
.beast.boss { background: var(--stripes), linear-gradient(160deg, #b294ff, var(--purple) 60%, var(--purple-d)); }
.beast img { width: 84%; height: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.beast b { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px 4px; background: rgba(0,0,0,.35); font: 400 12px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.beast .no { position: absolute; top: 5px; left: 7px; font: 900 10px/1 var(--body); opacity: .8; }
.beast .cnt { position: absolute; top: 4px; right: 5px; font: 900 10px/1 var(--body); background: var(--ink); border-radius: 99px; padding: 2px 6px; }
.beast.locked { background: var(--card-2); border-color: transparent; }
.beast.locked img { filter: brightness(0) opacity(.35); }
.beast.locked b { background: transparent; color: var(--muted); }
.dex-side .box-body p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: #e8dcc8; }
.dex-side .meter { height: 16px; margin-bottom: 12px; }
.dex-side .meter b { font-size: 11px; line-height: 16px; }

/* ---------------- Comandi ---------------- */
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.key { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 8px 10px; border-radius: 12px; background: var(--card-2); }
.help-text { margin: 12px 0 0; font-size: 13px; line-height: 1.55; color: #e8dcc8; }

/* ---------------- Level up / scelte evento ---------------- */
.levelup-screen { text-align: center; }
.levelup-screen .ribbon { margin-bottom: 20px; }
.lvl-title { margin: 0; }
.cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.card {
  --kc: var(--orange);
  position: relative; cursor: pointer; width: 236px; min-height: 290px; padding: 0 0 16px; border-radius: 20px; overflow: hidden;
  background: var(--card); color: var(--text); border: 3px solid var(--line-2);
  box-shadow: 0 6px 0 rgba(0,0,0,.45), var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: pop .3s ease-out both; transition: transform .12s, border-color .15s;
}
.card:hover { transform: translateY(-6px); border-color: var(--kc); }
.card.passive { --kc: var(--blue); }
.card.heal, .card.ryo { --kc: var(--green); }
.card.ev-opt { --kc: var(--purple); min-height: 0; }
.card.ev-opt.disabled { opacity: .45; filter: grayscale(.7); cursor: not-allowed; }
.card.ev-opt.disabled:hover { transform: none; }
/* 4 carte (Quarta Pergamena) ed Escludi */
.cards:has(> .card:nth-child(4)) .card { width: 214px; }
.card.ban-pick { --kc: var(--red); border-color: var(--red); animation: none; }
.card.ban-pick:hover { transform: translateY(-6px) rotate(-1deg); }
.card.disabled { opacity: .45; filter: grayscale(.7); cursor: not-allowed; }
.card.disabled:hover { transform: none; }
.pill.locked { cursor: not-allowed; opacity: .6; }
.diff-badge { margin-left: 4px; font-size: .95em; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.92); } }
.card-top {
  align-self: stretch; height: 92px; display: grid; place-items: center; margin-bottom: 22px; position: relative;
  background: var(--stripes), linear-gradient(135deg, color-mix(in srgb, var(--kc) 75%, #fff), var(--kc) 60%, color-mix(in srgb, var(--kc) 60%, #000));
}
.card-key { position: absolute; top: 9px; left: 10px; }
.card-tag { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,.3); font: 900 10px/1.2 var(--body); text-transform: uppercase; letter-spacing: 1px; color: #fff; }
.card-icon {
  position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-size: 38px; background: var(--card-2); border: 4px solid var(--card); box-shadow: 0 0 0 3px var(--kc);
}
.card-name { font: 400 22px/1.1 var(--display); padding: 6px 12px 0; }
.card-lvl { font: 900 12px/1 var(--body); min-height: 14px; }
.card-lvl:not(:empty) { padding: 4px 10px; border-radius: 99px; background: var(--kc); color: #fff; }
.card-desc { font-size: 14px; line-height: 1.4; color: #e8dcc8; padding: 0 14px; font-weight: 700; }
/* Fase 1 (growth.js): rarita, natura del jutsu, potenziamento e valori prima -> dopo */
.card-tag[style] { background: color-mix(in srgb, var(--tagc) 70%, #000); }
.card.rar { border-color: color-mix(in srgb, var(--rar) 70%, var(--line-2)); }
.card.rar-epic, .card.rar-legend { box-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 22px color-mix(in srgb, var(--rar) 55%, transparent), var(--shadow); }
.card-rar { position: absolute; top: 72px; left: 10px; padding: 3px 9px; border-radius: 99px; background: var(--rar); color: var(--ink); font: 900 10px/1.2 var(--body); text-transform: uppercase; letter-spacing: .8px; }
.card-up { display: block; color: #fff; margin-bottom: 6px; }
.card-form { display: block; margin-top: 6px; color: var(--muted, #b5a28c); font-size: 12px; }
.card-diff { display: grid; gap: 3px; margin-top: 4px; font-size: 12.5px; text-align: left; }
.card-diff div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.05); }
.card-diff span { color: #aeb5cc; }
.card-diff b { color: #fff; white-space: nowrap; }
.card-diff i { font-style: normal; color: var(--green); margin: 0 4px; }
.event-screen .sub { max-width: 620px; margin-left: auto; margin-right: auto; }
.event-screen .sub b { color: var(--yellow); }
.event-screen .sub.small { margin-top: 16px; font-size: 12px; }

/* ---------------- Pausa e fine partita ---------------- */
.run-panel { max-width: 1060px; padding: 14px; border-radius: 26px; background: rgba(23, 28, 41, .96); border: 1px solid var(--line); box-shadow: var(--shadow); }
.run-head {
  --c: var(--blue);
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; flex-wrap: wrap;
  background: var(--stripes), linear-gradient(90deg, color-mix(in srgb, var(--c) 85%, #000), var(--c) 55%, color-mix(in srgb, var(--c) 60%, var(--yellow)));
}
.run-head.win { --c: var(--green-d); }
.run-head.lose { --c: var(--red-d); }
.run-pic { position: relative; width: 78px; height: 78px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.run-pic img { width: 70px; height: 59px; }
.run-pic span { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--ink); border-radius: 99px; padding: 2px 8px; font: 900 10px/1.3 var(--body); white-space: nowrap; }
.run-id { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 5px; }
.run-kicker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font: 900 11px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; }
.run-kicker .chip { --chip: var(--ink); font-size: 10px; }
.run-name { font: 400 34px/1 var(--display); -webkit-text-stroke: 5px rgba(0,0,0,.35); paint-order: stroke fill; }
.run-id .bar { max-width: 300px; height: 12px; }
.run-id .bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #6ff5a6, var(--green)); }
.run-id .bar span { line-height: 12px; font-size: 9px; }
.tiles-stat { display: flex; gap: 6px; flex-wrap: wrap; }
.tiles-stat > div { min-width: 74px; padding: 8px 10px; border-radius: 14px; background: rgba(15, 11, 9, .85); text-align: center; }
.tiles-stat b { display: block; font: 400 24px/1 var(--display); }
.tiles-stat small { display: block; margin-top: 3px; font: 900 9px/1 var(--body); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.tiles-stat .gold b { color: var(--gold); }
.run-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.run-cols .box { box-shadow: none; }
.build-list { display: flex; flex-direction: column; gap: 6px; }
.build-list > div { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--card-2); font-size: 13px; }
.build-list .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 16px; flex: none; }
.build-list .nm { flex: 1; }
.build-list .lv { font: 900 11px/1 var(--body); padding: 3px 8px; border-radius: 99px; background: var(--yellow); color: var(--ink); }
.empty-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.stat-table { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: 13px; }
.stat-table span { padding: 5px 10px; border-radius: 8px; background: var(--card-2); }
.stat-table b { padding: 5px 10px; border-radius: 8px; background: var(--card-2); text-align: right; font-weight: 900; }
.stat-table b.up { color: var(--green); }
.hint-line { margin: 12px 4px 0; font-size: 11px; color: var(--muted); line-height: 1.8; }
.hint-line kbd { height: 17px; min-width: 22px; font-size: 10px; margin-right: 3px; }
.run-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.run-actions .spacer { flex: 1; }
.rec { color: var(--gold); }

.unlock-box { display: flex; gap: 12px; align-items: center; background: var(--stripes-soft), rgba(63, 212, 122, .14); border: 2px solid rgba(63, 212, 122, .45); border-radius: 14px; padding: 6px 14px; margin-bottom: 10px; }
.unlock-box img { width: 78px; height: 66px; }
.unlock-box small { display: block; color: var(--muted); }
.seal-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seal-row span { display: inline-flex; align-items: center; gap: 4px; background: var(--card-2); border: 2px solid transparent; border-radius: 99px; padding: 2px 10px 2px 4px; font-size: 13px; }
.seal-row span.new { border-color: var(--cyan); }
.seal-row i { font-style: normal; font-size: 10px; font-weight: 900; color: var(--cyan); }
.seal-row small { width: 100%; color: var(--gold); }

/* ---------------- Dialoghi ---------------- */
#overlay.dlg-mode { background: linear-gradient(180deg, transparent 45%, rgba(12, 9, 7, .8)); align-items: flex-end; }
.dialogue { width: 100%; max-width: 920px; margin: 0 auto 18px; display: flex; align-items: flex-end; cursor: pointer; animation: rise .2s ease-out; }
.dialogue.narration .dlg-box { text-align: center; font-style: italic; }
.portrait { width: 182px; height: 154px; margin-right: -18px; position: relative; z-index: 1; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.portrait.enemy { transform: scaleX(-1); order: 2; margin: 0 0 0 -18px; }
.dlg-box {
  --sc: var(--blue);
  position: relative; flex: 1; min-height: 124px; background: var(--card); color: var(--text); border: 3px solid var(--line-2); border-radius: 20px;
  box-shadow: 0 6px 0 rgba(0,0,0,.45), var(--shadow); padding: 26px 24px 12px; display: flex; flex-direction: column; gap: 6px;
}
.dlg-name {
  position: absolute; top: -16px; left: 22px; padding: 5px 18px 7px; border-radius: 10px; transform: skewX(-8deg);
  background: var(--stripes), var(--sc); font: 400 19px/1 var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3);
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.dialogue .portrait.enemy ~ .dlg-box .dlg-name { left: auto; right: 22px; }
.dlg-text { font-size: 17px; line-height: 1.5; font-weight: 700; flex: 1; }
.dlg-hint { font-size: 11px; color: var(--muted); text-align: right; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1000px) {
  .home { grid-template-columns: 1fr; justify-items: center; }
  .home-left { width: 100%; max-width: 620px; }
  .saga-card { width: 100%; max-width: 620px; }
  .select-grid, .dex-wrap { grid-template-columns: 1fr; }
  .run-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hud-player { width: 56vw; padding: 5px 10px 5px 5px; gap: 6px; }
  .hud-pic { width: 44px; height: 44px; border-width: 2px; }
  .hud-pic img { width: 40px; height: 34px; }
  .hud-name { font-size: 14px; }
  .hud-center { left: auto; right: 118px; transform: none; min-width: 0; padding: 4px 10px 6px; top: 12px; border-radius: 16px; }
  .hud-mode { display: none; }
  .timer { font-size: 22px; }
  .stats { flex-direction: column; gap: 2px; }
  .stats > span { font-size: 11px; padding: 1px 8px; }
  #bossbar { top: 120px; }
  .slots { grid-auto-columns: 30px; gap: 3px; padding: 4px; }
  .slot { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .bottom { gap: 8px; flex-wrap: wrap; }
  .ab { width: 50px; height: 50px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile.play { grid-column: 1 / -1; min-height: 100px; }
  .squares { grid-template-columns: repeat(4, 1fr); grid-auto-flow: row; }
  .card { width: 100%; min-height: 0; }
  .run-cols, .hero-cols { grid-template-columns: 1fr; }
  .roster .box-body { grid-template-columns: repeat(4, 1fr); }
  .portrait { width: 104px; height: 88px; }
  .dlg-text { font-size: 15px; }
  .head-extra { margin-left: 0; }
}

/* =========================================================
   Ufficio dell'Hokage, missioni, villaggi
   ========================================================= */
.office-card .box-head { --hc: var(--red); }
.office-hokage { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
.office-hokage img { width: 58px; height: 49px; flex: none; image-rendering: pixelated; background: var(--card-2); border-radius: 12px; padding: 2px; }
.office-hokage small { display: block; font: 800 11px/1.2 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.office-hokage b { display: block; font: 400 18px/1.1 var(--display); }
.office-hokage.big { padding: 0 0 12px; align-items: flex-start; }
.office-hokage.big img { width: 84px; height: 71px; }
.office-hokage.big small { text-transform: none; letter-spacing: 0; font-weight: 700; margin-top: 4px; }

.rank-box { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; margin: 10px 14px 0; padding: 10px 12px; border-radius: 14px; background: var(--card-2); }
.office-side .rank-box { margin: 0 0 12px; }
.rank-box .rank-ico { font-size: 26px; grid-row: span 2; }
.rank-box small { display: block; font: 800 10px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.rank-box b { font: 400 20px/1.1 var(--display); color: var(--gold); }
.rank-meter { grid-column: 2; }
.rank-meter .meter b { font-size: 10px; }

.mrank {
  flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center;
  background: var(--mr); color: var(--ink); font: 400 15px/1 var(--display); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.saga-row .mrank { width: 26px; height: 26px; }
.saga-row .row-count { flex: none; font: 900 12px/1 var(--body); color: var(--muted); }
.saga-row.done .row-count { color: var(--green); }

.board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mtab {
  padding: 8px 14px; border-radius: 99px; border: 2px solid transparent; cursor: pointer;
  background: var(--card); color: var(--text); font: 400 15px/1 var(--display);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.mtab:hover { border-color: var(--mr); }
.mtab.sel { background: var(--mr); color: var(--ink); }
.mtab.locked { opacity: .45; cursor: not-allowed; }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mission {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px 14px; border-radius: 16px; cursor: pointer;
  background: var(--stripes-soft), var(--card); border: 3px solid var(--line-2); color: var(--text); font: 700 13px/1.35 var(--body);
  box-shadow: var(--shadow); transition: transform .12s, border-color .12s;
}
.mission:hover { transform: translateY(-2px); border-color: var(--mr); }
.mission.sel { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 201, 60, .25), var(--shadow); }
.mission.done { background: var(--stripes-soft), linear-gradient(160deg, rgba(63, 212, 122, .12), transparent 60%), var(--card); }
.m-top { display: flex; align-items: center; gap: 8px; }
.m-land { padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--vc) 35%, var(--card-3)); font: 800 11px/1.5 var(--body); }
.m-done { margin-left: auto; color: var(--green); font: 900 12px/1 var(--body); }
.m-name { font: 400 19px/1.1 var(--display); }
.m-brief { color: #dccfb8; font-weight: 600; }
.m-goal { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 10px; background: var(--card-3); font-weight: 900; color: var(--gold); }
.m-goal img { width: 28px; height: 24px; image-rendering: pixelated; }
.m-foot { display: flex; gap: 10px; flex-wrap: wrap; font: 800 11px/1.3 var(--body); color: var(--muted); margin-top: auto; }
.m-foot .gold { color: var(--gold); }

.rank-ladder { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.rank-ladder div { display: grid; grid-template-columns: 26px 1fr; align-items: center; column-gap: 8px; padding: 5px 8px; border-radius: 10px; background: var(--card-2); opacity: .55; }
.rank-ladder div.got { opacity: 1; box-shadow: inset 3px 0 0 var(--gold); }
.rank-ladder span { grid-row: span 2; font-size: 18px; text-align: center; }
.rank-ladder b { font: 400 14px/1.1 var(--display); }
.rank-ladder small { font: 700 10px/1.2 var(--body); color: var(--muted); }

.villages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.village { border-radius: 18px; overflow: hidden; background: var(--card); border: 3px solid var(--line-2); box-shadow: var(--shadow); }
.v-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--stripes), var(--vc); }
.v-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: rgba(0,0,0,.28); }
.v-head b { display: block; font: 400 22px/1 var(--display); text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.v-head small { display: block; font: 800 11px/1.2 var(--body); opacity: .9; }
.v-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.v-row { display: flex; justify-content: space-between; gap: 8px; font: 700 12px/1.3 var(--body); }
.v-row span { color: var(--muted); }
.v-ninjas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.v-ninjas img { width: 38px; height: 32px; image-rendering: pixelated; background: var(--card-2); border-radius: 8px; }
.v-ninjas img.locked { filter: brightness(0) opacity(.5); }

.hk-mount { position: relative; padding: 30px 14px 14px; border-radius: 16px; overflow: hidden;
  background:
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(60,40,24,.28) 34px 37px, transparent 37px 52px),
    repeating-linear-gradient(90deg, transparent 0 61px, rgba(60,40,24,.14) 61px 63px),
    linear-gradient(180deg, #a08868 0%, #8a7256 55%, #6c5a44 100%);
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.12); }
/* cresta boscosa in cima alla roccia */
.hk-mount::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 22px;
  background:
    radial-gradient(14px 12px at 14px 12px, #4f7a3a 98%, transparent) 0 0 / 42px 22px repeat-x,
    radial-gradient(12px 10px at 34px 14px, #3f6a34 98%, transparent) 0 0 / 42px 22px repeat-x,
    linear-gradient(180deg, #3f6a34 0 8px, transparent 8px); }
.hk-row { position: relative; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 10px; max-width: calc(var(--n, 7) * 150px); margin: 0 auto; }
.hk { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-width: 0; }
/* il volto scolpito: ritratto ridotto a pietra, in un incavo della parete */
.hk-stone { position: relative; width: 100%; max-width: 116px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 46% 46% 40% 40%;
  background: radial-gradient(circle at 50% 38%, #c2ab88, #8e785a 70%, #6e5c44);
  box-shadow: inset 0 6px 10px rgba(0,0,0,.35), inset 0 -3px 0 rgba(255,255,255,.12), 0 3px 0 rgba(0,0,0,.25); }
.hk-stone img { width: 92%; image-rendering: pixelated; filter: grayscale(1) sepia(.9) contrast(1.15) brightness(.82) drop-shadow(0 3px 0 rgba(40,26,14,.55)); }
.hk.fresh .hk-stone { background: radial-gradient(circle at 50% 38%, #d8c4a2, #a8916e 70%, #85704f); }
.hk.fresh .hk-stone img { filter: grayscale(1) sepia(.7) contrast(1.1) brightness(.95) drop-shadow(0 3px 0 rgba(40,26,14,.5)); }
.hk.cur .hk-stone { box-shadow: inset 0 6px 10px rgba(0,0,0,.35), 0 0 0 3px var(--gold), 0 0 18px rgba(255, 201, 60, .45); }
/* il prossimo posto: roccia grezza con le impalcature */
.hk.next .hk-stone { background:
    linear-gradient(90deg, transparent 12%, #7a5634 12% 17%, transparent 17% 83%, #7a5634 83% 88%, transparent 88%),
    linear-gradient(180deg, transparent 30%, #8a6440 30% 35%, transparent 35% 68%, #8a6440 68% 73%, transparent 73%),
    radial-gradient(circle at 50% 40%, #9a8466, #7e6a50 70%, #66553f);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.hk.next .hk-stone span { font: 400 34px/1 var(--display); color: rgba(255,255,255,.35); }
.hk.next .hk-plate { opacity: .7; }
.hk-plate { width: 100%; padding: 5px 4px 6px; border-radius: 8px; background: rgba(40, 28, 18, .55); border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 1px; }
.hk-plate b { font: 400 13px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-plate small { font: 700 10px/1.2 var(--body); color: #e0d4c0; }
.hk.cur .hk-plate small { color: var(--gold); }
.hk-n { font: 400 12px/1 var(--display); color: var(--gold); }

.kits { display: flex; flex-wrap: wrap; gap: 4px; }
.kit { padding: 3px 9px; border-radius: 99px; background: var(--card-3); font: 800 11px/1.4 var(--body); }
.kit.locked { opacity: .55; border: 1px dashed currentColor; background: transparent; }
.kit.locked small { font: 800 10px/1 var(--body); opacity: .8; }
.pts-line { margin: 0 0 8px; font: 900 13px/1.3 var(--body); color: var(--gold); }
.unlock-box.rankup .rank-ico { font-size: 34px; width: 50px; text-align: center; }

@media (max-width: 900px) {
  .board-grid { grid-template-columns: 1fr; }
  .hk-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .missions { grid-template-columns: 1fr; }
  .hk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.office-side .sub.small, .hokage-wall .sub.small { text-align: left; font-size: 12px; margin: 8px 0 0; }
.saga-screen .chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .saga-screen .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .saga-screen .chapters { grid-template-columns: 1fr; } }

/* ---------------- Strumenti ninja (items.js) ---------------- */
#items-row { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 60vw; }
#items-row.hidden { display: none; }
#items-row span { position: relative; width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; border-radius: 8px; background: rgba(36, 29, 25, .75); box-shadow: inset 0 0 0 2px var(--rc); }
#items-row i { position: absolute; bottom: -4px; right: -4px; font: 900 8px/1 var(--body); font-style: normal; background: var(--rc); color: #241d19; border-radius: 99px; padding: 2px 4px; }
.items-box { margin-top: 12px; box-shadow: none; }
.items-box .box-head small { font-weight: 600; }
.item-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.item-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 12px; background: var(--card-2); border-left: 4px solid var(--rc); font-size: 13px; }
.item-chip.new { box-shadow: inset 0 0 0 2px var(--cyan); }
.item-chip .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 15px; flex: none; }
.item-chip .nm { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.item-chip .nm small { color: var(--rc); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.item-chip .nm i { font-style: normal; font-size: 10px; font-weight: 900; color: var(--cyan); }
.item-chip b { font: 900 11px/1 var(--body); padding: 3px 7px; border-radius: 99px; background: var(--rc); color: #241d19; }
.new-note { margin-top: 8px; color: var(--cyan); }
.pill.bag-pill { box-shadow: inset 3px 0 0 var(--rc); }
@media (max-width: 640px) { #items-row { bottom: 70px; max-width: 90vw; } }

/* Jutsu combinati (fusions.js) */
.fusion-list { display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; margin-top: 12px; }
.fusion-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; background: var(--card-2); border-radius: 12px; padding: 8px 10px; }
.fusion-in { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 900; }
.fusion-out { display: flex; gap: 10px; align-items: center; }
.fusion-out .ico { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #7a6aff; font-size: 18px; }
.fusion-out b { font: 400 15px/1.1 var(--display); display: block; }
.fusion-out small { font-size: 12px; color: var(--muted); font-weight: 700; }
.fusion-row.locked .fusion-out .ico { background: var(--card-3); }
.fusion-hint { color: #c8b8ff; font-weight: 900; }
@media (max-width: 640px) { .fusion-row { grid-template-columns: 1fr; } }

/* Cercoteri nel Bestiario */
.dex-main { display: grid; gap: 14px; min-width: 0; }
.beasts.bijuu-grid { max-height: none; }
.beast.bijuu { background: var(--stripes), linear-gradient(160deg, #ffb070, var(--orange) 60%, #b8501a); }
.beast.bijuu.locked { background: var(--card-2); }

/* Reliquie leggendarie (relics.js): rombi dorati, diversi dagli strumenti */
#relics-row { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); display: flex; gap: 12px; }
#relics-row.hidden { display: none; }
#relics-row span { position: relative; width: 30px; height: 30px; transform: rotate(45deg); border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #3a2a10, #241d19); box-shadow: 0 0 0 2px #ffc93c, 0 0 10px rgba(255, 201, 60, .55), inset 0 0 0 2px var(--sc); }
#relics-row span::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--cd, 0) * 100%); background: rgba(12, 9, 7, .7); }
#relics-row span.on { box-shadow: 0 0 0 2px #7fe08a, 0 0 14px rgba(127, 224, 138, .8); }
#relics-row b { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-45deg); font-size: 15px; z-index: 1; }
.relics-box { margin-top: 12px; box-shadow: none; }
.relic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.relic-chip { display: flex; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 201, 60, .14), var(--card-2) 60%); box-shadow: inset 0 0 0 1px rgba(255, 201, 60, .45); font-size: 13px; }
.relic-chip.new { box-shadow: inset 0 0 0 2px var(--cyan); }
.relic-chip .ico, .relic-card .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; transform: rotate(45deg); border-radius: 6px; background: #2a2210; box-shadow: 0 0 0 2px #ffc93c, inset 0 0 0 2px var(--sc); font-size: 15px; }
.relic-chip .ico > *, .relic-card .ico > * { transform: rotate(-45deg); }
.relic-chip .nm { flex: 1; display: flex; flex-direction: column; line-height: 1.25; font-weight: 900; }
.relic-chip .nm small { color: var(--muted); font-size: 11px; font-weight: 700; }
.relic-chip .nm i { font-style: normal; font-size: 10px; color: var(--cyan); }
.relic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; margin-top: 12px; }
.relic-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 12px 10px 16px; border-radius: 12px; background: var(--card-2); border-left: 4px solid var(--sc); }
.relic-card .ico { margin-top: 4px; width: 34px; height: 34px; font-size: 17px; }
.relic-card b { font: 400 15px/1.1 var(--display); display: block; }
.relic-card .set { color: var(--sc); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.relic-card p { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.relic-card .lore { font-style: italic; opacity: .8; }
.relic-card.locked { border-left-color: var(--card-3); opacity: .7; }
.relic-card.locked .ico { box-shadow: 0 0 0 2px var(--card-3); background: var(--card-3); }
@media (max-width: 640px) { #relics-row { bottom: 104px; } .relic-list, .relic-grid { grid-template-columns: 1fr; } }

/* Missione del giorno (daily.js) */
.daily-tile { width: 100%; margin-top: 10px; padding: 9px 14px; }
.daily-tile .tile-ico { width: 38px; height: 38px; font-size: 19px; }
.daily-tile .dt-main { flex: 1; min-width: 0; }
.daily-tile .dt-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-tile .dt-side { flex: none; text-align: right; }
.daily-tile .dt-side i { font-style: normal; font-variant-numeric: tabular-nums; }
.daily-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.daily-screen .box-body p { margin: 0 0 10px; font-weight: 700; }
.dd-row { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.dd-mut { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; background: rgba(192, 48, 106, .18); box-shadow: inset 0 0 0 2px rgba(192, 48, 106, .55); }
.dd-mut .dd-ico { font-size: 34px; }
.dd-mut small { display: block; font: 900 10px/1 var(--body); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.dd-mut b { display: block; font: 400 22px/1.1 var(--display); }
.dd-mut p { margin: 2px 0 0 !important; font-size: 13px; }
.dd-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.dd-tier { padding: 8px; border-radius: 12px; text-align: center; background: rgba(15, 11, 9, .85); }
.dd-tier b { display: block; font: 400 20px/1 var(--display); }
.dd-tier span { display: block; margin-top: 4px; color: var(--gold); font-weight: 900; }
.dd-tier small { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--muted); }
.dd-tier.got { box-shadow: inset 0 0 0 2px var(--gold); }
.dd-cd { font-weight: 800; }
.dd-cd b { font-variant-numeric: tabular-nums; color: var(--gold); }
@media (max-width: 760px) { .daily-grid { grid-template-columns: 1fr; } .daily-tile .dt-side { display: none; } }

/* Covo dell'Akatsuki (tower.js) */
.tower-tile.locked { cursor: not-allowed; filter: grayscale(.7); opacity: .7; }
.tower-tile.locked:hover { transform: none; }
.tw-floors { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tw-floor { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(15, 11, 9, .85); }
.tw-floor.big { box-shadow: inset 0 0 0 2px rgba(192, 16, 42, .7); }
.tw-floor.got { background: rgba(138, 28, 42, .35); }
.tw-floor img { width: 34px; height: 34px; image-rendering: pixelated; flex: none; }
.tw-floor > div { flex: 1; min-width: 0; }
.tw-floor b { display: block; font: 400 16px/1.1 var(--display); }
.tw-floor b i { font: 900 9px/1 var(--body); font-style: normal; text-transform: uppercase; letter-spacing: .6px; padding: 2px 6px; border-radius: 6px; background: #c0102a; vertical-align: middle; }
.tw-floor small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.tw-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 400 15px/1 var(--display); background: #8a1c2a; }
.tw-sc { flex: none; font-weight: 900; color: var(--gold); white-space: nowrap; }
.tw-tiers { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.tw-tier { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(15, 11, 9, .85); }
.tw-tier b { font: 400 20px/1 var(--display); text-align: center; }
.tw-tier span { font-size: 12px; font-weight: 800; }
.tw-tier small { font-size: 10px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.tw-tier.got { box-shadow: inset 0 0 0 2px var(--gold); }
.tw-tier.got small { color: var(--gold); }
#tower-fade {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center; gap: 6px;
  background: radial-gradient(circle, #2a0a14, #07060c 70%); color: #fff; opacity: 0; pointer-events: none; transition: opacity .45s ease;
}
#tower-fade.on { opacity: 1; }
#tower-fade b { font: 400 54px/1 var(--display); text-shadow: 0 4px 0 #8a1c2a; }
#tower-fade small { font: 800 16px/1.2 var(--body); opacity: .85; }

/* Costumi, danni per jutsu, partita salvata */
.build-list .nm small.jdmg { display: block; font: 700 11px/1.3 var(--body); color: var(--muted); }
.build-list .nm small.jdmg b { color: var(--gold); }
.build-list .nm small.jdmg i { font-style: normal; opacity: .7; }
.costume-row .cos-lock { font-size: 16px; display: inline-grid; place-items: center; width: 34px; }
.costume-row .cos-stats { color: var(--muted); font: 700 11px/1.2 var(--body); margin-left: 4px; }
.resume-tile { margin-bottom: 10px; width: 100%; }
.resume-tile .tile-ico img { width: 40px; height: 34px; image-rendering: pixelated; }
.btn.on { border-color: var(--yellow); }

/* Missioni lunghe a zone (zones.js) */
.m-name .m-long { display: inline-flex; align-items: center; gap: 4px; font: 800 11px/1 var(--body); color: #d8a8ff; vertical-align: middle; }

/* ---------------- Varianti Rare (shiny.js) ---------------- */
.beast:has(.shiny-badge) { border-color: #ffd84a; box-shadow: 0 0 12px rgba(255, 216, 74, .5); }
.beast .shiny-badge { position: absolute; bottom: 22px; right: 4px; display: flex; align-items: center; gap: 1px; padding: 1px 5px 1px 1px; border-radius: 99px; background: linear-gradient(180deg, #fff0a0, #f2c230); color: var(--ink); font: 900 10px/1 var(--body); box-shadow: 0 0 10px rgba(255, 216, 74, .7); }
.beast .shiny-badge img { width: 26px; height: auto; filter: none; }
.shiny-row { margin-bottom: 10px; }
.shiny-row span { border-color: rgba(255, 216, 74, .55); }
.shiny-row span.new { border-color: #ffd84a; box-shadow: 0 0 10px rgba(255, 216, 74, .45); }

/* ---------------- Traguardi (challenges.js) ---------------- */
.square.has-new { position: relative; }
.square.has-new::after { content: ''; position: absolute; top: 7px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--red, #d8283a); box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.chal-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; max-height: 72vh; overflow-y: auto; padding-right: 4px; }
.chal-list { display: flex; flex-direction: column; gap: 8px; }
.chal { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--card-2); border: 2px solid transparent; border-radius: 14px; padding: 8px 10px; }
.chal.ready { border-color: var(--yellow); background: var(--stripes-soft), rgba(255, 201, 60, .12); }
.chal.claimed { opacity: .72; }
.chal-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 20px; }
.chal.claimed .chal-ico, .chal.ready .chal-ico { background: linear-gradient(180deg, #fff0a0, #f2c230); }
.chal-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chal-main b { font: 400 15px/1.1 var(--display); }
.chal-main small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.chal-main em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--gold, #ffd84a); }
.chal-main .meter { margin: 2px 0; }
.chal-tag { font: 900 11px/1 var(--body); color: var(--green); white-space: nowrap; }
.chal-tag.locked { color: var(--muted); font-size: 16px; }
.unlock-box.chal-box { background: var(--stripes-soft), rgba(255, 201, 60, .12); border-color: rgba(255, 201, 60, .5); }
.unlock-box.chal-box .rank-ico { font-size: 28px; width: 44px; text-align: center; }
#chal-toasts { position: fixed; top: 84px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.chal-toast { display: flex; gap: 10px; align-items: center; min-width: 240px; max-width: 320px; padding: 8px 14px 8px 8px; border-radius: 14px; color: #fff; background: rgba(36, 29, 25, .95); border: 2px solid var(--yellow); box-shadow: 0 0 18px rgba(255, 201, 60, .4), 0 6px 0 rgba(0,0,0,.3); animation: chalIn .35s ease-out; transition: opacity .5s, transform .5s; }
.chal-toast.out { opacity: 0; transform: translateX(30px); }
.chal-toast .ct-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: linear-gradient(180deg, #fff0a0, #f2c230); }
.chal-toast small { display: block; font: 900 10px/1.2 var(--body); color: var(--yellow); }
.chal-toast b { display: block; font: 400 16px/1.2 var(--display); }
.chal-toast em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .chal-cols { grid-template-columns: 1fr; max-height: none; } #chal-toasts { top: auto; bottom: 120px; right: 16px; left: 16px; } .chal-toast { max-width: none; } }

/* ---------------- Uova di evocazione e incenso (summons.js) ---------------- */
#summon-hud { position: absolute; top: 96px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(330px, 56vw); pointer-events: none; }
#summon-hud.hidden { display: none; }
#summon-hud > * { position: relative; height: 38px; min-width: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(36, 29, 25, .85); border: 1px solid var(--line); box-shadow: var(--shadow); color: #fff; }
#summon-hud i { position: absolute; bottom: -5px; right: -5px; font: 900 9px/1 var(--body); font-style: normal; background: #0f0b09; border: 1px solid var(--line-2); color: #fff; border-radius: 99px; padding: 2px 4px; }
.sm-egg { width: 38px; border-radius: 50% !important; background: conic-gradient(var(--ec) calc(var(--k) * 360deg), rgba(15, 11, 9, .9) 0) !important; }
.sm-egg b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #241d19; font-size: 18px; }
.sm-comp img { width: 34px; height: auto; image-rendering: pixelated; }
.sm-active { padding: 0 9px 0 6px; display: flex !important; gap: 4px; font: 900 13px/1 var(--body); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #9a6aff, 0 0 12px rgba(154, 106, 255, .7) !important; animation: sm-glow 1.4s ease-in-out infinite; }
.sm-active.gold { box-shadow: 0 0 0 2px #f2c230, 0 0 12px rgba(242, 194, 48, .8) !important; color: var(--gold) !important; }
.sm-active b { font-size: 18px; }
@keyframes sm-glow { 50% { filter: brightness(1.25); } }
button.sm-inc { pointer-events: auto; cursor: pointer; padding: 0 8px; display: flex !important; gap: 3px; font-size: 18px; box-shadow: inset 0 0 0 2px #9a6aff, var(--shadow) !important; }
button.sm-inc.gold { box-shadow: inset 0 0 0 2px #f2c230, var(--shadow) !important; }
button.sm-inc kbd { font: 900 9px/1 var(--body); padding: 2px 4px; border-radius: 5px; background: #0f0b09; color: var(--muted); }
@media (pointer: coarse) { button.sm-inc { height: 46px !important; min-width: 50px !important; } button.sm-inc kbd { display: none; } }
@media (max-width: 640px) { #summon-hud { top: 78px; } }
.beasts.summon-grid { max-height: none; }
.beast.summon img { image-rendering: pixelated; }

/* ---------------- Spedizione e Armeria (expedition.js) ---------------- */
.exp-tile.locked { cursor: not-allowed; filter: grayscale(.7); opacity: .7; }
.exp-tile.locked:hover { transform: none; }
.exp-screen .opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.exp-screen .box-head small { margin-left: auto; font: 900 12px/1 var(--body); opacity: .85; }
.gear-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.gear-slot { padding: 8px; border-radius: 12px; background: rgba(15, 11, 9, .85); box-shadow: inset 0 0 0 2px var(--rc, var(--line)); min-width: 0; }
.gear-slot.empty { opacity: .6; box-shadow: inset 0 0 0 2px var(--line); }
.gear-slot small { display: block; font: 900 10px/1.2 var(--body); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.gear-slot b { display: block; margin: 3px 0; font: 400 14px/1.1 var(--display); color: var(--rc, #fff); }
.gear-slot em { display: block; font-style: normal; font-size: 11px; font-weight: 800; }
.gear-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; margin-bottom: 8px; }
.gear-list.end { max-height: 30vh; margin: 6px 0; }
.gear-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(15, 11, 9, .85); box-shadow: inset 3px 0 0 var(--rc); }
.gear-row > div { flex: 1; min-width: 0; }
.gear-row b { display: block; font: 400 14px/1.1 var(--display); color: var(--rc); }
.gear-row small { display: block; font-size: 10px; font-weight: 800; color: var(--muted); }
.gear-row em { display: block; font-style: normal; font-size: 11px; font-weight: 800; }
.gear-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 18px; background: var(--card-3); box-shadow: 0 0 0 2px var(--rc); }
.gear-btns { flex: none; display: flex; gap: 4px; }
.gear-btns .pill { padding: 3px 10px; font-size: 12px; }
#exp-loot { position: absolute; top: 146px; left: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: min(300px, 52vw); padding: 5px 8px; border-radius: 12px; background: rgba(36, 29, 25, .85); border: 1px solid var(--line); box-shadow: inset 0 0 0 2px var(--rc), var(--shadow); pointer-events: none; }
#exp-loot.hidden, #hud.hidden #exp-loot { display: none; }
#exp-loot b { font: 900 12px/1 var(--body); margin-right: 2px; white-space: nowrap; }
#exp-loot i { width: 22px; height: 22px; display: grid; place-items: center; font-size: 13px; font-style: normal; border-radius: 6px; background: #0f0b09; box-shadow: inset 0 0 0 2px var(--rc); }
@media (max-width: 760px) { .gear-slots { grid-template-columns: 1fr; } .gear-list { max-height: none; } }
@media (max-width: 640px) { #exp-loot { top: 128px; } }

/* Ruota dei Tesori (toad.js) */
.wheel-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wheel-wrap { position: relative; width: min(340px, 78vw); aspect-ratio: 1; }
.wheel-ptr { position: absolute; top: -6px; left: 50%; z-index: 2; transform: translateX(-50%); border: 14px solid transparent; border-top: 24px solid #fff; border-bottom: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.wheel-disc { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 6px #1b1420, 0 0 0 10px var(--gold), var(--shadow); }
.wheel-disc.spin { transition: transform 3.2s cubic-bezier(.12, .7, .16, 1); }
.wh-lab { position: absolute; inset: 0; display: flex; justify-content: center; pointer-events: none; }
.wh-lab i { margin-top: 8%; display: flex; flex-direction: column; align-items: center; gap: 2px; font-style: normal; font-size: 22px; }
.wh-lab em { font: 900 10px/1 var(--body); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
.wh-hub { position: absolute; top: 50%; left: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; font-size: 30px; background: #241d19; box-shadow: 0 0 0 4px var(--gold); }
.wh-result { width: 100%; padding: 8px 12px; border-radius: 12px; text-align: center; background: rgba(15, 11, 9, .85); box-shadow: inset 0 0 0 2px var(--rc, var(--line)); }
.wh-result small { display: block; font: 900 10px/1.2 var(--body); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.wh-result b { display: block; margin: 3px 0; font: 400 18px/1.1 var(--display); color: var(--rc, #fff); }
.wh-result p { margin: 0 !important; font-size: 13px; }
.wh-result.empty { opacity: .7; }
.wh-odds { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.wh-odd { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 10px; background: rgba(15, 11, 9, .85); box-shadow: inset 3px 0 0 var(--rc); }
.wh-odd > div { flex: 1; min-width: 0; }
.wh-odd b { display: block; font: 400 13px/1.1 var(--display); }
.wh-odd small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.wh-odd em { flex: none; font: 900 14px/1 var(--body); font-style: normal; color: var(--gold); font-variant-numeric: tabular-nums; }
.wh-ico { flex: none; font-size: 18px; }
.toad-line small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

/* Archivio e Affinamento (forge.js) */
.arc-group h4 { margin: 10px 0 6px; font: 400 14px/1 var(--display); }
.arc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.arc-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line-2); background: rgba(15, 11, 9, .85); color: var(--text); text-align: left; cursor: pointer; box-shadow: inset 3px 0 0 var(--rc); font: inherit; }
.arc-item .ico { font-size: 18px; flex: none; }
.arc-item .nm { flex: 1; min-width: 0; font-weight: 800; font-size: 13px; }
.arc-item .nm small { display: block; font-size: 10px; color: var(--muted); }
.arc-item.sel { border-color: var(--red); background: rgba(255, 77, 94, .14); }
.arc-item.sel .nm { text-decoration: line-through; text-decoration-color: var(--red); }
.arc-item.disabled { opacity: .45; cursor: not-allowed; }
.forge-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.forge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; border-radius: 12px; background: rgba(15, 11, 9, .85); }
.forge-row .forge-n { font: 900 10px/1 var(--body); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); min-width: 74px; }
.forge-row b { flex: 1; font: 400 15px/1.1 var(--display); }
.forge-row > small { color: var(--muted); font-weight: 700; }
.forge-row.fresh { box-shadow: inset 0 0 0 2px var(--gold); }

/* Piano delle build (buildplan.js) */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.plan-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.plan-pill { font-size: 12px; padding: 4px 10px; }
.pill.plan-pill[style*="--rc"] { box-shadow: inset 3px 0 0 var(--rc); }
.pill.plan-pill.disabled { opacity: .45; cursor: not-allowed; }
.plan-code { flex-wrap: wrap; gap: 8px; }
.plan-code input { flex: 1; min-width: 180px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line-2); background: #0f0b09; color: var(--text); font: 800 13px/1 ui-monospace, monospace; }
.plan-badge { position: absolute; top: 10px; left: 40px; z-index: 2; padding: 3px 9px; border-radius: 99px; background: var(--green); color: #10231a; font: 900 10px/1.2 var(--body); text-transform: uppercase; letter-spacing: .8px; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.card.in-plan { border-color: var(--green); box-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 18px rgba(63, 212, 122, .45); }
@media (max-width: 760px) { .plan-grid { grid-template-columns: 1fr; } .forge-row .forge-n { min-width: 0; } }

/* ---------- Mappa grande, FPS e Impostazioni (controls.js, settings.js) ---------- */
#bigmap {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#bigmap.hidden { display: none; }
#bigmap canvas {
  width: min(76vh, 88vw); height: min(76vh, 88vw); border-radius: 50%;
  border: 6px solid var(--card); outline: 2px solid var(--line-2); box-shadow: var(--shadow); opacity: .94;
}
.bigmap-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; padding: 6px 14px; border-radius: 99px; background: rgba(23, 18, 15, .85); font: 800 12px/1 var(--body); color: #e8dcc8; }
.bigmap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bigmap-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.bigmap-legend .bigmap-key { color: var(--muted); }
#fps-meter { position: fixed; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 70; pointer-events: none; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #9dffb0; font: 800 12px/1 ui-monospace, monospace; }
#fps-meter.hidden { display: none; }
.set-tabs .mtab { display: inline-flex; align-items: center; gap: 6px; }
.set-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-lbl { font: 900 12px/1.2 var(--body); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.set-note { grid-column: 2; font-size: 12px; color: var(--muted); line-height: 1.4; }
.set-range input { width: min(320px, 60vw); accent-color: var(--yellow); }
.set-range b { min-width: 44px; font: 900 14px/1 var(--body); }
.bind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.bind { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--card-2); font-size: 14px; }
.bind.wait { outline: 2px solid var(--yellow); }
.bind .pill { min-width: 96px; }
.pad-focus { outline: 3px solid var(--yellow) !important; outline-offset: 2px; }
@media (max-width: 640px) {
  .set-row { grid-template-columns: 1fr; }
  .set-note { grid-column: 1; }
}

/* Glossario (glossary.js) */
.gl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--gc) 26%, transparent); border: 2px solid var(--gc); color: #fff; font: 900 12px/1.2 var(--body); white-space: nowrap; }
.gl-chip small { opacity: .75; font-weight: 800; }
.gl-cycle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
.gl-arrow { font: 800 11px/1 var(--body); color: var(--muted); }
.gl-list { display: grid; gap: 6px; margin: 8px 0 14px; }
.gl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: start; justify-items: start; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 13.5px; line-height: 1.45; }
.gl-row small { color: var(--muted); }
.gl-name { font: 900 13px/1.3 var(--body); }
@media (max-width: 640px) { .gl-row { grid-template-columns: 1fr; gap: 4px; } }

/* =========================================================
   Rifinitura menu: lucentezza, hover vivi,
   card "laboratorio" del Dojo, tab segmentate
   ========================================================= */
:root {
  --gloss: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 48%);
  --shine: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.38) 48%, rgba(255,255,255,.08) 54%, transparent 62%);
  --ease-pop: cubic-bezier(.2, 1.5, .4, 1);
}

/* Riflesso che attraversa la card al passaggio del mouse */
.tile, .card, .chapter, .mission, .rtile, .square, .lab-card, .village, .beast:not(.locked) { position: relative; isolation: isolate; }
.tile::before, .card::before, .chapter::before, .mission::before, .rtile::before, button.square::before, .lab-card::before, .beast:not(.locked)::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: var(--shine) no-repeat; background-size: 250% 100%; background-position: 150% 0; opacity: 0;
}
.tile:hover::before, .card:hover::before, .chapter:not(.locked):hover::before, .mission:hover::before,
.rtile:not(.locked):hover::before, button.square:hover::before, .lab-card:hover::before, .beast:not(.locked):hover::before {
  opacity: 1; background-position: -60% 0; transition: background-position .65s ease-out, opacity .1s;
}
.square, .mission { overflow: hidden; }

/* ---------- Pulsanti a pillola: bordo lucido e glow ---------- */
.btn { background-image: var(--gloss); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.18), 0 4px 0 var(--bd); transition: transform .14s var(--ease-pop), filter .15s, box-shadow .15s; }
.btn.primary { background: var(--gloss), var(--stripes-soft), linear-gradient(180deg, #ff6b7a, var(--red)); }
.btn.go { background: var(--gloss), linear-gradient(180deg, #5ef09a, var(--green)); }
.btn.blue { background: var(--gloss), linear-gradient(180deg, #6aa8ff, var(--blue)); }
.btn:not(.disabled):hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.12); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.18), 0 6px 0 var(--bd), 0 10px 22px color-mix(in srgb, var(--bc) 45%, transparent); }
.btn.disabled:hover { transform: none; filter: grayscale(.6); }
.btn.primary.big { position: relative; overflow: hidden; }
.btn.primary.big::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--shine) no-repeat; background-size: 250% 100%; animation: btn-shine 3.2s ease-in-out infinite; }
@keyframes btn-shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -60% 0; } }

.back { background: var(--gloss), var(--card); transition: transform .14s var(--ease-pop), border-color .15s, box-shadow .15s; }
.back:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.4); box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.08); }
.back kbd { box-shadow: 0 2px 0 #b5a28c, 0 0 0 2px rgba(0,0,0,.25); }

.ribbon { position: relative; overflow: hidden; border: 2px solid rgba(255,255,255,.28); }
.ribbon::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--gloss); }
.coin-badge { background: var(--gloss), var(--card); border-color: color-mix(in srgb, var(--gold) 50%, transparent); box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 16px rgba(255, 201, 60, .18); }

.pill { transition: transform .14s var(--ease-pop), border-color .15s, background-color .15s; background-image: var(--gloss); }
.pill:not(.locked):not(.disabled):hover { transform: translateY(-2px); border-color: rgba(255,255,255,.35); }
.pill.sel { box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 0 3px rgba(255, 201, 60, .22); }

/* ---------- Home: riquadri grandi ---------- */
.tile { background: var(--gloss), var(--stripes), linear-gradient(135deg, color-mix(in srgb, var(--tc) 80%, #fff), var(--tc) 55%, color-mix(in srgb, var(--tc) 70%, #000)); transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s; }
.tile:not(.locked):hover { transform: translateY(-4px) scale(1.015); border-color: #fff; box-shadow: 0 7px 0 color-mix(in srgb, var(--tc) 45%, #000), 0 0 0 4px color-mix(in srgb, var(--tc) 35%, transparent), 0 14px 34px color-mix(in srgb, var(--tc) 40%, transparent); }
.tile:not(.locked):active { transform: translateY(1px) scale(.99); }
.tile-ico { position: relative; z-index: 1; transition: transform .25s var(--ease-pop); border: 3px solid rgba(255,255,255,.85); box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.tile:not(.locked):hover .tile-ico { transform: scale(1.12) rotate(-8deg); }
/* Gioca: la tuta del ninja scelto (main.js PLAY_LOOK): colore del ninja (--tc), fascia delle spalle in alto (--band)
   e il suo simbolo in trasparenza (vortice per Naruto, ventaglio per Sasuke, ecc.) */
.tile.play {
  --tc: #ff8a1e; --band: #1d2a58; border-color: #fff4e0; box-shadow: 0 6px 0 color-mix(in srgb, var(--tc) 45%, #000), 0 0 0 3px rgba(255,255,255,.22), var(--shadow);
  background: linear-gradient(180deg, var(--band) 0 14px, var(--ink) 14px 18px, transparent 18px), var(--gloss),
    linear-gradient(135deg, color-mix(in srgb, var(--tc) 72%, #fff), var(--tc) 45%, color-mix(in srgb, var(--tc) 68%, #000));
}
.play-swirl { position: absolute; left: 34%; top: 50%; width: 190px; height: 190px; margin-top: -88px; pointer-events: none; transition: transform .7s var(--ease-pop); }
.play-emb { position: absolute; left: 26%; top: 50%; width: 150px; height: 150px; margin-top: -68px; display: grid; place-items: center; font-size: 130px; pointer-events: none; opacity: .22; filter: brightness(0); transform: rotate(-12deg); transition: transform .7s var(--ease-pop); }
.tile.play:hover .play-emb { transform: rotate(8deg) scale(1.08); }
.play-swirl path { fill: none; stroke: color-mix(in srgb, color-mix(in srgb, var(--tc) 40%, #000) 40%, transparent); stroke-width: 6; stroke-linecap: round; }
.tile.play:hover .play-swirl { transform: rotate(220deg); }
.tile.play .tile-ico { border-width: 4px; background: radial-gradient(circle at 40% 35%, #3a2f28, var(--ink)); }
.tile.play:hover .tile-ico { animation: wobble .6s ease-in-out; }
.tile.play b { -webkit-text-stroke: 5px rgba(0,0,0,.25); paint-order: stroke fill; }
@keyframes wobble { 25% { transform: scale(1.12) rotate(-12deg); } 50% { transform: scale(1.12) rotate(10deg); } 75% { transform: scale(1.12) rotate(-5deg); } 100% { transform: scale(1.12) rotate(0); } }

/* Quadrati: disco colorato e barra inferiore del colore della sezione */
.square {
  background: var(--gloss), linear-gradient(180deg, color-mix(in srgb, var(--sq, var(--blue)) 14%, #2a211c), rgba(36, 29, 25, .95));
  border: 2px solid rgba(232, 188, 110, .16); box-shadow: inset 0 -5px 0 var(--sq, var(--blue)), 0 4px 0 rgba(0,0,0,.35), var(--shadow);
  transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s;
}
.square .sq-ico {
  width: 36px; height: 36px; font-size: 18px; transition: transform .25s var(--ease-pop);
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--sq, var(--blue)) 55%, #fff), color-mix(in srgb, var(--sq, var(--blue)) 60%, #241d19));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.12);
}
button.square:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--sq, var(--blue)) 70%, #fff); box-shadow: inset 0 -5px 0 var(--sq, var(--blue)), 0 6px 0 rgba(0,0,0,.35), 0 12px 26px color-mix(in srgb, var(--sq, var(--blue)) 35%, transparent); }
button.square:hover .sq-ico { transform: scale(1.18) translateY(-2px); }
button.square:active { transform: translateY(1px); }

/* Pannello laterale stile classifica */
.saga-card { border: 2px solid rgba(232, 188, 110, .3); }
.saga-card .box-head { background: var(--gloss), var(--stripes), linear-gradient(90deg, #b82e24, #e0552e); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
/* kanji del fuoco in filigrana sull'Ufficio dell'Hokage */
.office-card .box-head { position: relative; overflow: hidden; }
.office-card .box-head::after { content: '火'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-8deg); font: 400 34px/1 'Shojumaru', serif; color: rgba(255,255,255,.22); pointer-events: none; }
.office-card .btn.blue { --bd: #9a4206; color: var(--ink); text-shadow: none; background: var(--gloss), linear-gradient(180deg, #ffaa50, #ff8a1e); }
.saga-row { transition: transform .14s, border-color .15s, background-color .15s; background-image: var(--gloss); }
.saga-row:not(.locked):hover { transform: translateX(3px); border-color: rgba(255,255,255,.22); }
.saga-row.done { border-color: color-mix(in srgb, var(--green) 45%, transparent); }

/* ---------- Tab segmentate ---------- */
.mtabs { display: inline-flex; padding: 5px; gap: 4px; border-radius: 99px; background: rgba(15, 11, 9, .82); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.mtab { background: transparent; box-shadow: none; border: 0; transition: background-color .15s, color .15s, transform .14s var(--ease-pop); }
.mtab:not(.sel):not(.locked):hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.mtab.sel { background: var(--gloss), var(--mr, var(--blue)); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 0 14px color-mix(in srgb, var(--mr, var(--blue)) 45%, transparent); }

/* ---------- Riquadri generici ---------- */
.box { border: 2px solid rgba(232, 188, 110, .2); }
.box-head { background: var(--gloss), var(--stripes), linear-gradient(90deg, var(--hc), color-mix(in srgb, var(--hc) 70%, #fff 0%)); }

/* ---------- Selezione ninja ---------- */
.hero-pic { background: var(--gloss), var(--stripes), radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 65%, color-mix(in srgb, var(--c) 60%, #000)); box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 0 30px color-mix(in srgb, var(--c) 45%, transparent); }
.hero-pic img { animation: idle-bob 2.4s ease-in-out infinite; }
@keyframes idle-bob { 50% { transform: translateY(-4px); } }
.hero-name { -webkit-text-stroke: 6px rgba(0,0,0,.35); paint-order: stroke fill; }
.hero-stats .meter i { background: linear-gradient(180deg, #6aa8ff, var(--blue)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.rtile { border-radius: 16px; transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s; }
.rtile img { transition: transform .25s var(--ease-pop); }
.rtile:not(.locked):hover { transform: translateY(-4px); border-color: rgba(255,255,255,.7); box-shadow: 0 6px 0 rgba(0,0,0,.35), 0 10px 22px color-mix(in srgb, var(--c) 45%, transparent); }
.rtile:not(.locked):hover img { transform: scale(1.1) translateY(-2px); }
.rtile.sel { border-color: var(--yellow); animation: sel-ring 1.2s ease-in-out infinite alternate; }
.rtile.locked { background: var(--stripes-soft), var(--card-3); }
@keyframes sel-ring { from { box-shadow: 0 0 0 3px rgba(255,201,60,.3), 0 4px 0 rgba(0,0,0,.35); } to { box-shadow: 0 0 0 5px rgba(255,201,60,.55), 0 0 18px rgba(255,201,60,.45), 0 4px 0 rgba(0,0,0,.35); } }

/* ---------- Saga, missioni, villaggi ---------- */
.chapter { transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s; }
.chapter:not(.locked):hover { transform: translateY(-4px); border-color: rgba(255,255,255,.4); box-shadow: 0 10px 26px color-mix(in srgb, var(--red) 25%, transparent), var(--shadow); }
.chapter .ch-boss { transition: transform .3s var(--ease-pop); }
.chapter:not(.locked):hover .ch-boss { transform: scale(1.1) translateY(-3px); }
.chapter.sel { animation: sel-glow 1.2s ease-in-out infinite alternate; }
@keyframes sel-glow { to { box-shadow: 0 0 0 6px rgba(255, 201, 60, .35), 0 0 24px rgba(255, 201, 60, .35), var(--shadow); } }
.mission { transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s; }
.mission:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--mr, var(--blue)) 30%, transparent), var(--shadow); }
.village { transition: transform .16s var(--ease-pop), border-color .15s; }
.village:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--vc) 70%, #fff); }
.v-head { background: var(--gloss), var(--stripes), var(--vc); }

/* ---------- Bestiario (griglia) ---------- */
.beast { transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s; background-image: var(--gloss), var(--stripes), linear-gradient(160deg, #6aa8ff, var(--blue) 60%, var(--blue-d)); }
.beast.boss { background-image: var(--gloss), var(--stripes), linear-gradient(160deg, #b294ff, var(--purple) 60%, var(--purple-d)); }
.beast.bijuu { background-image: var(--gloss), var(--stripes), linear-gradient(160deg, #ffb070, var(--orange) 60%, #b8501a); }
.beast.locked { background-image: none; background-color: var(--card-2); }
.beast img { transition: transform .25s var(--ease-pop); }
.beast:not(.locked):hover { transform: translateY(-3px); border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 201, 60, .3), 0 8px 18px rgba(0,0,0,.35); z-index: 1; }
.beast:not(.locked):hover img { transform: scale(1.12); }
.beast .no { padding: 2px 6px; border-radius: 99px; background: rgba(0,0,0,.35); opacity: 1; }

/* ---------- Carte del level up ---------- */
.card { transition: transform .18s var(--ease-pop), border-color .15s, box-shadow .2s; }
.card:not(.disabled):hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 10px 0 rgba(0,0,0,.45), 0 0 0 4px color-mix(in srgb, var(--kc) 30%, transparent), 0 18px 40px color-mix(in srgb, var(--kc) 35%, transparent); }
.card-top { background: var(--gloss), var(--stripes), linear-gradient(135deg, color-mix(in srgb, var(--kc) 75%, #fff), var(--kc) 60%, color-mix(in srgb, var(--kc) 60%, #000)); }
.card-icon { transition: transform .3s var(--ease-pop); z-index: 1; }
.card:not(.disabled):hover .card-icon { transform: translateX(-50%) scale(1.14) rotate(-6deg); }
.card.rar-legend { animation: pop .3s ease-out both, legend-glow 1.6s ease-in-out .3s infinite alternate; }
@keyframes legend-glow { to { box-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 34px color-mix(in srgb, var(--rar) 75%, transparent), var(--shadow); } }

/* ---------- Dojo: card "laboratorio" ---------- */
.dojo-cats { gap: 22px; }
.dojo-cat h3 {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; padding-left: 12px; border-left: 5px solid var(--lc);
  font: 400 24px/1 var(--display); letter-spacing: 0; text-transform: none; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.dojo-cat h3 small { font: 800 13px/1 var(--body); color: #e8dcc8; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); gap: 12px; }
.lab-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden;
  border-radius: 20px; background: var(--card); border: 3px solid transparent; box-shadow: 0 5px 0 rgba(0,0,0,.35), var(--shadow);
  transition: transform .16s var(--ease-pop), border-color .15s, box-shadow .2s;
}
.lab-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--lc) 75%, #fff); box-shadow: 0 7px 0 rgba(0,0,0,.35), 0 12px 30px color-mix(in srgb, var(--lc) 35%, transparent); }
.lab-top { position: relative; align-self: stretch; height: 70px; margin-bottom: 30px; background: var(--gloss), var(--stripes), linear-gradient(135deg, color-mix(in srgb, var(--lc) 80%, #fff), var(--lc) 60%, color-mix(in srgb, var(--lc) 70%, #000)); }
.lab-lv { position: absolute; top: 8px; right: 8px; padding: 4px 9px; border-radius: 99px; background: rgba(15, 11, 9, .75); font: 900 11px/1 var(--body); }
.lab-ico {
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; background: #1a1f2e; border: 4px solid var(--card); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lc) 60%, transparent);
  transition: transform .3s var(--ease-pop);
}
.lab-card:hover .lab-ico { transform: translateX(-50%) scale(1.14) rotate(-8deg); }
.lab-name { padding: 0 10px; font: 400 18px/1.1 var(--display); }
.lab-desc { flex: 1; padding: 4px 12px 0; font: 700 12px/1.35 var(--body); color: #dccfb8; }
.lab-pips { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 10px 12px 12px; }
.lab-pips i { width: 18px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); }
.lab-pips i.on { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--lc) 60%, #fff)); box-shadow: 0 0 6px color-mix(in srgb, var(--lc) 80%, transparent); }
.lab-buy {
  cursor: pointer; align-self: stretch; margin: 0 12px 12px; padding: 10px 12px; border: 0; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gloss), linear-gradient(180deg, #ffe07a, var(--yellow)); color: var(--ink); font: 400 19px/1 var(--display);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 4px 0 #b8860b; transition: transform .14s var(--ease-pop), filter .15s;
}
.lab-buy:not(.disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.lab-buy:not(.disabled):active { transform: translateY(2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 1px 0 #b8860b; }
.lab-card.poor .lab-buy { background: var(--gloss), #c6c3dc; color: #4a4566; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), 0 4px 0 #77738f; cursor: not-allowed; }
.lab-card.maxed { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.lab-card.maxed .lab-buy { background: var(--gloss), var(--green); color: #0d2a19; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 4px 0 var(--green-d); cursor: default; }
.lab-card.maxed .lab-lv { background: var(--green); color: #0d2a19; }

/* ---------- Liste e righe ---------- */
.chal, .item-chip, .relic-card, .gear-row, .arc-item, .fusion-row, .wh-odd, .bind, .key { transition: transform .14s var(--ease-pop), background-color .15s, box-shadow .15s; }
.chal:hover, .item-chip:hover, .relic-card:hover, .fusion-row:hover, .gear-row:hover, .bind:hover { transform: translateX(3px); background-color: var(--card-3); }
.arc-item:not(.disabled):hover { transform: translateY(-2px); border-color: rgba(255,255,255,.3); }
.chal.ready { animation: sel-glow 1.2s ease-in-out infinite alternate; }

/* ---------- Pausa / fine partita ---------- */
.run-panel { border: 2px solid rgba(255,255,255,.08); }
.run-head { background: var(--gloss), var(--stripes), linear-gradient(90deg, color-mix(in srgb, var(--c) 85%, #000), var(--c) 55%, color-mix(in srgb, var(--c) 60%, var(--yellow))); }
.tiles-stat > div { border: 1px solid rgba(255,255,255,.08); background-image: var(--gloss); }

/* Focus da tastiera/gamepad */
.tile:focus-visible, .square:focus-visible, .btn:focus-visible, .card:focus-visible, .rtile:focus-visible, .lab-buy:focus-visible, .mtab:focus-visible, .pill:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.squares { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.square { min-height: 84px; }
.square b { font-size: 16px; white-space: nowrap; }
.square small { line-height: 1.15; }
@media (max-width: 640px) { .squares { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Ridisegno della stessa schermata (ui.show): niente animazioni d'ingresso */
#overlay.same-screen .screen, #overlay.same-screen .card { animation: none; }
#overlay.same-screen .card.rar-legend { animation: legend-glow 1.6s ease-in-out infinite alternate; }

/* Time Attack (challenges.js) */
.chip.medal { margin-left: 6px; background: color-mix(in srgb, var(--mc) 25%, transparent); border: 1px solid var(--mc); color: #fff; }

/* =========================================================
   Home compatta: Gioca col ninja scelto,
   riga eventi, quadrati e pillole, badge delle novita (notify.js)
   ========================================================= */
.home .logo { margin-bottom: 14px; }
.home .logo { font-size: clamp(44px, 5.8vw, 70px); }
.home .tiles { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr) minmax(0, .72fr); }
.home .tile.play .tile-ico { display: none; }

/* Gioca: testo a sinistra, ritratto del ninja inclinato a destra */
.tile.play { min-height: 124px; padding-right: 10px; }
.tile.play .play-txt { flex: 1; min-width: 0; }
.play-pic {
  flex: none; width: 74px; height: 74px; border-radius: 16px; display: grid; place-items: center; transform: rotate(4deg);
  background: var(--gloss), radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c) 55%, #fff), color-mix(in srgb, var(--c) 70%, #241d19));
  border: 3px solid rgba(255,255,255,.85); box-shadow: 0 4px 0 rgba(0,0,0,.3); transition: transform .25s var(--ease-pop);
}
.play-pic img { width: 64px; image-rendering: pixelated; animation: idle-bob 2.4s ease-in-out infinite; }
.tile.play:hover .play-pic { transform: rotate(-3deg) scale(1.08); }

/* Missione del giorno: riquadro alto */
.tile.daily-sq { padding: 10px 6px; gap: 6px; background: var(--gloss), var(--stripes), radial-gradient(circle at 50% 30%, #c25cff, #7a2bc4 60%, #4a1a80); --tc: #8a3be0; }
.daily-sq .tile-ico { width: 46px; height: 46px; font-size: 24px; background: radial-gradient(circle at 40% 35%, #3a2160, #1a1030); }
.daily-sq b { font-size: 16px; }
.daily-sq small { font-size: 10.5px; }
.daily-sq .dq-state i { font-style: normal; font-variant-numeric: tabular-nums; }

/* Riga eventi: Covo e Spedizione affiancati */
.events { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.events .daily-tile { margin-top: 0; padding: 8px 12px; }
.events .daily-tile .dt-side { display: none; }
.events .daily-tile b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.events .daily-tile .tile-ico { width: 34px; height: 34px; font-size: 17px; }

/* Quadrati: una riga sola */
.home .squares { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 10px; }
.home .square { min-height: 80px; padding: 8px 2px 10px; }
.home .square b { font-size: 14px; }
.sq-pips { display: flex; gap: 4px; height: 16px; align-items: center; }
.sq-pips i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--yellow); }
.sq-pips i.on { background: var(--yellow); }
.sq-pips i.ready { background: var(--green); border-color: var(--green); animation: nb-pulse 1.4s ease-in-out infinite; }

/* Pillole in basso */
.home-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hpill {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px;
  border: 2px solid rgba(232, 188, 110, .18); color: #fff; font: 900 13px/1 var(--body);
  background: var(--gloss), rgba(28, 22, 19, .92); box-shadow: 0 3px 0 rgba(0,0,0,.35);
  transition: transform .14s var(--ease-pop), border-color .15s;
}
.hpill svg, .hpill img { color: var(--hp); }
.hpill:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--hp) 70%, #fff); }
a.hpill, .run-actions a.btn { text-decoration: none; } /* pulsante Wiki: e un link, non un button */
.hstat { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 99px; background: rgba(15, 11, 9, .7); font: 900 13px/1 var(--body); color: #e8dcc8; }
.home-pills .hstat:first-of-type { margin-left: auto; }

/* Badge delle novita */
.nb {
  position: absolute; top: 6px; right: 7px; z-index: 4; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 4px; rotate: -9deg;
  display: grid; place-items: center; font: 900 12px/1 var(--body); font-style: normal; color: #fff;
  background: #c8372d; border: 2px solid #f6e3c8; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 2px 0 rgba(0,0,0,.4), 0 0 10px rgba(200, 55, 45, .5);
  animation: nb-pop .35s var(--ease-pop) both, nb-pulse 1.8s ease-in-out .4s infinite; pointer-events: none;
}
.square .nb { top: 4px; right: 5px; }
.tile.play .nb { top: 8px; right: auto; left: 8px; }
@keyframes nb-pop { from { transform: scale(0); } }
@keyframes nb-pulse { 50% { transform: scale(1.15); } }

@media (max-width: 760px) {
  .home .tiles { grid-template-columns: 1fr 1fr; }
  .home .tiles .tile.play { grid-column: 1 / -1; }
  .events { grid-template-columns: 1fr; }
  .home .squares { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Etichetta "NUOVO" sugli elementi appena sbloccati (notify.js) */
.fusion-row, .pill.summon, .mtab { position: relative; }
.new-tag {
  position: absolute; top: -7px; left: -5px; z-index: 5; padding: 3px 7px 2px; border-radius: 99px; transform: rotate(-6deg);
  font: 900 9.5px/1 var(--body); font-style: normal; letter-spacing: .6px; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, #ff6b6b, #e02a3a); border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 10px rgba(255, 60, 70, .5);
  animation: nb-pop .35s var(--ease-pop) both, new-wiggle 2.4s ease-in-out .5s infinite; pointer-events: none;
}
.beast .new-tag, .rtile .new-tag, .chapter .new-tag { top: 5px; left: 5px; }
.mission .new-tag { top: 8px; left: auto; right: 8px; transform: rotate(4deg); animation: nb-pop .35s var(--ease-pop) both; }
@keyframes new-wiggle { 0%, 80%, 100% { transform: rotate(-6deg); } 87% { transform: rotate(4deg) scale(1.08); } 94% { transform: rotate(-9deg); } }
.new-dot { position: absolute; top: 2px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #ff4050; border: 2px solid #fff; animation: nb-pulse 1.8s ease-in-out infinite; }

/* "Cosa hai sbloccato": fine partita (pulsanti) e pausa (promemoria) */
.news-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0; padding: 10px 14px; border-radius: 16px;
  background: var(--gloss), linear-gradient(90deg, rgba(255, 64, 80, .18), rgba(36, 29, 25, .92) 45%); border: 2px solid rgba(255, 90, 100, .35);
}
.news-strip > b { font: 400 17px/1 var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.news-strip > div { display: flex; flex-wrap: wrap; gap: 8px; }
.news-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 30px 7px 12px; border-radius: 99px;
  border: 2px solid rgba(255,255,255,.12); background: var(--gloss), rgba(15, 11, 9, .85); color: #fff; font: 900 12.5px/1 var(--body);
}
button.news-chip { cursor: pointer; transition: transform .14s var(--ease-pop), border-color .15s; }
button.news-chip:hover { transform: translateY(-2px); border-color: rgba(255, 120, 130, .8); }
.news-chip .nb { top: 50%; right: 4px; margin-top: -11px; animation: nb-pop .35s var(--ease-pop) both; }
/* Festa di stagione: riga intera sotto Covo e Spedizione */
.events .fest-tile { grid-column: 1 / -1; }

/* Cosa manca per la promozione: punti e capitolo della saga */
.rank-need { grid-column: 1 / -1; display: grid; gap: 4px; margin-top: 4px; font: 800 11.5px/1.3 var(--body); color: #dccfb8; }
.rank-need span { display: flex; align-items: center; gap: 6px; }
.rank-need span.ok { color: var(--green); }
.rank-need em { font-style: normal; color: var(--yellow); }

/* Ancora da ottenere (pausa, todo.js) */
.todo-box { margin-top: 12px; box-shadow: none; }
.todo-box .box-head { flex-wrap: wrap; gap: 8px; }
.todo-tabs { margin-left: auto; display: flex; gap: 6px; }
.todo-tabs .mtab { padding: 4px 10px; font-size: 12px; }
.todo-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.todo-filters .pill small { opacity: .7; font-weight: 800; }
.todo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.todo-list.wide { grid-template-columns: 1fr; }
.todo-row { --rc: var(--card-3); display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 12px; background: var(--card-2); border-left: 4px solid var(--rc); font-size: 13px; }
.todo-row.kit { --rc: var(--blue); }
.todo-row.ready { --rc: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.todo-row .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 15px; flex: none; }
.todo-row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.todo-row .nm small { color: var(--muted); font-size: 11px; font-weight: 700; }
.todo-nat { font: 900 10px/1 var(--body); font-style: normal; padding: 3px 7px; border-radius: 99px; background: var(--nc); color: #241d19; }
.todo-ings { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.todo-ings > i { font-style: normal; font-weight: 900; color: var(--muted); }
.todo-ing { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 9px 3px 4px; border-radius: 99px; background: var(--card-3); }
.todo-ing .ic { width: 18px; height: 18px; flex: none; display: grid; place-items: center; font-size: 14px; }
.todo-ing .ic > * { max-width: 16px; max-height: 16px; }
.todo-ing b { font-size: 10px; color: var(--muted); }
.todo-ing.mid b { color: var(--orange); }
.todo-ing.ok { box-shadow: inset 0 0 0 2px var(--green); }
.todo-ing.ok b { color: var(--green); }
@media (max-width: 640px) { .todo-row.fusion { flex-wrap: wrap; } .todo-tabs { margin-left: 0; } }

/* Fermo immagine della tecnica segreta (ui.ultCut, ultcut.js) */
.ult-cut { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(8, 6, 20, .55) 85%);
  animation: uc-fade var(--dur) linear forwards; }
.uc-band { position: absolute; left: -10%; right: -10%; top: 50%; height: clamp(120px, 24vh, 210px);
  transform: translateY(-50%) rotate(-6deg); display: flex; align-items: center; gap: clamp(12px, 3vw, 32px); padding-left: 18%;
  background: var(--stripes), linear-gradient(90deg, color-mix(in srgb, var(--fc) 35%, #0f0b09), var(--fc) 55%, color-mix(in srgb, var(--fc) 60%, #fff));
  box-shadow: 0 0 0 5px #0f0b09, 0 0 60px var(--fc);
  animation: uc-band .22s cubic-bezier(.2, 1.3, .4, 1) both; }
.uc-band img { height: 150%; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35));
  animation: uc-pic .3s .05s cubic-bezier(.2, 1.4, .4, 1) both; }
.uc-txt { display: flex; flex-direction: column; gap: 6px; color: #fff; -webkit-text-stroke: 6px #0f0b09; paint-order: stroke fill;
  animation: uc-txt .3s .1s ease-out both; }
.uc-txt b { font: 400 clamp(24px, 4.6vw, 52px)/1 var(--display); text-shadow: 0 5px 0 rgba(0,0,0,.35); }
.uc-txt span { font: 400 clamp(14px, 2.2vw, 24px)/1.15 var(--display); max-width: 48vw; }
@keyframes uc-band { from { transform: translate(-110%, -50%) rotate(-6deg); } }
@keyframes uc-pic { from { opacity: 0; transform: translateX(-80px) scale(.8); } }
@keyframes uc-txt { from { opacity: 0; transform: translateX(60px); } }
@keyframes uc-fade { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) {
  .uc-band { height: 110px; padding-left: 13%; gap: 10px; }
  .uc-band img { height: 120%; flex: none; }
  .uc-txt { min-width: 0; -webkit-text-stroke: 4px #0f0b09; }
  .uc-txt b { font-size: 22px; }
  .uc-txt span { font-size: 13px; max-width: 58vw; }
}

/* Tsukuyomi (ultfx.js): il mondo diventa rosso e nero per un istante */
.tsukuyomi-fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; mix-blend-mode: multiply;
  background: radial-gradient(circle at 50% 45%, #ff5a5a 0%, #b0101a 45%, #1a0408 100%);
  animation: tsuku 1.3s ease-in-out forwards; }
@keyframes tsuku { 0% { opacity: 0; } 15% { opacity: .9; } 70% { opacity: .85; } 100% { opacity: 0; } }

/* Impostazioni > Grafica > Interfaccia (--uiz, settings.js): ogni blocco dell'HUD cresce dal suo angolo,
   i blocchi sotto il ritratto, sotto la minimappa e sopra la barra dei jutsu si spostano di conseguenza */
.hud-player, #streak { scale: var(--uiz, 1); transform-origin: top left; }
.hud-center, #bossbar { scale: var(--uiz, 1); transform-origin: top center; }
#minimap, #event { scale: var(--uiz, 1); transform-origin: top right; }
.bottom { scale: var(--uiz, 1); transform-origin: bottom center; }
#items-row, #relics-row { scale: var(--uiz, 1); transform-origin: bottom center; }
/* su schermi grandi con mouse: sui telefoni restano le posizioni delle regole per il touch */
@media (min-width: 641px) and (pointer: fine) {
  #streak { top: calc(12px + 88px * var(--uiz, 1)); }
  #bossbar { top: calc(10px + 96px * var(--uiz, 1)); }
  #event { top: calc(12px + 164px * var(--uiz, 1)); }
  #items-row { bottom: calc(12px + 84px * var(--uiz, 1)); }
  #relics-row { bottom: calc(12px + 118px * var(--uiz, 1)); }
}

/* Suggerimenti delle prime partite (tips.js) */
.tip-toast { position: absolute; left: 12px; bottom: calc(96px * var(--uiz, 1)); max-width: min(380px, 70vw); z-index: 4;
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px 10px 10px; border-radius: 14px;
  background: rgba(36, 29, 25, .94); border: 1px solid var(--line); border-left: 4px solid var(--orange); box-shadow: var(--shadow);
  animation: tip-in .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .35s, transform .35s; }
.tip-toast.out { opacity: 0; transform: translateX(-20px); }
.tip-toast p { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.tip-toast kbd { font-size: 12px; }
.tip-ico { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--card-3); }
@keyframes tip-in { from { opacity: 0; transform: translateX(-30px); } }
@media (max-width: 640px) { .tip-toast { bottom: 150px; max-width: 80vw; } }

/* ---------- Squadre di Konoha (teams.js): indizi dei ninja bloccati e Accademia ---------- */
.rtile .r-hint {
  position: absolute; inset: 22px 6px auto; z-index: 1; color: #e8ecf6; font-size: 10px; line-height: 1.25; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px #000;
}
/* assente nel capitolo della saga (story.js absent): si vede chi e, in grigio, con l'etichetta in basso */
.rtile.locked.away img { filter: saturate(.3) opacity(.8); }
.rtile.away .r-hint { inset: auto 4px 24px; padding: 2px 4px; border-radius: 6px; background: rgba(0,0,0,.6); }
.academy-screen { max-width: 1100px; }
.ac-iruka .box-body { display: flex; gap: 14px; align-items: center; }
.ac-iruka img { width: 84px; height: auto; image-rendering: pixelated; flex: none; }
.ac-iruka p { margin: 4px 0 0; }
.ac-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.ac-team {
  --tc: var(--orange);
  position: relative; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 12px; border-radius: 16px;
  border: 3px solid color-mix(in srgb, var(--tc) 55%, transparent);
  background: var(--stripes-soft), linear-gradient(160deg, color-mix(in srgb, var(--tc) 30%, var(--card)), var(--card-2));
  box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .12s; display: grid; gap: 10px;
}
.ac-team:hover { transform: translateY(-3px); }
.ac-team.sel { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,201,60,.35), 0 4px 0 rgba(0,0,0,.35); }
.ac-team.locked { cursor: not-allowed; opacity: .55; }
.ac-name { font: 400 20px/1 var(--display); color: var(--tc); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.ac-name small { font: 600 11px/1 inherit; color: var(--muted); margin-left: 6px; }
.ac-genin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ac-ninja { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: rgba(0,0,0,.25); }
.ac-ninja img { width: 64px; height: auto; image-rendering: pixelated; }
.ac-ninja b { font-size: 13px; }
.ac-ninja small { font-size: 10px; color: var(--muted); }
.ac-ninja.missing .ac-q { width: 64px; height: 54px; display: grid; place-items: center; font: 400 30px/1 var(--display); color: var(--muted); }
.ac-sensei { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.ac-sensei img { width: 40px; height: auto; image-rendering: pixelated; }
.ac-sensei span { display: grid; gap: 1px; }
.ac-sensei small { color: var(--muted); font-size: 11px; }
.ac-motto { margin: 0; font-size: 12px; font-style: italic; color: var(--muted); }
.m-team { margin: 2px 0 4px; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #fff; background: color-mix(in srgb, var(--tc) 55%, transparent); box-shadow: inset 3px 0 0 var(--tc); }
.saga-team { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.3); box-shadow: inset 4px 0 0 var(--tc); font-size: 13px; }
.team-bond { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.25); color: var(--muted); font-size: 12px; line-height: 1.4; }
.team-bond.on { background: color-mix(in srgb, var(--tc) 30%, transparent); color: inherit; box-shadow: inset 0 0 0 2px var(--tc); }
.ac-tag { justify-self: start; align-self: start; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.3); color: var(--muted); font: 700 11px/1.2 var(--body); }
.ac-tag.canon { background: var(--tc); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.ac-info ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.4; }
.ac-info b { color: var(--text, #fff); }
@media (max-width: 600px) { .ac-ninja img { width: 48px; } }

/* =========================================================
   Pelle Konoha: le bozze scelte (private/bozze-ui.html)
   1C riquadri di stoffa con cornice dorata e corda, 2A ninja che esce da Gioca,
   3A cammino del ninja, 4A sezioni a sigillo, 5A cartellini di carta bomba,
   6D eventi illustrati, 7B novita a carta bomba, 8B turbine tra le schermate, 9B mascotte
   ========================================================= */
/* 1C: contorno scuro, cornice dorata interna e corda intrecciata sul fondo */
.tile { border: 3px solid var(--ink); border-radius: 14px; }
.tile:not(.play) { box-shadow: inset 0 0 0 2px rgba(240, 204, 130, .55), 0 5px 0 color-mix(in srgb, var(--tc) 40%, #000), var(--shadow); padding-bottom: 16px; }
.tile:not(.play)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink);
}
.tile:not(.play):hover { border-color: var(--ink); box-shadow: inset 0 0 0 2px #ffe2a0, 0 7px 0 color-mix(in srgb, var(--tc) 40%, #000), var(--shadow); }
.box { border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(232, 188, 110, .35), var(--shadow); }
.saga-card { border: 3px solid var(--ink); }

/* 2A: Gioca, il ninja esce dal riquadro con l'aura di chakra */
.tile.play { overflow: visible; min-height: 104px; padding-right: 118px; border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff4e0, 0 6px 0 color-mix(in srgb, var(--tc) 45%, #000), var(--shadow); }
.tile.play > :not(.nb, .play-bg, .play-pic) { position: relative; z-index: 1; }
.play-bg { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.play-pic {
  position: absolute; right: 0; bottom: 0; width: 120px; height: 100%; z-index: 2;
  background: none; border: 0; border-radius: 0; box-shadow: none; transform: none; pointer-events: none;
}
.play-pic img {
  position: absolute; right: -14px; bottom: 0; width: 160px; image-rendering: pixelated; animation: idle-bob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tc) 50%, #fff)) drop-shadow(0 0 16px var(--tc)) drop-shadow(0 4px 0 rgba(0,0,0,.35));
}
.play-aura { position: absolute; right: 0; bottom: 4px; width: 124px; height: 124px; border-radius: 50% 50% 42% 42%; background: radial-gradient(circle, color-mix(in srgb, color-mix(in srgb, var(--tc) 55%, #fff) 70%, transparent), transparent 66%); animation: chakra-aura 1.5s ease-in-out infinite; }
@keyframes chakra-aura { 50% { transform: scale(1.14); opacity: .6; } }
.tile.play:hover .play-pic { transform: none; }
.tile.play:hover .play-pic img { animation-duration: .8s; }
@media (max-width: 760px) {
  .tile.play { padding-right: 120px; }
  .play-pic { width: 120px; } .play-pic img { width: 120px; } .play-aura { width: 110px; height: 110px; }
}

/* 3A: il cammino del ninja nell'Ufficio dell'Hokage */
.ninja-path { position: relative; padding: 8px 14px 8px 16px; }
.ninja-path::before { content: ''; position: absolute; left: 35px; top: 30px; bottom: 30px; width: 4px; background: repeating-linear-gradient(180deg, #e8bc6e 0 6px, transparent 6px 12px); }
.np-step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 5px 0; }
.np-ico { position: relative; z-index: 1; flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: #3a2f28; border: 3px solid #5a4a3a; overflow: hidden; }
.np-ico img { width: 44px; margin-top: 8px; image-rendering: pixelated; }
.np-step.done .np-ico { background: #2f7a4a; border-color: #8ae0a0; }
.np-step.cur .np-ico { background: radial-gradient(circle at 50% 40%, #ffc070, #ff8a1e); border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 138, 30, .35), 0 0 14px #ff8a1e; }
.np-step.next .np-ico { border: 3px dashed #ff8a1e; }
.np-step.lock .np-ico { background: #2a221d; border-color: #4a3c32; }
.np-step.lock .np-ico svg { opacity: .4; }
.np-step.lock .np-txt { opacity: .5; }
.np-txt { flex: 1; min-width: 0; padding-top: 3px; }
.np-txt b { display: flex; align-items: center; gap: 5px; font: 400 17px/1.15 var(--display); color: #fff; }
.np-txt b svg { width: 18px; height: 18px; }
.np-txt small { display: block; font: 800 11.5px/1.35 var(--body); color: var(--muted); }
.np-step.cur .np-txt small { color: #ffcf8a; }
.np-bar { display: block; height: 8px; margin: 5px 0 5px; border-radius: 4px; background: #15100d; box-shadow: inset 0 0 0 1px rgba(232, 188, 110, .25); overflow: hidden; }
.np-bar i { display: block; height: 100%; min-width: 4px; border-radius: 4px; background: linear-gradient(90deg, #ff8a1e, #ffd060); }
.np-need { display: flex; align-items: center; gap: 5px; color: #e8d8c0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-need svg { width: 13px; height: 13px; flex: none; }
.np-need.ok { color: var(--green); }

/* 4A: sezioni come sigilli con l'anello di scrittura che gira */
.home .square { background: none; border: 0; box-shadow: none; padding: 2px 0 0; min-height: 0; gap: 0; }
.home button.square::before { display: none; }
.home button.square:hover { transform: translateY(-3px); box-shadow: none; }
.home .square .sq-ico {
  width: 60px; height: 60px; font-size: 22px; border-radius: 50%; position: relative;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--sq) 60%, #fff) 0 30%, var(--sq) 31% 56%, var(--ink) 57% 61%, #f2e3c2 62% 92%, var(--ink) 93%);
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
}
.home .square .sq-ico svg { position: relative; z-index: 1; }
.home .square .sq-ico::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(var(--ink) 0 5deg, transparent 5deg 9deg, var(--ink) 9deg 11deg, transparent 11deg 20deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 68%, #000 69% 86%, transparent 87%); mask: radial-gradient(circle closest-side, transparent 0 68%, #000 69% 86%, transparent 87%);
  animation: seal-spin 22s linear infinite; opacity: .8;
}
.home button.square:hover .sq-ico { transform: none; }
.home button.square:hover .sq-ico::before { animation-duration: 3s; }
@keyframes seal-spin { to { transform: rotate(360deg); } }
.home .square b { position: relative; z-index: 2; margin-top: -9px; padding: 1px 7px; background: var(--ink); border: 2px solid var(--sq); border-radius: 4px; font-size: 12px; }
.home .square small { margin-top: 2px; font-size: 10.5px; color: #f6e9d2; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.home .square .sq-pips { margin-top: -6px; position: relative; z-index: 2; padding: 2px 5px; background: var(--ink); border-radius: 4px; }
.home .square .nb { top: -2px; right: 2px; }

/* 5A: pillole come cartellini di carta bomba */
.hpill {
  position: relative; border: 0; border-left: 4px solid #c8372d; border-radius: 2px; padding: 6px 18px 6px 19px; font-size: 12px;
  background: linear-gradient(180deg, #f6ead0, #e8d6ae); color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.45);
}
.hpill::before { content: ''; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #1a120c; box-shadow: 0 0 0 2px #c9a24a; }
.hpill::after { content: '爆'; position: absolute; right: 5px; top: 3px; font: 400 10px/1 'Shojumaru', serif; color: #c8372d; }
.hpill svg, .hpill img { color: color-mix(in srgb, var(--hp) 55%, #000); }
.hpill:hover { transform: translateY(-2px) rotate(-2deg); border-color: #c8372d; }

/* 6D: eventi illustrati */
.events .daily-tile { color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.8); }
.events .tower-tile {
  background: radial-gradient(circle at 88% 36%, #ff6a5a 0 15px, #d8283a 16px 20px, transparent 21px), radial-gradient(circle at 88% 36%, rgba(216, 40, 58, .5), transparent 48px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60' viewBox='0 0 300 60'%3E%3Cg transform='translate(150 22) scale(0.9)'%3E%3Cpath d='M10 30 C0 30 0 14 14 15 C14 2 34 0 40 12 C46 2 66 4 64 18 C78 16 80 32 66 32 Z' fill='%23c8372d' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3Cg transform='translate(230 8) scale(1.1)'%3E%3Cpath d='M10 30 C0 30 0 14 14 15 C14 2 34 0 40 12 C46 2 66 4 64 18 C78 16 80 32 66 32 Z' fill='%23c8372d' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3Cg transform='translate(70 30) scale(0.7)'%3E%3Cpath d='M10 30 C0 30 0 14 14 15 C14 2 34 0 40 12 C46 2 66 4 64 18 C78 16 80 32 66 32 Z' fill='%23c8372d' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E") no-repeat right -40px bottom 6px / 240px 48px, linear-gradient(180deg, #1c1432, #4a1e2a);
}
.events .exp-tile { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='70' viewBox='0 0 300 70' preserveAspectRatio='none'%3E%3Cpath d='M0 70 L0 40 L40 18 L70 34 L110 6 L150 30 L190 12 L230 36 L270 16 L300 30 L300 70Z' fill='%231f5a52'/%3E%3Cpath d='M0 70 L0 52 L50 34 L90 50 L140 30 L180 48 L220 34 L260 50 L300 40 L300 70Z' fill='%23163f3a'/%3E%3Crect y='44' width='300' height='10' fill='%23cfe8e0' opacity='.18'/%3E%3C/svg%3E") no-repeat left bottom / 100% 70%, radial-gradient(circle at 80% 20%, #f8f0c8 0 10px, transparent 11px), linear-gradient(180deg, #4a8a8a, #a8d0c0); }
.events .fest-tile { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='40' viewBox='0 0 72 40'%3E%3Cpath d='M0 6 Q36 16 72 6' stroke='%232a1408' stroke-width='1.5' fill='none'/%3E%3Crect x='31' y='10' width='10' height='3' fill='%2317120f'/%3E%3Cellipse cx='36' cy='22' rx='8' ry='10' fill='%23ff5a3a'/%3E%3Cellipse cx='36' cy='22' rx='4' ry='7' fill='%23ffd27a'/%3E%3Crect x='31' y='31' width='10' height='3' fill='%2317120f'/%3E%3C/svg%3E") repeat-x 0 0 / 72px 40px, radial-gradient(ellipse at 50% 120%, rgba(255, 120, 60, .45), transparent 70%), linear-gradient(180deg, #241a40, #3a1e3a); padding-top: 26px; }
.events .daily-tile.locked { filter: saturate(.55) brightness(.8); }
.events .daily-tile .tile-ico { background: rgba(15, 11, 9, .7); }

/* 7B: novita a carta bomba con la miccia che sfrigola */
.nb, .new-tag {
  border: 0; border-left: 4px solid #c8372d; border-radius: 2px; color: var(--ink); text-shadow: none;
  background: linear-gradient(180deg, #f6ead0, #e8d6ae); box-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.nb { min-width: 24px; height: 20px; padding: 0 7px 0 5px; rotate: -7deg; }
.nb::after, .new-tag::after {
  content: ''; position: absolute; right: -5px; top: -5px; width: 7px; height: 7px; border-radius: 50%;
  background: #ffe080; box-shadow: 0 0 6px 2px #ff8a1e, 0 0 2px #fff; animation: fuse .18s steps(2) infinite;
}
@keyframes fuse { 50% { transform: translate(2px, -2px) scale(.6); opacity: .7; } }
.new-tag { border-radius: 2px; }

/* 8B: turbine tra una schermata e l'altra (ui.js whirl) */
.whirl { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.whirl i { position: absolute; left: 50%; top: 50%; animation: whirl .9s cubic-bezier(.2, .7, .3, 1) var(--d) both; }
@keyframes whirl {
  from { transform: translate(-50%, -50%) rotate(0) scale(.2); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translate(calc(-50% + var(--x) * .45 - var(--y) * .35), calc(-50% + var(--y) * .45 + var(--x) * .35)) rotate(calc(var(--r) * .5)) scale(var(--s)); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(var(--s)); opacity: 0; }
}
.w-leaf { width: 24px; height: 12px; border-radius: 0 100% 0 100%; background: linear-gradient(160deg, transparent 46%, #2f6a2a 47% 53%, transparent 54%), #5aa84a; }
.w-petal { width: 14px; height: 12px; border-radius: 70% 0 70% 0; background: radial-gradient(circle at 30% 30%, #ffe0ea, #f4a0c0); }
.w-shuri { width: 28px; height: 28px; background: radial-gradient(circle, var(--ink) 0 3px, transparent 3.5px), linear-gradient(135deg, #eef2f5, #8e99a5); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.w-puff { width: 110px; height: 90px; border-radius: 50%; filter: blur(5px); background: radial-gradient(circle at 30% 45%, rgba(255,255,255,.8) 0 28%, transparent 29%), radial-gradient(circle at 66% 40%, rgba(245,245,245,.75) 0 32%, transparent 33%), radial-gradient(circle at 50% 66%, rgba(230,230,230,.7) 0 30%, transparent 31%); }
.w-tag { width: 14px; height: 38px; border-radius: 1px; background: linear-gradient(180deg, #c8372d 0 5px, #f2e3c2 5px); box-shadow: 0 1px 0 #0006; }

/* 9B: la mascotte con il fumetto a rotolo */
.mascot { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.mascot-who { display: flex; flex-direction: column; align-items: center; flex: none; }
.mascot-who small { margin-top: -2px; padding: 1px 6px; border-radius: 3px; background: #c8372d; color: #fff; font: 900 10px/1.3 var(--body); white-space: nowrap; }
.mascot img { width: 74px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0,0,0,.45)); animation: idle-bob 2.4s ease-in-out infinite; flex: none; }
.mascot-bub {
  position: relative; max-width: 420px; margin-bottom: 30px; padding: 8px 14px; cursor: pointer;
  background: linear-gradient(180deg, #f6ead0, #e8d6ae); color: var(--ink); font: 800 13px/1.35 var(--body);
  border-left: 8px solid #7a4a28; border-right: 8px solid #7a4a28; box-shadow: 0 3px 0 rgba(0,0,0,.45);
  transition: opacity .25s, transform .25s;
}
.mascot-bub::before { content: ''; position: absolute; left: -18px; bottom: 6px; border: 7px solid transparent; border-right-color: #7a4a28; }
.mascot-bub:hover { transform: translateY(-2px); }
.mascot-bub.swap { opacity: 0; transform: translateY(5px); }

/* =========================================================
   Pelle Konoha per sotto menu e partita (private/bozze-schermate.html)
   1B titolo a placca, 2A pulsanti a placca, 3A card di stoffa, 4A carte di livello a sigillo,
   5B tab a carta bomba, 5C gradi a gettone, 6A ritratto ad anello, 7A slot a sigillo,
   8A timer, 8D barra del boss, 9A minimappa a sigillo, 10B rapporto di missione
   ========================================================= */
/* 1B: il titolo della schermata e una placca del coprifronte sulla fascia blu, come il logo */
.ribbon {
  position: relative; overflow: visible; border: 0; transform: none; margin: 0 30px; padding: 7px 22px 8px; border-radius: 10px;
  background: linear-gradient(180deg, #f4f7fa, #c3ccd5 42%, #8f9aa6 56%, #cdd5dc);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 6px 0 3px rgba(255,255,255,.3), 0 5px 0 rgba(0,0,0,.45);
}
.ribbon::before {
  content: ''; position: absolute; left: -30px; right: -30px; top: 50%; height: 26px; margin-top: -13px; z-index: -1; border-radius: 13px;
  background: linear-gradient(90deg, rgba(0,0,0,.5), transparent 12%, transparent 88%, rgba(0,0,0,.5)), linear-gradient(180deg, #3a4f8a, #1f2d5e 60%, #141c3a);
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.ribbon > * { transform: none; }
/* la fascia (::before, z-index -1) deve stare dietro la placca: il contenitore fa da contesto di impilamento */
:has(> .ribbon) { isolation: isolate; }
.ribbon::after { border-radius: inherit; }
.ribbon span { color: var(--ink); text-shadow: 0 2px 0 rgba(255,255,255,.55); }
.ribbon small { color: #3a3f4a; opacity: 1; }
.back {
  border: 0; border-radius: 99px; color: var(--ink);
  background: radial-gradient(circle at 40% 30%, #fff, #b8c2cc 60%, #8f9aa6);
  box-shadow: inset 0 0 0 3px var(--ink), 0 3px 0 rgba(0,0,0,.45);
}
.back kbd { background: var(--ink); color: #fff; }

/* 2A: pulsanti a placca con contorno scuro e cornice interna */
.btn {
  border: 3px solid var(--ink); border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255, 236, 200, .35), 0 4px 0 var(--bd);
}
.btn:active { box-shadow: inset 0 0 0 2px rgba(255, 236, 200, .35), 0 1px 0 var(--bd); }
.btn.primary { --bd: #7a3406; background: var(--gloss), linear-gradient(180deg, #ffaa50, #ff8a1e 55%, #d8620a); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.btn.blue { --bd: #0d1430; background: var(--gloss), linear-gradient(180deg, #3a4f8a, #1f2d5e); box-shadow: inset 0 0 0 2px #c9a24a, 0 4px 0 var(--bd); }
.btn.go { --bd: #145a32; box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), 0 4px 0 var(--bd); }
.btn.ghost, .btn:not(.primary):not(.blue):not(.go):not(.danger) { box-shadow: inset 0 0 0 2px rgba(232, 188, 110, .35), 0 4px 0 #0f0b09; }

/* 3A: card dei capitoli e delle missioni come i riquadri della home */
.chapter, .mission { border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(240, 204, 130, .45), 0 5px 0 rgba(0,0,0,.45), var(--shadow); }
.chapter.sel, .mission.sel { border-color: var(--ink); box-shadow: inset 0 0 0 2px #ffd060, 0 0 0 3px #ffd060, 0 5px 0 rgba(0,0,0,.45), var(--shadow); }
.ch-art { border-bottom: 3px solid var(--ink); }
.ch-art::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink); }
.ch-num { border-radius: 3px; background: #c8372d; border: 2px solid #f6e3c8; rotate: -5deg; }
.mission { padding-bottom: 18px; }
.mission::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; border-radius: 0 0 9px 9px; background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink); pointer-events: none; }

/* 4A: carte di livello di stoffa, con il colore della rarita nella cornice e il jutsu dentro un sigillo */
.card { border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--rar, var(--kc)), 0 6px 0 rgba(0,0,0,.45), var(--shadow); }
.card:hover { border-color: var(--ink); }
.card-top { background: var(--stripes-soft), linear-gradient(180deg, color-mix(in srgb, var(--rar, var(--kc)) 70%, transparent), transparent); }
.card-icon {
  border: 0; font-size: 34px;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--rar, var(--kc)) 55%, #fff) 0 40%, var(--rar, var(--kc)) 41% 64%, var(--ink) 65% 69%, #f2e3c2 70% 93%, var(--ink) 94%);
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
}
.card-icon > * { position: relative; z-index: 1; }

/* 5B: tab come cartellini di carta bomba; quello scelto si alza storto */
.mtabs { background: none; border: 0; box-shadow: none; padding: 0; gap: 8px; }
.mtab { border: 0; border-left: 4px solid #8a7a68; border-radius: 2px; padding: 7px 14px; color: var(--ink); background: linear-gradient(180deg, #f6ead0, #e3cf9f); box-shadow: 0 3px 0 rgba(0,0,0,.4); opacity: .72; font-size: 14px; }
.mtab svg { color: color-mix(in srgb, var(--mr, var(--ink)) 55%, #000); }
.mtab:not(.sel):not(.locked):hover { background: linear-gradient(180deg, #fff4dc, #ecdcb0); opacity: 1; }
.mtab.sel { opacity: 1; color: var(--ink); border-left-color: #c8372d; rotate: -3deg; background: linear-gradient(180deg, #fff4dc, #ecdcb0); box-shadow: 0 4px 0 rgba(0,0,0,.45); }
.mtab.locked { opacity: .4; }
/* 5C: i gradi della Bacheca come gettoni rotondi del colore del grado */
.mtab.grade-tab { position: relative; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 3px solid #4a3c32; display: grid; place-items: center; background: var(--card); color: #fff; opacity: 1; rotate: none; box-shadow: 0 3px 0 rgba(0,0,0,.45); }
.mtab.grade-tab b { font: 400 22px/1 var(--display); color: var(--mr); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.mtab.grade-tab.sel { background: var(--mr); border-color: #fff; box-shadow: 0 0 0 3px var(--ink), 0 0 16px var(--mr); }
.mtab.grade-tab.sel b { color: var(--ink); text-shadow: none; }
.mtab.grade-tab.locked { opacity: .45; }
.gt-lock { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--ink); }
.mtab.grade-tab .new-dot { top: -2px; right: -2px; }

/* 6A: ritratto tondo con anello dorato, vita rossa ed esperienza azzurra come il chakra */
.hud-player { border-radius: 14px; border: 2px solid rgba(232, 188, 110, .35); }
.hud-pic { border: 3px solid var(--ink); box-shadow: 0 0 0 3px #c9a24a, 0 4px 0 rgba(0,0,0,.4); }
#lvl { border-color: #c9a24a; }
.hud-info .bar { border-radius: 4px; border: 2px solid var(--ink); background: #2a1a14; }
#hp-fill { background: linear-gradient(180deg, #6ff5a6, #2fb866); }
#xp-fill { background: linear-gradient(90deg, #3a8ad8, #8ad0ff); }

/* 7A: slot dei jutsu a sigillo; la tecnica segreta e un sigillo che brilla */
.slots { border-radius: 99px; border-color: rgba(232, 188, 110, .25); }
.slot { border-radius: 50%; background: radial-gradient(circle closest-side, #3a2f28 0 66%, var(--ink) 67% 72%, #e8d6ae 73% 92%, var(--ink) 93%); box-shadow: 0 3px 0 rgba(0,0,0,.45); }
#slots-p .slot:not(.empty) { background: radial-gradient(circle closest-side, #4a3530 0 66%, var(--ink) 67% 72%, #e8d6ae 73% 92%, var(--ink) 93%); }
.slot.empty { background: radial-gradient(circle closest-side, rgba(255,255,255,.03) 0 88%, rgba(232, 188, 110, .25) 89% 93%, transparent 94%); box-shadow: none; }
.ab { border: 4px solid var(--ink); outline: 0; box-shadow: 0 0 0 4px #e8d6ae, 0 0 0 6px var(--ink), var(--shadow); }
.ab .fill { opacity: 1; background: linear-gradient(0deg, #1f5aa8, #4aa8ff 70%, #8ad0ff); }
.ab.ult.ready { box-shadow: 0 0 0 4px #ffd060, 0 0 0 6px var(--ink), 0 0 24px #ff8a1e; }

/* 8A: timer in un riquadro scuro con il bordo dorato */
.hud-center { border-radius: 0 0 14px 14px; border: 2px solid rgba(232, 188, 110, .45); border-top: 0; background: rgba(23, 18, 15, .92); }
/* 8D: barra del boss color chakra con la cornice dorata e la luna rossa */
#boss-name { background: var(--ink); border: 2px solid #c9a24a; border-bottom: 0; }
#boss-name::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; background: #d8283a; box-shadow: 0 0 8px #d8283a; }
#bossbar .bar { border-radius: 4px; border: 3px solid var(--ink); background: #2a1a14; box-shadow: 0 0 0 2px #c9a24a, var(--shadow); }
#boss-fill { background: linear-gradient(180deg, #ff7a6a, #c8372d); }

/* 9A: minimappa dentro un anello di sigillo con le tacche */
#minimap { border: 7px solid #e8d6ae; outline: 3px dashed var(--ink); outline-offset: -5px; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #c9a24a, var(--shadow); }

/* 10B: fine partita (e pausa) come rapporto di missione su carta; il timbro solo a fine partita */
#overlay .run-panel .run-head {
  position: relative; color: var(--ink); border-radius: 0; border-top: 10px solid #7a4a28; border-bottom: 10px solid #7a4a28;
  background: radial-gradient(circle at 20% 30%, rgba(0,0,0,.04) 0 2px, transparent 3px) 0 0 / 23px 19px, linear-gradient(180deg, #f6ead0, #e8d6ae);
  box-shadow: 0 8px 18px rgba(0,0,0,.5); padding-right: 120px;
}
#overlay .run-panel .run-head::before, #overlay .run-panel .run-head::after { content: ''; position: absolute; top: -14px; bottom: -14px; width: 14px; border-radius: 7px; background: linear-gradient(90deg, #4a2c16, #b07a46, #4a2c16); }
#overlay .run-panel .run-head::before { left: -7px; } #overlay .run-panel .run-head::after { right: -7px; }
#overlay .run-panel .run-name { font-family: 'Shojumaru', var(--display); font-size: 32px; color: var(--ink); -webkit-text-stroke: 0; }
#overlay .run-panel .run-kicker { color: #5a4a3a; }
#overlay .run-panel .run-kicker .chip { --chip: #7a4a28; }
#overlay .run-panel .run-pic { background: #e3cf9f; border: 3px solid var(--ink); }
#overlay .run-panel .tiles-stat > div { background: rgba(122, 74, 40, .12); border: 2px solid rgba(122, 74, 40, .35); }
#overlay .run-panel .tiles-stat b { color: var(--ink); }
#overlay .run-panel .tiles-stat small { color: #6a5a48; }
#overlay .run-panel .tiles-stat .gold b { color: #a8641a; }
.run-stamp { display: none; }
.end-screen .run-stamp {
  display: grid; place-items: center; position: absolute; right: 22px; top: 50%; width: 82px; height: 82px; margin-top: -41px;
  border: 5px solid #c8372d; border-radius: 8px; color: #c8372d; font: 400 26px/1 'Shojumaru', serif; text-align: center;
  rotate: -14deg; opacity: .85; animation: stamp-in .35s cubic-bezier(.2, 1.6, .4, 1) .25s both;
}
.end-screen .run-head.lose .run-stamp { border-color: #4a4a52; color: #4a4a52; }
@keyframes stamp-in { from { transform: scale(2.4); opacity: 0; } }
@media (max-width: 640px) { #overlay .run-panel .run-head { padding-right: 16px; } .end-screen .run-stamp { width: 60px; height: 60px; margin-top: 0; top: 10px; right: 10px; font-size: 19px; } }

/* pausa: niente timbro, quindi niente spazio a destra; la vita resta rossa */
#overlay .pause-screen .run-head { padding-right: 20px; }
.run-panel .run-id .bar { border-radius: 4px; border: 2px solid var(--ink); background: #c8b488; }
.run-panel .run-id .bar i { background: linear-gradient(180deg, #6ff5a6, #2fb866); }

/* comandi touch come sigilli, come gli slot dei jutsu */
@media (pointer: coarse) {
  #touch-btns button { border: 4px solid var(--ink); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5);
    background: radial-gradient(circle closest-side, #3a2f28 0 70%, #2a221d 71%); box-shadow: 0 0 0 4px #e8d6ae, 0 0 0 6px var(--ink), var(--shadow); }
  #joystick { border: 3px dashed rgba(232, 214, 174, .55); background: rgba(23, 18, 15, .35); }
  #joystick .knob { background: radial-gradient(circle at 40% 35%, #ffaa50, #d8620a); box-shadow: 0 0 0 3px var(--ink); }
}

/* =========================================================
   Pelle Konoha: Dojo, scelta del ninja, intestazioni e chip (private/bozze-altre.html)
   1A card del Dojo, 2A ritratto ad anello, 2C barre chakra, 2E tessere dei ninja, 3B intestazioni con la corda, 4A chip a carta bomba
   ========================================================= */
/* 1A: card del Dojo di stoffa con la corda, icona in un sigillo, livelli a pallini, prezzo su un pulsante a placca */
.lab-card { position: relative; border: 3px solid var(--ink); border-radius: 12px; padding-bottom: 10px; box-shadow: inset 0 0 0 2px rgba(240, 204, 130, .45), 0 5px 0 rgba(0,0,0,.45), var(--shadow); }
.lab-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink); pointer-events: none; }
.lab-card:hover { border-color: var(--ink); box-shadow: inset 0 0 0 2px #ffe2a0, 0 7px 0 rgba(0,0,0,.45), 0 12px 30px color-mix(in srgb, var(--lc) 30%, transparent); }
.lab-top { height: 44px; margin-bottom: 36px; background: linear-gradient(180deg, var(--lc) 0 8px, color-mix(in srgb, var(--lc) 25%, transparent) 8px, transparent); }
.lab-lv { border-radius: 3px; background: var(--ink); border: 1px solid rgba(232, 188, 110, .35); }
.lab-ico {
  bottom: -32px; width: 60px; height: 60px; border: 0;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--lc) 60%, #fff) 0 30%, var(--lc) 31% 56%, var(--ink) 57% 61%, #f2e3c2 62% 92%, var(--ink) 93%);
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
}
.lab-ico > * { position: relative; z-index: 1; }
.lab-pips i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: #3a2f28; }
.lab-pips i.on { background: var(--lc); box-shadow: 0 0 0 1.5px #f2e3c2; }
.lab-buy {
  border: 3px solid var(--ink); border-radius: 8px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  background: var(--gloss), linear-gradient(180deg, #ffaa50, #ff8a1e 55%, #d8620a); box-shadow: inset 0 0 0 2px rgba(255, 236, 200, .35), 0 4px 0 #7a3406;
}
.lab-buy:not(.disabled):active { box-shadow: inset 0 0 0 2px rgba(255, 236, 200, .35), 0 1px 0 #7a3406; }
.lab-card.poor .lab-buy { color: #b5a28c; text-shadow: none; background: linear-gradient(180deg, #5a4a3a, #3a2f28); box-shadow: inset 0 0 0 2px rgba(232, 188, 110, .3), 0 4px 0 #0f0b09; }
.lab-card.maxed .lab-buy { color: #0d2a19; text-shadow: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), 0 4px 0 #145a32; }
.lab-card.maxed .lab-lv { background: var(--green); color: #0d2a19; }

/* 2A: ritratto del ninja tondo con l'anello dorato */
.hero-pic { border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 65%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 55%, #000));
  box-shadow: 0 0 0 5px #c9a24a, 0 6px 0 5px rgba(0,0,0,.4), 0 0 30px color-mix(in srgb, var(--c) 40%, transparent); }
.hero-pic::after { display: none; }
/* 2C: barre delle statistiche azzurro chakra con contorno scuro */
.hero-stats .meter { height: 12px; border-radius: 3px; border: 2px solid var(--ink); background: #2a1a14; }
.hero-stats .meter i { border-radius: 0; background: linear-gradient(90deg, #3a8ad8, #8ad0ff); }
/* 2E: tessere dei ninja di stoffa con la corda, ritratto in un tondo */
.rtile { border: 3px solid var(--ink); border-radius: 12px; justify-content: flex-start; padding-top: 8px; background: var(--card);
  box-shadow: inset 0 0 0 2px rgba(240, 204, 130, .45), 0 4px 0 rgba(0,0,0,.45); }
.rtile::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink); pointer-events: none; }
.rtile img { width: 64%; aspect-ratio: 1; height: auto; margin: 0 0 auto; object-fit: cover; object-position: 50% 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); border: 2px solid var(--ink); box-shadow: 0 0 0 2px #c9a24a; }
.rtile b { background: none; padding: 2px 0 10px; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.rtile.sel { border-color: var(--ink); box-shadow: inset 0 0 0 2px #ffd060, 0 0 0 3px #ffd060, 0 4px 0 rgba(0,0,0,.45); }
.rtile:not(.locked):hover { border-color: var(--ink); box-shadow: inset 0 0 0 2px #ffe2a0, 0 6px 0 rgba(0,0,0,.45), 0 10px 22px color-mix(in srgb, var(--c) 35%, transparent); }
.rtile.locked { background: #1c1613; }
.rtile.locked img { background: #2a221d; box-shadow: none; }

/* 3B: intestazioni dei pannelli col loro colore, contorno scuro e corda sotto */
.box-head { position: relative; border-bottom: 3px solid var(--ink); padding-bottom: 15px; }
.box-head::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(-60deg, #ecd08a 0 4px, #a8843a 4px 8px); border-top: 2px solid var(--ink); pointer-events: none; }

/* 4A: chip ed etichette come cartellini di carta bomba con la banda del colore */
.chip, .card-tag, .card-rar, .card-lvl:not(:empty), .kit, .m-land, .evo-line span, .gl-chip, .build-list .lv {
  border: 0; border-radius: 2px; border-left: 4px solid var(--tag-c, #8a7a68); color: var(--ink); text-shadow: none;
  background: linear-gradient(180deg, #f6ead0, #e3cf9f); box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.chip { --tag-c: var(--chip, #8a7a68); }
.chip.medal { --tag-c: var(--mc); }
.card-rar { --tag-c: var(--rar); }
.card-lvl:not(:empty) { --tag-c: var(--kc); }
.card-tag { --tag-c: var(--tagc, #8a7a68); }
.card-tag[style] { background: linear-gradient(180deg, #f6ead0, #e3cf9f); }
.m-land { --tag-c: var(--vc); }
.gl-chip { --tag-c: var(--gc); }
.build-list .lv { --tag-c: #ff8a1e; }
.kit.locked { background: transparent; color: inherit; border: 1px dashed currentColor; box-shadow: none; }

/* Pulsanti speciali (Scatto, Sostituzione, Segreta): anello di carica intorno al bordo.
   --p (0-100) lo imposta ui.js: per Scatto e Sostituzione e la ricarica, per la Segreta il chakra accumulato.
   Pieno = pronto; il resto dell'anello resta scuro. */
.ab { --p: 100; --rc: #8ad0ff; }
.ab::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), rgba(0, 0, 0, .6) 0);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 66%, #000 68%); mask: radial-gradient(circle closest-side, transparent 0 66%, #000 68%);
}
.ab .cd { background: rgba(0, 0, 0, .55); }
.ab.charging span { opacity: .55; }
.ab.ult { --rc: #4aa8ff; }
.ab.ult.ready { --rc: #ffd060; }
.ab.ult.ready span { color: #fff; text-shadow: 0 0 8px #ffd060, 0 2px 0 rgba(0,0,0,.5); }

/* Avvisi dei traguardi in partita (challenges.js): a sinistra sotto il ritratto e la serie di KO,
   cosi non coprono la minimappa e gli eventi a destra. Stile dei riquadri: stoffa con cornice dorata. */
#chal-toasts { top: calc(150px * var(--uiz, 1)); right: auto; left: 12px; }
.chal-toast { border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px #ffd060, 0 0 18px rgba(255, 201, 60, .35), 0 5px 0 rgba(0,0,0,.4); animation: chal-in .35s ease-out; }
.chal-toast.out { transform: translateX(-30px); }
.chal-toast .ct-ico { border: 2px solid var(--ink); }
@keyframes chal-in { from { opacity: 0; transform: translateX(-30px); } }
@media (max-width: 760px) { #chal-toasts { top: auto; bottom: 120px; left: 16px; right: 16px; } }

/* ---------------- Account e salvataggi online (main.js screens.account, cloud.js) ---------------- */
.account-screen { max-width: 560px; }
.acc-box .box-body { display: flex; flex-direction: column; gap: 12px; }
.acc-msg { margin: 0; padding: 8px 12px; border-radius: 4px; font: 800 13px/1.4 var(--body); border-left: 4px solid; background: rgba(15, 11, 9, .6); }
.acc-msg.ok { border-color: var(--green); color: #c8f5d8; }
.acc-msg.err { border-color: #c8372d; color: #ffc8c0; }
.acc-socials { display: grid; gap: 8px; }
.acc-social { justify-content: center; }
.acc-social.google { --bd: #9aa5b0; background: linear-gradient(180deg, #ffffff, #e3e8ee); color: #1f1f1f; }
.acc-social.discord { --bd: #2a2f8a; background: linear-gradient(180deg, #6a72f5, #4752c4); }
.acc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 800 12px/1 var(--body); }
.acc-or::before, .acc-or::after { content: ''; flex: 1; height: 2px; background: rgba(232, 188, 110, .25); }
.acc-form { display: flex; flex-direction: column; gap: 10px; }
.acc-form label { display: flex; flex-direction: column; gap: 4px; font: 900 12px/1 var(--body); color: var(--muted); }
.acc-form input[type=email], .acc-form input[type=password] {
  padding: 10px 12px; border-radius: 6px; border: 2px solid var(--ink); background: #f6ead0; color: var(--ink);
  font: 800 15px/1.2 var(--body); box-shadow: inset 0 2px 0 rgba(0,0,0,.12); user-select: text; -webkit-user-select: text;
}
.acc-form input:focus { outline: 3px solid #ff8a1e; outline-offset: 1px; }
.acc-check { flex-direction: row !important; align-items: flex-start; gap: 8px !important; font: 700 12.5px/1.35 var(--body) !important; color: #e8dcc8 !important; }
.acc-check input { margin-top: 1px; accent-color: #ff8a1e; }
.acc-switch { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0; font: 800 13px/1.3 var(--body); }
.acc-switch a { color: #ffcf8a; cursor: pointer; }
.acc-legal { margin: 0; font: 700 11.5px/1.45 var(--body); color: var(--muted); }
.acc-legal a, .fan-note a { color: #ffcf8a; }
.acc-user { display: flex; align-items: center; gap: 12px; }
.acc-av { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 400 26px var(--display);
  background: radial-gradient(circle at 40% 35%, #ffaa50, #d8620a); border: 3px solid var(--ink); box-shadow: 0 0 0 3px #c9a24a; }
.acc-user b { display: block; font: 400 19px/1.2 var(--display); }
.acc-user small { display: block; color: var(--muted); font: 700 12px/1.4 var(--body); }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-danger { padding-top: 10px; border-top: 2px dashed rgba(232, 188, 110, .2); }
.acc-danger p { margin: 0 0 8px; font: 700 12.5px/1.4 var(--body); color: #ffc8c0; }
.acc-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-save { text-align: left; cursor: pointer; padding: 12px; color: var(--text); background: var(--card-2); border: 3px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(240, 204, 130, .4), 0 4px 0 rgba(0,0,0,.4); }
.acc-save:hover { box-shadow: inset 0 0 0 2px #ffd060, 0 0 0 3px #ffd060, 0 4px 0 rgba(0,0,0,.4); }
.acc-save b { display: block; font: 400 17px/1.2 var(--display); margin-bottom: 4px; }
.acc-save small { display: block; color: var(--muted); font: 700 12px/1.4 var(--body); }
@media (max-width: 520px) { .acc-choice { grid-template-columns: 1fr; } }
.hpill.acc-pill.on::before { background: #3fd47a; }
/* avviso del fan game in fondo alla home */
.fan-note { margin: 10px 0 0; max-width: 560px; font: 700 11px/1.4 var(--body); color: rgba(246, 233, 210, .75); text-shadow: 0 1px 2px #000, 0 0 4px #000; }

/* ---------- Consenso alle statistiche di gioco (telemetry.js) ---------- */
.bi-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  width: min(560px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 16px;
  background: var(--card); border: 2px solid rgba(232, 188, 110, .25); box-shadow: var(--shadow);
  color: var(--text); font-size: 13px; line-height: 1.45; display: flex; gap: 12px; align-items: center;
  animation: biIn .35s ease-out;
}
.bi-banner p { margin: 0; flex: 1; }
.bi-banner b { color: var(--accent-2); }
.bi-banner a { color: var(--muted); margin-left: 4px; }
.bi-banner .bi-btns { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
@keyframes biIn { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (max-width: 560px) {
  .bi-banner { flex-direction: column; align-items: stretch; }
  .bi-banner .bi-btns { flex-direction: row; }
  .bi-banner .bi-btns .btn { flex: 1; }
}
.settings-screen .help-text a { color: #ffcf8a; }
