:root {
  --fs-chat: 15px;
  --fs-side: 13.5px;
  --fs-btns: 12.5px;
  --fs-menu: 12.5px;
  --col-left: 258px;
  --col-right: 295px;
  --bg: #221d18;
  --parchment-dark: #2c251f;
  --panel: rgba(42, 35, 29, 0.94);
  --panel2: #362d25;
  --washi: #f5f2eb;
  --line: rgba(197, 160, 89, 0.38);
  --text: #f5f2eb;
  --muted: #c2b8a8;
  --accent: #d4ab59;
  --cinnabar: #991b1b;
  --cinnabar-bright: #dc2626;
  --speech: #fca5a5;
  --ok: #10b981;
  --err: #dc2626;
  --hp: #dc2626;
  --chakra: #38bdf8;
  --stamina: #d97706;
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(153, 27, 27, 0.68);
  color: #f5f2eb;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #221d18;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 171, 89, 0.42);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 171, 89, 0.72);
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  caret-color: var(--accent);
}

[hidden] {
  display: none !important;
}

button, select, input, textarea {
  font: inherit;
  color: inherit;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 9px;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

button {
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
  color: var(--washi);
  border-color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
}
button.on {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #a7f3d0;
}
button.x {
  padding: 0 8px;
}

/* ============================================================================
   1. TOP NAVIGATION BAR
============================================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Barra in alto adattiva, sempre su UNA riga: marchio | menu | utente. Il menu occupa lo spazio che resta e distribuisce i pulsanti
   con un po' d'aria; quando la larghezza cala, la barra si compatta a gradini (via le icone, etichette brevi, caratteri più piccoli)
   invece di andare a capo. Il pulsante STAFF dell'admin è già conteggiato. */
.topbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 0.8vw, 16px);
  padding: 0 clamp(8px, 1vw, 16px);
  background: rgba(36, 30, 25, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  z-index: 40;
  flex-wrap: nowrap;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: linear-gradient(180deg, #352b23, #211b16);
  border: 1px solid rgba(212, 171, 89, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fox-logo {
  width: 24px;
  height: 24px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-title strong {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--washi);
}
.brand-title strong span {
  color: var(--accent);
}
.brand-title small {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
}

.weather-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 3px;
  background: #1b1612;
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65);
  margin-left: 6px;
}
.weather-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.clock {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  flex-wrap: nowrap;
}

.nav-btn {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px clamp(5px, 0.7vw, 14px);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 0.78vw, 13.5px);
  letter-spacing: 0.09em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.nav-btn svg,
.nav-ico {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.88;
}
.nav-btn:hover svg,
.nav-btn.active svg,
.nav-btn:hover .nav-ico,
.nav-btn.active .nav-ico {
  opacity: 1;
  color: #fde68a;
}
.nav-btn:hover {
  color: var(--washi);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 171, 89, 0.3);
}
.nav-btn.active {
  color: var(--washi);
  background: linear-gradient(180deg, rgba(153, 27, 27, 0.36), rgba(153, 27, 27, 0.08));
  border-color: rgba(212, 171, 89, 0.5);
}
.badge-notif {
  background: var(--cinnabar);
  border: 1px solid var(--accent);
  color: var(--washi);
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 99px;
  line-height: 1.35;
}

.right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  flex-shrink: 0;
}

.online-radar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 3px;
  background: #1b1612;
  border: 1px solid var(--line);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: radarPulse 1.8s infinite;
}
@keyframes radarPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-sheet-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 9px;
  background: #1b1612;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.who-tag {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}
.who-tag:hover {
  color: #fde68a;
}

.user-sheet-btn {
  padding: 3px 8px;
  background: rgba(153, 27, 27, 0.28);
  border: 1px solid rgba(212, 171, 89, 0.48);
  border-radius: 2px;
  color: var(--washi);
  font-size: 11.5px;
}
.user-sheet-btn:hover,
.user-sheet-btn.active {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  border-color: #fde68a;
  color: var(--washi);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
}

.ctrl-btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  background: #26201a;
}
.exit-btn {
  background: rgba(153, 27, 27, 0.32);
  border-color: rgba(153, 27, 27, 0.75);
}
.exit-btn:hover {
  background: rgba(153, 27, 27, 0.58);
}

/* ============================================================================
   2. NEWS TICKER ("Ultim'ora" — Scrolling Marquee & Distinct Amber-Gold/Bronze Theme)
============================================================================ */
.news-ticker {
  min-height: 34px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #3a2212 0%, #59351a 50%, #3a2212 100%);
  border-bottom: 1px solid #d4ab59;
  box-shadow: inset 0 1px 0 rgba(253, 230, 138, 0.2), 0 2px 10px rgba(0, 0, 0, 0.35);
  padding: 4px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}
.ticker-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.ticker-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, #d4ab59, #b58938);
  border: 1px solid #fde68a;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #1c1917;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.ticker-marquee-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
}
.ticker-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
  animation: tickerMarquee 26s linear infinite;
}
.ticker-marquee-viewport:hover .ticker-marquee-track {
  animation-play-state: paused;
}
.ticker-marquee-track span {
  font-size: 12.5px;
  font-weight: 600;
  color: #fef3c7;
  letter-spacing: 0.03em;
}
@keyframes tickerMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.banner {
  background: rgba(153, 27, 27, 0.78);
  border: 1px solid #fde68a;
  color: #fde68a;
  padding: 2px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

/* ============================================================================
   3. MAIN WORKSPACE & LEFT SIDEBAR ("Mondo di Gioco" + SOLO PRESENTI)
============================================================================ */
.cols {
  flex: 1;
  min-height: 0;
  display: flex;
}

.col-left {
  width: var(--col-left);
  min-width: 215px;
  padding: 10px;
  overflow-y: auto;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--line);
  font-size: var(--fs-side);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-header {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 171, 89, 0.25);
}
.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-title-row h2 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0;
}
.sidebar-chip {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 2px 7px;
  border-radius: 2px;
  background: #1b1612;
  border: 1px solid var(--line);
  color: var(--muted);
}
.sidebar-sub {
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-ornament {
  display: flex;
  align-items: center;
  gap: 5px;
}
.bar-red {
  width: 28px;
  height: 2px;
  background: var(--cinnabar);
}
.bar-gold {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 171, 89, 0.55), transparent);
}

.lore-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lore-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  background: rgba(28, 23, 19, 0.72);
  border: 1px solid rgba(212, 171, 89, 0.2);
  text-align: left;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, background 0.18s ease;
}
.lore-item:hover {
  transform: translateX(6px);
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(153, 27, 27, 0.34), rgba(45, 37, 30, 0.85));
}
.lore-icon {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  background: #231d18;
  border: 1px solid var(--line);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lore-item:hover .lore-icon {
  background: var(--cinnabar);
  color: var(--washi);
  border-color: var(--accent);
}
.lore-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.lore-label strong {
  font-size: 12px;
  color: var(--washi);
  line-height: 1.2;
}
.lore-label small {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lore-arrow {
  color: var(--accent);
  font-weight: 700;
}

/* Presenti Only Box in Left Sidebar (Warm Washi Cream Accent Card) */
.sidebar-subpanel {
  margin-top: auto;
  padding: 10px 12px;
  background: #f5f2eb;
  color: #1c1917;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
}
.members h3 {
  font-family: 'Cinzel', serif;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: #991b1b;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.member {
  padding: 4px 8px;
  margin-top: 4px;
  background: rgba(28, 25, 23, 0.08);
  border: 1px solid rgba(28, 25, 23, 0.15);
  border-radius: 3px;
  font-weight: 600;
  font-size: 12.5px;
  color: #1c1917;
  display: flex;
  align-items: center;
  gap: 7px;
}
.member::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* ============================================================================
   CENTER AREA: TACTICAL SHINOBI WORLD MAP & VILLAGE MAPS
============================================================================ */
.col-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
  background: #1e1915;
}

.world-stage-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tactical-map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(212, 171, 89, 0.52);
  border-radius: 4px;
  overflow: hidden;
  background-color: #161310;
  background-image:
    linear-gradient(to right, rgba(197, 160, 89, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(197, 160, 89, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #1d1814 0%, #120f0c 100%);
  background-size: 52px 52px, 52px 52px, 100% 100%;
  box-shadow: inset 0 0 65px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tactical-svg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-hud-topleft {
  position: relative;
  z-index: 10;
  margin: 12px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(26, 22, 18, 0.9);
  border: 1px solid rgba(212, 171, 89, 0.5);
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  width: fit-content;
}
.cinnabar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cinnabar-bright);
}
.map-hud-topleft small {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-left: 4px;
}

.map-compass {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.compass-wheel {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(26, 22, 18, 0.9);
  border: 1px solid rgba(212, 171, 89, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.compass-wheel span {
  position: absolute;
  font-family: 'Rajdhani', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
}
.compass-wheel .dir-n { top: 2px; color: var(--cinnabar-bright); }
.compass-wheel .dir-s { bottom: 2px; }
.compass-wheel .dir-w { left: 4px; }
.compass-wheel .dir-e { right: 4px; }
.compass-label {
  margin-top: 3px;
  padding: 2px 9px;
  background: rgba(26, 22, 18, 0.92);
  border: 1px solid rgba(212, 171, 89, 0.5);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
}

/* Interactive Map Pins on World Map */
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.pin-pulse {
  position: absolute;
  width: 56px;
  height: 56px;
  top: -6px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.3);
  opacity: 0;
  pointer-events: none;
}
.suna-pulse {
  background: rgba(212, 171, 89, 0.3);
}
.map-pin:hover .pin-pulse {
  opacity: 1;
  animation: pinRadar 1.4s infinite;
}
@keyframes pinRadar {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}
.pin-medallion-row {
  position: relative;
  display: flex;
  align-items: center;
}
.active-chakra-tag {
  position: absolute;
  left: calc(100% + 8px);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(245, 242, 235, 0.72);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
.pin-medallion {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
  padding: 0;
}
.konoha-medallion {
  background: radial-gradient(circle, #b91c1c 0%, #450a0a 85%);
  color: var(--washi);
  border-color: #fde68a;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45), 0 0 24px rgba(220, 38, 38, 0.85);
}
.suna-medallion {
  background: radial-gradient(circle, #3b3128 0%, #171310 85%);
  color: var(--accent);
  box-shadow: 0 0 18px rgba(212, 171, 89, 0.35);
}
.map-pin:hover .pin-medallion {
  transform: scale(1.1);
}
.pin-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #1b1612;
  border: 1px solid var(--accent);
  color: #10b981;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-plate {
  margin-top: 4px;
  padding: 2px 9px;
  background: rgba(26, 22, 18, 0.95);
  border: 1px solid rgba(212, 171, 89, 0.55);
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--washi);
}
.pin-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  padding: 8px 10px;
  border-radius: 3px;
  background: var(--washi);
  color: #1c1917;
  border: 2px solid var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  display: none;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  z-index: 30;
}
.map-pin:hover .pin-tooltip {
  display: flex;
}
.pin-tooltip strong {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  color: #1c1917;
}
.pin-tooltip span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--cinnabar);
}
.pin-tooltip small {
  font-size: 10.5px;
  color: #57534e;
}

/* 4. BOTTOM DOCK ("Luoghi — Scegli dove giocare" — Sotto alla Mappa) */
.bottom-dock {
  position: relative;
  z-index: 20;
  padding: 9px 12px;
  background: rgba(28, 23, 19, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 171, 89, 0.48);
  border-radius: 4px;
  flex-shrink: 0;
}
.bottom-dock-below {
  margin: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dock-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dock-accent {
  width: 4px;
  height: 14px;
  background: var(--cinnabar);
}
.dock-title h3 {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  margin: 0;
}
.dock-presence-pill {
  padding: 3px 10px;
  background: #231d18;
  border: 1px solid rgba(212, 171, 89, 0.5);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #10b981;
}
.dock-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.village-card {
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #2d251e, #211b16);
  border: 1px solid rgba(212, 171, 89, 0.4);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}
.village-card:hover {
  border-color: var(--accent);
}
.card-watermark {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 96px;
  height: 96px;
  color: var(--accent);
  opacity: 0.09;
  pointer-events: none;
}
.vcard-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.vcard-top h4 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  margin: 0;
  color: var(--washi);
}
.vcard-top h4 span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.vcard-top small {
  font-size: 11px;
  color: var(--accent);
}
.vcard-presence {
  padding: 2px 8px;
  border-radius: 2px;
  background: #181410;
  border: 1px solid var(--line);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #10b981;
}
.vcard-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.vcard-room-hint {
  font-size: 11px;
  color: var(--muted);
}
.btn-enter-chat {
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
  border: 1px solid var(--accent);
  color: var(--washi);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 11px;
}

/* ============================================================================
   STAGE 2: TACTICAL VILLAGE MAP (KONOHA / SUNA)
============================================================================ */
.tactical-back-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 25;
  padding: 6px 16px;
  background: rgba(26, 22, 18, 0.94);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}
.tactical-back-btn:hover {
  background: var(--cinnabar);
  color: var(--washi);
}

.tactical-village-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(26, 22, 18, 0.94);
  color: var(--washi);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}

.village-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #231d18;
}

.village-illustrated-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Tactical Location Pins on Konoha & Suna Maps */
.vmap-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.vpin-circle {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7f1e3, #e6d8be);
  border: 2px solid #b89758;
  color: #991b1b;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.75);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.vpin-circle.konoha-core {
  background: linear-gradient(180deg, #faf5e8, #ebdcc2);
  border-color: #d4ab59;
  color: #991b1b;
}
.vmap-pin:hover .vpin-circle {
  transform: scale(1.14);
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  border-color: #fde68a;
  color: var(--washi);
}
.vpin-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: #181410;
  border: 1px solid var(--accent);
  color: #10b981;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vpin-label {
  padding: 3px 12px;
  background: rgba(246, 239, 224, 0.96);
  border: 1.5px solid #b89758;
  border-radius: 99px;
  color: #29221c;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.72);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.vmap-pin:hover .vpin-label {
  background: var(--cinnabar);
  color: var(--washi);
  border-color: #fde68a;
}

/* ============================================================================
   STAGE 3: CHAT WORKSPACE & RIGHT SIDEBAR (AI ASSISTANT IN BACKGROUND)
============================================================================ */
.chat-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.room-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.room-head-titles {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.room-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0;
}
.room-head small {
  color: var(--muted);
}
.map-toggle-btn {
  margin-left: auto;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: var(--fs-chat);
  background: rgba(34, 28, 23, 0.94);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
}
.msg {
  margin: 0 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85em;
  color: var(--muted);
}
.msg-head strong {
  color: var(--text);
}
.msg-head strong.author-master {
  color: #e5c07b;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.msg-head strong.author-sensei-ai {
  color: #f7fafc;
  font-weight: 700;
}
.msg .time {
  margin-left: auto;
}
.place {
  color: var(--accent);
}
.tag {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 0.8em;
  margin-left: 6px;
}
.speech {
  color: var(--speech);
}
.gesture {
  font-style: italic;
}
.name {
  text-decoration: underline;
  font-weight: 700;
}
.figure {
  display: inline-block;
  vertical-align: middle;
  color: var(--accent);
  margin: 2px 6px;
}
.msg.whisper {
  border-left: 1px solid #a78bfa;
  padding-left: 8px;
  font-style: italic;
}
.msg.narrator {
  border: 1px solid var(--accent);
  background: #2f261b;
  border-radius: 4px;
  padding: 8px 12px;
}
.msg.sys {
  color: var(--muted);
  text-align: center;
  font-size: 0.85em;
}
.npc-slot {
  margin-top: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.engine {
  margin-top: 6px;
  font-size: 0.8em;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}
.typing {
  height: 1.3em;
  color: var(--accent);
  font-style: italic;
  font-size: 0.85em;
}
.action-badge {
  align-self: flex-start;
  background: #3a1214;
  border: 1px solid var(--err);
  color: #ffb3ae;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.9em;
  margin-bottom: 4px;
}

.toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
  font-size: var(--fs-btns);
}
.toolbar > * {
  font-size: var(--fs-btns);
}
.composer {
  display: flex;
  gap: 8px;
}
.composer textarea {
  flex: 1;
  resize: vertical;
  font-size: var(--fs-chat);
}
.composer-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 96px;
}
.counter {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counter.valid {
  color: var(--ok);
}
.counter.over {
  color: var(--err);
  font-weight: 700;
}
.npc-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.npc-row input {
  flex: 1;
}

/* RIGHT SIDEBAR: AI ASSISTANT IN BACKGROUND */
.col-right {
  width: var(--col-right);
  min-width: 200px;
  padding: 10px;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  font-size: var(--fs-side);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resizer {
  width: 4px;
  cursor: col-resize;
  background: rgba(212, 171, 89, 0.22);
  touch-action: none;
}
.resizer:hover {
  background: var(--accent);
}

.side-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  background: var(--panel2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ai-box {
  border-color: var(--accent);
  background: linear-gradient(180deg, #352b22, #251e18);
}
.ai-box-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ai-box-head h3 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--accent);
  margin: 0;
}
.ai-box-head small {
  color: var(--muted);
  font-size: 11px;
}
.ai-orb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #78716c;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.ai-orb.active {
  background: #10b981;
}

.side-box.training {
  border-color: var(--ok);
  background: #162b21;
}
.bar {
  position: relative;
  height: 16px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
}
.bar-fill.hp { background: var(--hp); }
.bar-fill.chakra { background: var(--chakra); }
.bar-fill.stamina { background: var(--stamina); }
.bar-fill.train { background: var(--ok); }
.bar-label {
  position: absolute;
  left: 6px;
  top: -1px;
  font-size: 11px;
  z-index: 1;
  text-shadow: 0 0 3px #000;
}
.fighter.ko { opacity: 0.5; }
.fname { font-weight: 600; }
.hint { color: var(--muted); font-size: 0.85em; margin: 2px 0; }
.warn { color: #ffcf66; }

/* Modals & Login */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: #28211b;
  border: 1px solid var(--accent);
  border-radius: 4px;
  width: min(480px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
}
.modal.wide {
  width: min(760px, 96vw);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: 'Cinzel', serif;
  color: var(--accent);
}
.modal-body {
  padding: 14px;
  overflow: auto;
}
.builder { display: flex; flex-direction: column; gap: 8px; }
.builder select { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: 4px; }
.radio { display: flex; gap: 6px; align-items: center; }
.tech-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tech-item { text-align: left; display: flex; flex-direction: column; }
.help-out { height: 46vh; overflow: auto; margin-bottom: 8px; }
.q { color: var(--accent); margin-top: 8px; }
.a { white-space: pre-wrap; margin-bottom: 6px; }
.help .row input { flex: 1; }
.doc h2 { color: var(--accent); font-family: 'Cinzel', serif; }
.doc p { margin: 6px 0; }
.report { border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 8px; }
.report.resolved { opacity: 0.6; }
.snap { font-size: 0.85em; color: var(--muted); }
.aa label { display: flex; flex-direction: column; margin-bottom: 10px; }
.stat { margin: 4px 0; }
.tech-row { margin: 8px 0; }

#editor {
  position: fixed;
  z-index: 40;
  width: min(560px, 90vw);
  background: #28211b;
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 8px 30px #000a;
}
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  cursor: move;
  background: var(--panel2);
  touch-action: none;
}
#editor textarea {
  width: 100%;
  border-radius: 0;
  font-size: var(--fs-chat);
  resize: vertical;
}
#editor .hint { padding: 4px 10px; }

#toasts {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toast {
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--err);
  border: 1px solid var(--accent);
  color: #fff;
  max-width: 340px;
}
.toast.ok {
  background: #065f46;
}

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(circle at center, #382e25 0%, #1d1814 75%);
}
.login-card {
  background: #28211b;
  padding: 28px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(400px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand h1 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  letter-spacing: 0.18em;
  margin: 0;
}
.login-brand h1 span {
  color: var(--accent);
}
.login-brand small {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ============================================================================
   STAGE 4: SCHEDA GIOCATORE COMPLETA ("Modern Shinobi Washi & Tactical Dossier")
============================================================================ */
.sheet-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ede2cc 0%, #e4d6bc 100%);
  color: #29221c;
  border: 1.5px solid #c5a059;
  border-radius: 4px;
  box-shadow: inset 0 0 40px rgba(138, 108, 62, 0.22), 0 8px 28px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.sheet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: linear-gradient(90deg, #dfd2b6 0%, #e9dec7 50%, #dfd2b6 100%);
  border-bottom: 1.5px solid rgba(161, 124, 67, 0.45);
  flex-shrink: 0;
}

.sheet-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sheet-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  border-radius: 0;
  padding: 6px 14px;
  font-family: 'Cinzel', serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #5c4b3b;
  text-transform: uppercase;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sheet-tab-btn:hover {
  color: #991b1b;
  background: rgba(153, 27, 27, 0.06);
}
.sheet-tab-btn.active {
  color: #991b1b;
  border-bottom-color: #991b1b;
  background: rgba(153, 27, 27, 0.08);
}

.sheet-back-btn {
  background: #f6f0e2;
  color: #7c2d12;
  border: 1px solid #b89758;
  border-radius: 3px;
  padding: 5px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.sheet-back-btn:hover {
  background: #991b1b;
  color: #f6f0e2;
  border-color: #991b1b;
}

.sheet-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 34px;
}
.sheet-scroll-area::-webkit-scrollbar-track {
  background: #dfd2b6;
}
.sheet-scroll-area::-webkit-scrollbar-thumb {
  background: #b08d4f;
}

.sheet-dossier-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* Left Column: Trading Card + Vital Bars + Quick Seal */
.sheet-left-col {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shinobi-trading-card {
  position: relative;
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(145deg, #1b4d3e 0%, #0f2e24 55%, #163a2e 100%);
  border: 3px solid #2b6e56;
  box-shadow: 0 12px 28px rgba(28, 22, 16, 0.38), inset 0 0 18px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.shinobi-trading-card.suna-theme {
  background: linear-gradient(145deg, #6b4c2b 0%, #3d2a16 55%, #543b20 100%);
  border-color: #c5a059;
}

.stcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: linear-gradient(90deg, rgba(12, 36, 28, 0.92), rgba(28, 78, 60, 0.85));
  border: 1.5px solid #84a98c;
  border-radius: 6px 6px 0 0;
}
.stcard-crest {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #132a21;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
}
.stcard-name {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f8fafc;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.stcard-art-wrap {
  position: relative;
  height: 310px;
  border: 1.5px solid #84a98c;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  background: #1e293b;
}
.stcard-svg-art {
  width: 100%;
  height: 100%;
  display: block;
}
.stcard-rank-ribbon {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(212, 171, 89, 0.65);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.stcard-rank-ribbon span {
  color: #fde68a;
}

.sheet-vitals-card {
  background: #f7f1e3;
  border: 1px solid #c5a875;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(45, 35, 22, 0.08);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sheet-vitals-title {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7c2d12;
  border-bottom: 1px solid rgba(161, 124, 67, 0.3);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.vital-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.vital-row-head {
  display: flex;
  justify-content: space-between;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #3b3026;
}
.vital-track {
  height: 8px;
  border-radius: 99px;
  background: #dfd3bc;
  overflow: hidden;
  border: 1px solid rgba(120, 95, 55, 0.25);
}
.vital-fill {
  height: 100%;
  border-radius: 99px;
}
.vital-fill.hp { background: linear-gradient(90deg, #991b1b, #dc2626); }
.vital-fill.chakra { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.vital-fill.stamina { background: linear-gradient(90deg, #b45309, #f59e0b); }

.sheet-quick-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sq-badge {
  background: #efe6d2;
  border: 1px solid #c8b084;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.sq-badge small {
  font-family: 'Cinzel', serif;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: #854d0e;
}
.sq-badge strong {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #29221c;
}

/* Right Column: Character Header, Sub-tabs, Data Rows, Alignment, Background, Notes */
.sheet-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sheet-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #b89b67;
}
.sheet-char-name {
  font-family: 'Cinzel', serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #231c16;
  margin: 0;
  line-height: 1;
}
.sheet-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sheet-outline-btn {
  background: #f5efe0;
  color: #3b3026;
  border: 1px solid #a88b56;
  border-radius: 3px;
  padding: 6px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.sheet-outline-btn:hover,
.sheet-outline-btn.active {
  background: #991b1b;
  color: #f5efe0;
  border-color: #7f1d1d;
}

.sheet-subtabs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-subtab {
  background: transparent;
  color: #6b5744;
  border: 1px solid transparent;
  padding: 5px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sheet-subtab.active {
  background: #f7f1e3;
  color: #991b1b;
  border-color: #b89b67;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Dati Anagrafici Rows */
.sheet-data-list {
  display: flex;
  flex-direction: column;
}
.sdata-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(168, 139, 86, 0.35);
}
.sdata-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f7f1e3;
  border: 1px solid #c5a875;
  color: #991b1b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 15px;
}
.sdata-icon.kanji-fire {
  background: radial-gradient(circle, #b91c1c 0%, #7f1d1d 100%);
  color: #fef2f2;
  border-color: #d4ab59;
  font-size: 17px;
}
.sdata-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sdata-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8c2d19;
  text-transform: uppercase;
}
.sdata-label span {
  color: #786652;
  font-weight: 600;
  font-size: 10px;
}
.sdata-value {
  font-family: 'Cinzel', serif;
  font-size: 15.5px;
  font-weight: 600;
  color: #231c16;
}
.sdata-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sheet-input,
.sheet-select {
  background: #faf5e8;
  color: #231c16;
  border: 1px solid #bfa372;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 13px;
  min-width: 210px;
}
.sheet-action-btn {
  background: #991b1b;
  color: #f8fafc;
  border: 1px solid #7f1d1d;
  border-radius: 3px;
  padding: 6px 15px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sheet-action-btn:hover {
  background: #b91c1c;
}
.sdata-note {
  font-size: 12.5px;
  font-style: italic;
  color: #4a3d31;
  margin: 2px 0 0;
}

.sdata-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(168, 139, 86, 0.35);
}

/* Section Headers inside Scheda */
.sheet-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #b89b67;
  margin-top: 8px;
}
.sheet-sec-head h3 {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #231c16;
  margin: 0;
  text-transform: uppercase;
}
.sheet-sec-head small {
  font-style: italic;
  font-size: 12.5px;
  color: #5c4b3b;
}
.sheet-sec-desc {
  font-style: italic;
  font-size: 13px;
  color: #4a3d31;
  margin: 6px 0 12px;
  line-height: 1.5;
}

/* Alignment Tracks ("il percorso del ninja") */
.alignment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.align-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.align-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.align-title {
  color: #991b1b;
}
.align-val {
  color: #231c16;
}
.align-bar-wrap {
  position: relative;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, #b8967a 0%, #f5efe0 50%, #9ab08f 100%);
  border: 1px solid #a68b5b;
  cursor: pointer;
}
.align-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 4px;
  background: #231c16;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
.align-poles {
  display: flex;
  justify-content: space-between;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #5c4b3b;
}

/* Background Story Reader & Editor */
.bg-story-reader {
  background: #fbf8f1;
  border: 1px solid #c5a875;
  border-radius: 6px;
  padding: 22px 26px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
  line-height: 1.7;
  color: #231c16;
}
.bg-chapter-kicker {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #15803d;
  text-transform: uppercase;
  margin: 14px 0 4px;
}
.bg-chapter-kicker:first-child {
  margin-top: 0;
}
.bg-chapter-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  color: #7c2d12;
  margin: 0 0 10px;
}
.bg-story-reader p {
  font-size: 14.5px;
  margin: 0 0 14px;
}

/* Statistiche Grid inside Scheda */
.sheet-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sheet-stat-card {
  background: #f7f1e3;
  border: 1px solid #c5a875;
  border-radius: 5px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-stat-info strong {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #7c2d12;
  display: block;
}
.sheet-stat-info small {
  font-size: 11.5px;
  color: #5c4b3b;
}
.sheet-stat-Right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sheet-stat-val {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  color: #231c16;
}

/* Note Off & Note del Fato */
.sheet-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sheet-note-box {
  background: #f6efe0;
  border: 1px solid #c5a875;
  border-radius: 5px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-note-box textarea {
  width: 100%;
  min-height: 92px;
  background: #fbf8f1;
  color: #231c16;
  border: 1px solid #bfa372;
  border-radius: 4px;
  padding: 8px 10px;
  resize: vertical;
}
.fate-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #e6d7bc;
  border: 1px solid #b89b67;
  font-family: 'Cinzel', serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #7c2d12;
}

/* Zona Pericolo */
.sheet-danger-zone {
  margin-top: 10px;
  padding: 16px 20px;
  background: rgba(153, 27, 27, 0.06);
  border: 1.5px solid rgba(153, 27, 27, 0.45);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sheet-danger-zone h4 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: #991b1b;
  margin: 0 0 4px;
}
.sheet-danger-zone p {
  font-size: 12.5px;
  color: #4a3d31;
  margin: 0;
}

/* Sub-views (Inventario, Jutsu, Accademia, Libreria, Richieste) */
.sheet-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sheet-item-card {
  background: #f7f1e3;
  border: 1px solid #c5a875;
  border-radius: 5px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-item-card h4 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: #7c2d12;
  margin: 0;
}
.sheet-item-card p {
  font-size: 12.5px;
  color: #4a3d31;
  margin: 0;
}

/* ============================================================================
   STAGES 5..11: PAGINE HTML DEDICATE CON MENU INTERATTIVO LATERALE E SCROLL FLUIDO
============================================================================ */
.dedicated-page-stage {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.codex-split-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
}

/* Menu Laterale Interattivo per scorrere rapidamente tra le sezioni della pagina */
.codex-side-nav {
  background: linear-gradient(180deg, #231c16 0%, #19130f 100%);
  color: #f5f2eb;
  border-right: 1.5px solid #c5a059;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.codex-side-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(212, 171, 89, 0.35);
  background: rgba(15, 11, 8, 0.45);
  flex-shrink: 0;
}
.codex-side-kicker {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #d4ab59;
  text-transform: uppercase;
}
.codex-side-head h3 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: #f5f2eb;
  margin: 3px 0 2px;
}
.codex-side-head small {
  font-size: 11.5px;
  color: #b5a38a;
}

.codex-side-links {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.csl-group-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #d4ab59;
  padding: 8px 6px 3px;
  border-bottom: 1px solid rgba(212, 171, 89, 0.25);
  margin-top: 4px;
}
.csl-group-label:first-child {
  margin-top: 0;
}

.codex-side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 171, 89, 0.2);
  color: #e7d8c1;
  text-align: left;
  transition: all 0.16s ease;
}
.codex-side-link:hover {
  background: rgba(153, 27, 27, 0.35);
  border-color: #d4ab59;
  color: #ffffff;
  transform: translateX(3px);
}
.codex-side-link.active {
  background: linear-gradient(90deg, #991b1b 0%, #6b1414 100%);
  border-color: #fde68a;
  color: #fde68a;
  box-shadow: 0 2px 10px rgba(153, 27, 27, 0.45);
}
.csl-num {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(212, 171, 89, 0.45);
  color: #fde68a;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.csl-txt {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.codex-side-foot {
  padding: 10px 12px;
  border-top: 1px solid rgba(212, 171, 89, 0.3);
  background: rgba(15, 11, 8, 0.55);
  flex-shrink: 0;
}
.w-full {
  width: 100%;
  justify-content: center;
}

/* Corpo scorrevole verticalmente della pagina dedicata */
.codex-scroll-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 30px 64px;
  scroll-behavior: smooth;
}
.codex-scroll-body::-webkit-scrollbar-track {
  background: #dfd2b6;
}
.codex-scroll-body::-webkit-scrollbar-thumb {
  background: #9c7a3c;
  border-radius: 4px;
}

.codex-part-divider {
  padding: 16px 24px;
  border-radius: 6px;
  background: linear-gradient(90deg, #7c2d12 0%, #431407 100%);
  border: 1.5px solid #d4ab59;
  color: #fde68a;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.codex-part-divider span {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.codex-part-divider small {
  font-size: 13px;
  color: #f5f2eb;
  font-style: italic;
}

.codex-container {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.codex-hero-banner {
  position: relative;
  padding: 28px 32px;
  border-radius: 6px;
  background: radial-gradient(circle at 80% 20%, #3d2419 0%, #241b15 65%, #18120e 100%);
  border: 2px solid #c5a059;
  color: #f5f2eb;
  box-shadow: 0 10px 30px rgba(28, 22, 16, 0.28);
  overflow: hidden;
}
.codex-hero-watermark {
  position: absolute;
  right: 20px;
  bottom: -18px;
  font-family: 'Cinzel', serif;
  font-size: 130px;
  color: rgba(212, 171, 89, 0.08);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
.codex-era-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 3px;
  background: rgba(153, 27, 27, 0.55);
  border: 1px solid #d4ab59;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #fde68a;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.codex-hero-banner h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: 0.14em;
  color: #f5f2eb;
  margin: 0 0 8px;
}
.codex-hero-banner h1 span {
  color: #d4ab59;
}
.codex-hero-lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: #e7d8c1;
  margin: 0;
  max-width: 820px;
  font-style: italic;
}

.codex-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #e4d5b7;
  border: 1px solid #bda06a;
  border-radius: 5px;
}
.codex-jump-btn {
  background: #f7f1e3;
  color: #7c2d12;
  border: 1px solid #bfa372;
  border-radius: 99px;
  padding: 5px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.codex-jump-btn:hover {
  background: #991b1b;
  color: #f7f1e3;
  border-color: #7f1d1d;
}

.codex-paper-card {
  background: #fbf8f1;
  border: 1px solid #c5a875;
  border-radius: 6px;
  padding: 26px 30px;
  box-shadow: 0 4px 16px rgba(45, 35, 22, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.72;
  font-size: 15px;
  color: #261f19;
}
.codex-paper-card p {
  margin: 0;
}
.codex-dropcap::first-letter {
  float: left;
  font-family: 'Cinzel', serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 0.88;
  padding: 4px 10px 0 0;
  color: #991b1b;
}

.codex-chapter-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #c5a059;
  margin-bottom: 4px;
}
.codex-chapter-num {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #991b1b, #6b1414);
  border: 1px solid #d4ab59;
  color: #fde68a;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.codex-chapter-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #7c2d12;
  margin: 0;
}
.codex-chapter-head small {
  margin-left: auto;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #854d0e;
  text-transform: uppercase;
}

.codex-duality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 6px;
}
.codex-faction-card {
  position: relative;
  border-radius: 6px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1.5px solid #c5a059;
  overflow: hidden;
}
.codex-faction-card.konoha {
  background: linear-gradient(160deg, #f9f3e6 0%, #f1e4ce 100%);
  border-left: 5px solid #991b1b;
}
.codex-faction-card.suna {
  background: linear-gradient(160deg, #f8f0df 0%, #ecdec0 100%);
  border-left: 5px solid #b45309;
}
.codex-faction-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: #7c2d12;
  margin: 0;
}
.codex-faction-sub {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #854d0e;
  text-transform: uppercase;
}

.codex-biju-alert {
  padding: 22px 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2d1614 0%, #1f1410 100%);
  border: 1.5px solid #dc2626;
  color: #f5f2eb;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(153, 27, 27, 0.22);
}
.codex-biju-alert h3 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: #fca5a5;
  margin: 0;
}
.codex-biju-alert p {
  margin: 0;
  color: #e7d8c1;
  line-height: 1.68;
}
.codex-heresy-quote {
  margin-top: 6px;
  padding: 12px 16px;
  border-left: 3px solid #d4ab59;
  background: rgba(212, 171, 89, 0.1);
  font-style: italic;
  color: #fde68a;
  font-size: 15.5px;
}

.codex-call-to-arms {
  text-align: center;
  padding: 24px 28px;
  background: linear-gradient(90deg, #dfd0b2 0%, #f5ebd6 50%, #dfd0b2 100%);
  border: 2px solid #b89758;
  border-radius: 6px;
}
.codex-call-to-arms h3 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  letter-spacing: 0.14em;
  color: #991b1b;
  margin: 0 0 8px;
}
.codex-call-to-arms p {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: #29221c;
}

.codex-rank-ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.codex-rank-step {
  background: #f5ede0;
  border: 1px solid #c5a875;
  border-top: 3px solid #991b1b;
  border-radius: 5px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.codex-rank-step strong {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: #7c2d12;
}
.codex-rank-step small {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #854d0e;
  text-transform: uppercase;
}
.codex-rank-step span {
  font-size: 13.5px;
  line-height: 1.5;
  color: #3b3026;
}

.codex-three-axes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

/* ============================================================================
   RESPONSIVE & MOBILE PHONE UI (Adaptive Toolbar, Drawer & Touch Map)
============================================================================ */
/* gradini di compattazione della barra in alto (tutto resta su una riga) */
.lbl-short { display: none; }
@media (max-width: 1750px) {
  .nav-btn svg { display: none; }              /* via le icone dei pulsanti */
  .nav-btn .lbl-full { display: none; }
  .nav-btn .lbl-short { display: inline; }      /* «MONDO - AMBIENTAZIONE» -> «MONDO» */
  .weather-badge .weather-icon { display: none; }
}
@media (max-width: 1400px) {
  .brand-title small { display: none; }
  .brand-title strong { font-size: 13px; letter-spacing: 0.12em; }
  .nav-btn { letter-spacing: 0.05em; }
  .who-tag { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 1220px) {
  .brand-title { display: none; }               /* resta solo l'emblema */
  .weather-badge { margin-left: 0; padding: 3px 6px; }
  .online-radar #online-total { font-size: 11px; letter-spacing: 0.06em; }
  .nav-btn { font-size: 11px; padding: 5px 5px; }
  .who-tag { display: none; }
}
@media (max-width: 1120px) {
  .brand-title strong { font-size: 12.5px; letter-spacing: 0.14em; }
  .weather-badge { padding: 3px 7px; margin-left: 2px; }
  .online-radar { padding: 3px 7px; font-size: 11px; }
}

@media (max-width: 860px) {
  html, body {
    overflow: auto;
  }
  #app {
    height: auto;
    min-height: 100vh;
  }
  .topbar {
    position: sticky;
    top: 0;
    height: auto;
    min-height: 50px;
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .weather-badge {
    display: none;
  }
  /* Collapsible Top Navigation Menu on Phone */
  .menu {
    display: none;
    order: 4;
    width: 100%;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(212, 171, 89, 0.28);
    gap: 4px;
  }
  #app.mobile-nav-open .menu {
    display: flex;
  }
  .cols {
    flex-direction: column;
    overflow: visible;
  }
  /* Collapsible Left Sidebar Drawer on Phone */
  .col-left {
    display: none;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  #app.mobile-nav-open .col-left {
    display: flex;
  }
  .col-center {
    min-height: calc(100vh - 96px);
    padding: 8px;
  }
  .tactical-map-stage {
    min-height: 440px;
  }
  .vpin-circle {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .vpin-label {
    font-size: 8.5px;
    padding: 2px 7px;
  }
  .col-right {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .resizer {
    display: none;
  }
  .dock-cards,
  .sheet-dossier-grid,
  .sheet-notes-grid,
  .sheet-cards-grid,
  .sheet-stats-grid,
  .sdata-two-cols,
  .codex-split-layout,
  .codex-duality-grid,
  .codex-three-axes {
    grid-template-columns: 1fr;
  }
  .codex-side-nav {
    height: auto;
    max-height: 220px;
    border-right: none;
    border-bottom: 1.5px solid #c5a059;
  }
  .codex-scroll-body {
    padding: 16px 14px 40px;
  }
  .sheet-left-col {
    position: static;
  }
  .sheet-scroll-area {
    padding: 14px;
  }
  .sheet-topbar {
    padding: 8px 12px;
    flex-wrap: wrap;
  }
}

/* ---- Accesso e registrazione ---- */
.login-tabs { display: flex; gap: 6px; }
.login-tabs button { flex: 1; padding: 8px; background: transparent; border: 1px solid #4a3d31; color: var(--muted); cursor: pointer; border-radius: 3px; }
.login-tabs button.active { border-color: var(--accent); color: var(--accent); background: rgba(197, 160, 89, 0.08); }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form[hidden] { display: none; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.login-form input:not([type=checkbox]), .login-form select { padding: 8px 10px; font-size: 14px; }
.login-form label.check { flex-direction: row; align-items: center; gap: 8px; letter-spacing: 0; font-size: 13px; }
.login-error { margin: 0; padding: 8px 10px; border: 1px solid #b4443a; background: rgba(180, 68, 58, 0.15); color: #ffb3aa; border-radius: 3px; font-size: 13px; }
.demo-login { border-top: 1px dashed #4a3d31; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.demo-login p { margin: 0; }

/* ---- Missive ---- */
.mis-root { display: flex; flex-direction: column; gap: 10px; }
.mis-tabs, .stf-tabs, .stf-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.mis-tabs button, .stf-tabs button, .stf-kinds button { padding: 6px 12px; background: transparent; border: 1px solid #4a3d31; color: var(--muted); cursor: pointer; border-radius: 3px; font-size: 13px; }
.mis-tabs button.active, .stf-tabs button.active, .stf-kinds button.active { border-color: var(--accent); color: var(--accent); background: rgba(197, 160, 89, 0.08); }
.mis-empty, .stf-empty { color: var(--muted); font-style: italic; margin: 8px 0; }
.mis-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.mis-item { border: 1px solid #3d3228; border-radius: 3px; background: rgba(0, 0, 0, 0.18); }
.mis-head { width: 100%; display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; text-align: left; padding: 8px 10px; background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; }
.mis-head.unread { font-weight: 700; border-left: 3px solid var(--accent); }
.mis-who { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-date { color: var(--muted); font-size: 12px; }
.mis-body { padding: 4px 12px 12px; border-top: 1px dashed #3d3228; }
.mis-text { white-space: pre-wrap; line-height: 1.5; }
.mis-actions, .stf-actions, .mis-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mis-foot { justify-content: space-between; }
.mis-compose { display: flex; flex-direction: column; gap: 10px; }
.mis-compose label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.mis-input { padding: 8px 10px; font: inherit; width: 100%; box-sizing: border-box; }
.mis-area { resize: vertical; min-height: 120px; }
.mis-count { color: var(--muted); }
.mis-actions button.danger, .stf-actions button.danger, .stf-chip button { border-color: #b4443a; color: #ffb3aa; }
@media (max-width: 640px) { .mis-head { grid-template-columns: 1fr; gap: 2px; } }

/* ---- Pannello Staff ---- */
.stf-root { display: flex; flex-direction: column; gap: 10px; }
.modal.wide:has(.stf-root) { width: min(1100px, 96vw); }
.modal.wide:has(.mis-root) { width: min(860px, 96vw); }
.stf-note { max-width: 100%; }
.stf-n { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #b4443a; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.stf-hint { color: var(--muted); font-size: 13px; margin: 0; }
.stf-check { font-size: 13px; color: var(--muted); }
.stf-check.on-light { color: #2b2118; font-weight: 600; }
.stf-card { border: 1px solid #4a3d31; border-left: 4px solid var(--accent); border-radius: 3px; padding: 10px 12px; background: rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; gap: 8px; }
.stf-card.approved { border-left-color: #5b9a5b; opacity: 0.8; }
.stf-card.rejected { border-left-color: #b4443a; opacity: 0.8; }
.stf-card-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.stf-who { color: var(--accent); font-size: 13px; }
.stf-dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.stf-dl dt { color: var(--muted); }
.stf-dl dd { margin: 0; white-space: pre-wrap; }
.stf-note { flex: 1 1 260px; min-width: 200px; padding: 6px 8px; font: inherit; }
.stf-done { margin: 0; font-size: 13px; color: var(--muted); }
.stf-split { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.stf-left { display: flex; flex-direction: column; gap: 8px; }
.stf-chars { display: flex; flex-direction: column; gap: 4px; max-height: 58vh; overflow: auto; }
.stf-char { text-align: left; padding: 6px 8px; background: transparent; border: 1px solid #3d3228; color: inherit; cursor: pointer; display: flex; flex-direction: column; border-radius: 3px; }
.stf-char:hover { border-color: var(--accent); }
.stf-char small { color: var(--muted); }
.stf-editor { max-height: 66vh; overflow: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 10px; }
.stf-editor h3, .stf-editor h4 { margin: 4px 0 0; }
.stf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.stf-stats { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.stf-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.stf-in, .stf-search { padding: 6px 8px; font: inherit; width: 100%; box-sizing: border-box; }
.stf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid #4a3d31; border-radius: 12px; font-size: 12px; }
.stf-chip button { padding: 0 6px; background: transparent; border-radius: 10px; cursor: pointer; }
.stf-grant { display: flex; gap: 8px; align-items: center; }
.stf-grant select { flex: 1; }
@media (max-width: 760px) { .stf-split { grid-template-columns: 1fr; } }

/* ---- Scheda: tecniche, inventario, registro, dati, foto ---- */
.sht-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.sht-subtabs button { padding: 6px 12px; background: transparent; border: 1px solid #4a3d31; color: var(--muted); cursor: pointer; border-radius: 3px; font-size: 13px; }
.sht-subtabs button.active { border-color: var(--accent); color: var(--accent); background: rgba(197, 160, 89, 0.08); }
.sht-n { margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #4a3d31; color: #f3dfb2; font-size: 11px; }
.sht-group { margin: 16px 0 6px; color: var(--accent); font-family: 'Cinzel', serif; letter-spacing: 0.04em; }
.sht-tag { color: var(--muted); font-weight: 400; }
.sht-meta { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.sht-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.sht-filter .sheet-input { flex: 1 1 220px; }
.sht-buy { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sht-buy small { color: var(--muted); }
.sht-qty { width: 56px; padding: 5px 6px; font: inherit; }
.sht-equipped { border-color: var(--accent) !important; box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.4) inset; }
.sht-lessons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sht-lesson { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #3d3228; border-radius: 3px; opacity: 0.75; }
.sht-lesson.done { opacity: 1; border-color: #5b9a5b; background: rgba(91, 154, 91, 0.08); }
.sht-lesson small { color: var(--muted); }
.sht-check { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #4a3d31; display: flex; align-items: center; justify-content: center; flex: none; }
.sht-lesson.done .sht-check { background: #5b9a5b; color: #0e0b08; border-color: #5b9a5b; }
.sht-check-btn { padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sht-check-btn:hover { border-color: #5b9a5b; box-shadow: 0 0 0 2px rgba(91, 154, 91, .35); }
.sht-lesson.done .sht-check-btn:hover { background: #7ab87a; }
.sht-records { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sht-record { padding: 8px 12px; border: 1px solid #3d3228; border-left: 3px solid var(--accent); border-radius: 3px; background: rgba(0, 0, 0, 0.16); }
.sht-record p { margin: 4px 0; }
.sht-rec-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sht-rec-head small { color: var(--muted); }
.sht-staff-form { margin-top: 18px; padding: 10px 12px; border: 1px dashed #8a6d3b; border-radius: 3px; }
.sht-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 8px 0; }
.sht-form-grid textarea { grid-column: 1 / -1; }
.sht-form-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.sdat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; margin: 10px 0; }
.sdat-field { display: flex; flex-direction: column; gap: 3px; }
.sdat-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sdat-value { padding: 6px 0; }
.sdat-field small { color: var(--muted); font-size: 11.5px; }
.sht-photo-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Cinzel', serif; font-size: 96px; color: rgba(197, 160, 89, 0.4); background: rgba(0, 0, 0, 0.3); }
.sht-photo .stcard-art-wrap { position: relative; }
.sht-photo-actions { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.sht-photo-actions small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.sht-weapon-box { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sht-weapon-box textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; }
.stf-weapon { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed #8a6d3b; border-radius: 3px; }
.sht-help { padding: 12px 14px; border: 1px dashed #8a6d3b; border-radius: 3px; background: rgba(138, 109, 59, 0.06); display: flex; flex-direction: column; gap: 6px; }
.sht-help p, .sht-help ul { margin: 2px 0; }
.sht-assign { margin-top: 8px; }
.sht-assign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 6px; }
.sht-assign-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 8px; border: 1px solid #3d3228; border-radius: 3px; }
.sht-assign-cell span { font-size: 12px; color: var(--muted); }
.sht-assign-cell strong { font-size: 20px; }

/* ---- Loghi di grado, presenti e pagina dei giocatori online ---- */
.rk-wrap { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.rk-badge { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.online-radar { cursor: pointer; }
.online-radar:hover { filter: brightness(1.25); }
.members { padding: 8px 10px; }
.pres-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.pres-head h3 { margin: 0; }
.pres-all { font-size: 11px; padding: 3px 8px; background: transparent; border: 1px solid #4a3d31; color: var(--accent); cursor: pointer; border-radius: 3px; white-space: nowrap; }
.pres-all:hover { border-color: var(--accent); }
.pres-list { display: flex; flex-direction: column; gap: 3px; }
.pres-row { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 5px 8px; background: rgba(0, 0, 0, 0.18); border: 1px solid #2f2820; border-radius: 3px; color: inherit; cursor: pointer; font: inherit; }
.pres-row:hover { border-color: var(--accent); background: rgba(197, 160, 89, 0.07); }
.pres-row .rk-wrap { grid-row: 1 / span 2; }
.pres-name { font-weight: 600; }
.pres-sub { grid-column: 2; color: var(--muted); font-size: 11px; }
.pres-empty { color: var(--muted); font-style: italic; font-size: 13px; }
.onl-root { display: flex; flex-direction: column; gap: 12px; }
.modal.wide:has(.onl-root) { width: min(980px, 96vw); }
.onl-sum { margin: 0; color: var(--muted); }
.onl-group { border: 1px solid #3d3228; border-radius: 3px; padding: 8px 10px; background: rgba(0, 0, 0, 0.14); }
.onl-group h4 { margin: 0 0 8px; color: var(--accent); font-family: 'Cinzel', serif; letter-spacing: 0.04em; }
.onl-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed #332a21; }
.onl-row:first-of-type { border-top: 0; }
.onl-who { display: flex; flex-direction: column; min-width: 0; }
.onl-who small { color: var(--muted); }
.onl-loc { font: inherit; font-size: 12.5px; background: transparent; border: 1px solid #4a3d31; color: var(--accent); padding: 4px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.onl-loc.idle { color: var(--muted); border-style: dashed; cursor: default; }
.onl-empty { color: var(--muted); font-style: italic; }
@media (max-width: 700px) { .onl-row { grid-template-columns: 30px 1fr; } .onl-loc, .onl-row .sheet-outline-btn { grid-column: 2; justify-self: start; } }
.stf-char { flex-direction: row !important; align-items: center; gap: 8px; }
.stf-cn { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.sht-readonly { padding: 2px 10px; border: 1px solid #6b5a3a; border-radius: 12px; font-size: 12px; color: var(--muted); }
.fame-card { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid; border-radius: 4px; background: rgba(0, 0, 0, 0.18); }
.fame-kanji { flex: none; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; font-size: 40px; border: 2px solid; border-radius: 50%; font-family: serif; }
.fame-main { flex: 1; min-width: 0; }
.fame-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 18px; }
.fame-val { font-family: 'Cinzel', serif; font-size: 20px; }
.fame-blurb { margin: 4px 0 12px; color: var(--muted); }
.fame-bar { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #5a0a16 0%, #b3323f 22%, #6b6f78 50%, #6bb0a0 70%, #e8a93a 92%, #ff9a2e 100%); }
.fame-zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #f3dfb2; opacity: 0.7; }
.fame-tick { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(0, 0, 0, 0.55); }
.fame-marker { position: absolute; top: -5px; width: 14px; height: 22px; margin-left: -7px; border-radius: 4px; border: 2px solid #0e0b08; box-shadow: 0 0 6px rgba(0, 0, 0, 0.7); }
.fame-poles { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); }
.fame-kage { margin-top: 10px; padding: 10px 12px; border: 1px solid #ff9a2e; border-radius: 3px; background: rgba(255, 154, 46, 0.08); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rk-legend { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 4px; padding: 10px 12px; border: 1px solid #3d3228; border-radius: 3px; background: rgba(0, 0, 0, 0.14); text-align: left; }
.rk-legend-row { display: grid; grid-template-columns: 220px 1fr; gap: 10px; align-items: center; }
.rk-legend-title { display: flex; flex-direction: column; }
.rk-legend-title small { color: var(--muted); font-size: 11.5px; }
.rk-legend-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.rk-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.rk-legend-item em { font-style: normal; }
@media (max-width: 760px) { .rk-legend-row { grid-template-columns: 1fr; } }
.vmap-pin-dyn .vpin-circle { border-style: dashed; animation: pinpop 0.4s ease-out; }
@keyframes pinpop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.clan-mname .rk-badge { display: inline-block; vertical-align: -5px; margin-right: 6px; }
.codex-paper-card .rk-legend-title small, .rk-legend .rk-legend-title small { color: #6b5a3f; }
.rk-legend { color: #2a2118; }
.stf-techform { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed #8a6d3b; border-radius: 3px; }
.sht-slots { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; font-size: 13px; }
.sht-slot { padding: 2px 10px; border: 1px solid #6b5a3a; border-radius: 12px; }
.sht-slot.done { opacity: 0.55; text-decoration: line-through; }
.sdat-group { margin: 14px 0 6px; padding-top: 6px; border-top: 1px solid rgba(0, 0, 0, 0.12); }
.sdat-title { margin: 0 0 6px; font-family: 'Cinzel', serif; letter-spacing: 0.06em; font-size: 14px; color: #6a4a1c; }
.corp-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.corp-card { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
.corp-badge { font-size: 22px; text-align: center; }
.corp-info { display: flex; flex-direction: column; min-width: 0; }
.corp-info small { color: #6b5a3f; }
@media (max-width: 700px) { .corp-card { grid-template-columns: 34px 1fr; } .corp-card button { grid-column: 2; justify-self: start; } }
.outdated-bar { position: sticky; top: 0; z-index: 9999; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px; background: #7a1010; color: #fff; font-weight: 600; font-size: 13.5px; }
.outdated-bar button { background: transparent; border: 1px solid #fff; color: #fff; cursor: pointer; padding: 0 8px; }
.mb-obj { list-style: none; margin: 4px 0; padding: 0; font-size: 13.5px; }
.mb-obj li.done { color: #4b7a3a; text-decoration: line-through; }

.sht-assign-btns { display: flex; gap: 4px; }

/* ---- Presenti: pannello più alto (si espande verso l'alto), righe curate e simboletti accanto ai nomi ---- */
.sidebar-subpanel { flex: 1 1 300px; min-height: 260px; max-height: 66vh; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(197, 160, 89, 0.25); background: linear-gradient(180deg, #f8f5ee, #efe8d9); }
.sidebar-subpanel .members { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 4px 2px; }
.pres-head { flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid rgba(153, 27, 27, 0.25); margin-bottom: 8px; }
.members .pres-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.pres-kanji { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #991b1b; color: #f5f2eb; font-size: 13px; letter-spacing: 0; }
.pres-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(153, 27, 27, 0.12); color: #991b1b; font-size: 11.5px; text-align: center; letter-spacing: 0; line-height: 18px; }
.pres-all { color: #7a1313; border-color: rgba(153, 27, 27, 0.4); }
.pres-all:hover { background: rgba(153, 27, 27, 0.08); border-color: #991b1b; }
.pres-list { flex: 1; min-height: 0; overflow-y: auto; gap: 5px; padding-right: 2px; scrollbar-width: thin; }
.pres-row { grid-template-columns: 26px 1fr; column-gap: 9px; padding: 7px 9px; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(28, 25, 23, 0.14); border-left: 3px solid #c5a059; border-radius: 4px; color: #1c1917; transition: transform 0.12s, box-shadow 0.12s; }
.pres-row:hover { background: #fff; border-color: #991b1b; border-left-color: #991b1b; transform: translateX(2px); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
.pres-top { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; min-width: 0; }
.pres-name { font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
.pres-sub { color: #6b5f52; font-size: 11px; }
.pres-empty { color: #6b5f52; }
.user-badges-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.ubadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 2px; border-radius: 4px; background: rgba(28, 25, 23, 0.07); font-size: 13px; line-height: 1; cursor: help; }
.onl-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.onl-name .ubadge { background: rgba(197, 160, 89, 0.14); font-size: 15px; height: 22px; min-width: 22px; }

/* ---- Presenti nella colonna destra: sulle mappe occupa tutta l'altezza (bordo inferiore allineato alle schede dei villaggi); nelle chat sta in alto
   e sotto restano Assistente, Scontro e Accademia. Il menu a sinistra non viene più ridimensionato. ---- */
.col-right .presenti-box { flex: 0 1 auto; height: auto; min-height: 170px; max-height: 40vh; margin: 0; box-sizing: border-box; }
.col-right.presenti-only { overflow: hidden; }
.col-right.presenti-only > :not(.presenti-box) { display: none; }
.col-right.presenti-only .presenti-box { flex: 1 1 auto; max-height: none; }
.col-right .presenti-box .pres-list { max-height: none; }

/* menu a tendina (es. blocchi di punti statistica): testo chiaro e leggibile sullo sfondo scuro, anche sulle schede color pergamena */
.prm-qty, .prm-choice { background: #f3e9d2; color: #2b1d12; border: 1px solid #b08d57; border-radius: 4px; padding: 8px 10px; font: inherit; font-weight: 600; min-height: 38px; }
.prm-qty option, .prm-choice option { background: #f8f1df; color: #2b1d12; }

/* ---- Riquadro della tecnica attivata (malus dell'allenamento mancante) e stato delle role nello scontro ---- */
.tech-banner { margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid #c5a059; background: rgba(197, 160, 89, 0.12); border-radius: 3px; font-size: 12.5px; }
.tech-banner.malus { border-left-color: #b8481f; background: rgba(184, 72, 31, 0.12); }
.tech-banner.ok { border-left-color: #3f8f5a; background: rgba(63, 143, 90, 0.12); }
.tech-banner .tb-malus { margin-top: 2px; opacity: 0.9; }
#combat-box .tag.ok { background: rgba(63, 143, 90, 0.25); }

/* ---- Scheda «Il Luogo» (colonna di destra) ---- */
.place-card { background: linear-gradient(180deg, #f5ecd5, #ecdfbd); color: #3a2a18; border: 1.5px solid #b08d57; border-radius: 10px; padding: 10px 12px 12px; position: relative; }
.place-weather { display: flex; justify-content: flex-end; gap: 0; font-family: 'Cinzel', serif; font-size: 11.5px; letter-spacing: 0.08em; color: #5b4a30; margin: -2px 0 6px; padding: 4px 10px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(176, 141, 87, 0.6); border-radius: 999px; width: fit-content; margin-left: auto; }
.place-weather .pw-temp { font-weight: 700; }
.place-title { margin: 0 0 6px; font-family: 'Cinzel', serif; font-size: 12.5px; letter-spacing: 0.16em; color: #8a3b1f; }
.place-art { border: 1px solid #b08d57; border-radius: 6px; overflow: hidden; line-height: 0; background: #e8dcc0; }
.place-art svg, .place-art img { width: 100%; height: auto; display: block; }
.place-art img { aspect-ratio: 16 / 10; object-fit: cover; }
.place-desc { margin: 10px 2px 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 17px; line-height: 1.35; color: #3a2a18; }
#btn-save-role { background: linear-gradient(180deg, #7d2a1a, #5d1d12); color: #f6e7c4; border-color: #b08d57; font-weight: 700; }

/* ---- Staff: archivio role e roster PNG; Taglie ---- */
.arch-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 52vh; overflow-y: auto; }
.arch-row { padding: 6px 10px; border-left: 3px solid #b08d57; background: rgba(255, 255, 255, 0.5); border-radius: 3px; }
.arch-row.narrator { border-left-color: #8a3b1f; }
.arch-row.whisper { border-left-color: #6b5b95; opacity: 0.85; }
.arch-head small { opacity: 0.7; }
.arch-body { white-space: pre-wrap; font-size: 13px; margin-top: 3px; line-height: 1.45; }
.npc-wrap { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 12px; align-items: start; }
.npc-list { display: flex; flex-direction: column; gap: 3px; max-height: 56vh; overflow-y: auto; margin: 8px 0; }
.npc-row { text-align: left; padding: 5px 8px; border: 1px solid rgba(176, 141, 87, 0.5); border-radius: 3px; background: rgba(255, 255, 255, 0.5); cursor: pointer; font: inherit; color: inherit; }
.npc-row:hover { background: rgba(197, 160, 89, 0.25); }
.npc-row.dead { opacity: 0.55; text-decoration: line-through; }
.npc-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; }
.npc-stat { font-size: 12.5px; padding: 1px 7px; background: rgba(176, 141, 87, 0.18); border-radius: 999px; }
.npc-bg { font-style: italic; }
@media (max-width: 900px) { .npc-wrap { grid-template-columns: 1fr; } }
.mb-card.bounty { border-left: 3px solid #8a1f1f; }

.place-weather .pw-temp { margin-left: 6px; }

/* Banner dell'Accademia (inizio lezione, turni, lezione finita) */
.msg.academy-banner { border: 1px solid #b08d57; border-left: 4px solid #b08d57; background: rgba(176, 141, 87, 0.12); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.msg.academy-banner p { margin: 3px 0; line-height: 1.4; }
.msg.academy-banner small { opacity: 0.6; }
.msg.academy-banner.ab-end { border-color: #6aa36a; border-left-color: #6aa36a; background: rgba(106, 163, 106, 0.12); }
.msg.academy-banner.ab-join { border-style: dashed; }

/* ---- Presenti: piccolo, sotto i pulsanti della colonna sinistra ---- */
.col-left .presenti-box { flex: 0 0 auto; min-height: 0; max-height: 30vh; margin-top: 10px; padding: 6px 8px; overflow: hidden; }
.col-left .presenti-box .members { padding: 2px 0; }
.col-left .presenti-box .pres-head { margin-bottom: 4px; padding-bottom: 4px; }
.col-left .presenti-box .pres-list { max-height: calc(30vh - 52px); overflow-y: auto; gap: 3px; }
.col-left .presenti-box .pres-row { padding: 4px 6px; }
.col-left .presenti-box .pres-sub { font-size: 10px; }
.msg.academy-banner.duel-banner { border-color: #991b1b; border-left-color: #991b1b; background: rgba(153, 27, 27, 0.10); }
.calc-row { margin: 6px 0; padding: 6px 8px; border: 1px solid rgba(197, 160, 89, 0.4); border-radius: 6px; font-size: 12.5px; }
.calc-sugg { margin-top: 3px; color: #d8b36a; font-weight: 700; }
#calc-box select, #calc-box input[type="text"], #calc-box .stf-in { width: 100%; margin: 3px 0; }

.msg.academy-banner.summon-banner { border-color: #4b7a3a; border-left-color: #4b7a3a; background: rgba(75, 122, 58, 0.12); }
.pres-row.summon-row { border-left-color: #4b7a3a; background: rgba(75, 122, 58, 0.10); cursor: default; }

/* ---- Scheda · Dati e Richieste: riquadri nello stile dei Serbatoi vitali ---- */
.sdc-card { margin: 12px 0; }
.sdc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.sdc-tile { min-height: 54px; justify-content: center; gap: 2px; }
.sdc-tile.wide { grid-column: 1 / -1; }
.sdc-tile strong { font-size: 15px; overflow-wrap: anywhere; }
.sdc-input { width: 100%; box-sizing: border-box; border: none; border-bottom: 1px dashed rgba(133, 77, 14, 0.45); background: transparent; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #29221c; padding: 2px 0; outline: none; }
.sdc-input:focus { border-bottom-color: #991b1b; background: rgba(255, 255, 255, 0.45); }
.sdc-input:disabled { border-bottom-color: transparent; opacity: 1; color: #29221c; -webkit-text-fill-color: #29221c; cursor: default; appearance: none; }
select.sdc-input:disabled { background-image: none; }
.sdc-hint { font-style: normal; font-size: 10.5px; color: #7c6a50; }
.sdat-corps .corp-card { background: #efe6d2; border: 1px solid #c8b084; border-radius: 4px; }
.rq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.rq-card { background: #f7f1e3; border: 1px solid #c5a875; border-radius: 6px; padding: 12px 14px; box-shadow: 0 4px 12px rgba(45, 35, 22, 0.08); display: flex; flex-direction: column; gap: 8px; }
.rq-card h4 { margin: 0; font-family: 'Cinzel', serif; font-size: 12.5px; letter-spacing: 0.14em; color: #7c2d12; text-transform: uppercase; border-bottom: 1px solid rgba(161, 124, 67, 0.3); padding-bottom: 4px; }
.rq-note { width: 100%; box-sizing: border-box; resize: vertical; }
.rq-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rq-list { display: flex; flex-direction: column; gap: 8px; }
.rq-row { background: #efe6d2; border: 1px solid #c8b084; border-left: 4px solid #c5a059; border-radius: 4px; padding: 8px 10px; }
.rq-row.rq-approved { border-left-color: #4b7a3a; } .rq-row.rq-rejected { border-left-color: #991b1b; }
.rq-row-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rq-status { font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.rq-staff-note { margin: 4px 0 0; font-size: 13px; color: #3b3026; }

.tech-edit-row { margin-top: 10px; }
.tech-edit { background: #1c1917; color: #fde68a; border: 1px solid #b08d57; border-radius: 4px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.tech-edit:hover { background: #2b2420; }
.tech-edit-box { margin-top: 10px; border-top: 1px dashed rgba(133, 77, 14, 0.4); padding-top: 10px; }
.tech-edit-box .stf-field span { color: #5b4a2e; }
/* campo quantità del negozio: chiaro come gli altri campi della Scheda (niente nero) */
.sht-qty { background: #f3e9d2; color: #2b1d12; border: 1px solid #b08d57; border-radius: 4px; font-weight: 700; text-align: center; color-scheme: light; }
.sht-qty:focus { outline: none; border-color: #991b1b; background: #fffaf0; }

/* ---- Bacheche ON e OFF ---- */
.bd-root { padding: 18px 22px 40px; max-width: 980px; margin: 0 auto; }
.bd-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.bd-tabs button { flex: 1 1 220px; padding: 10px 14px; background: #efe6d2; color: #3b3026; border: 1px solid #c8b084; border-radius: 6px; font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.06em; cursor: pointer; }
.bd-tabs button.active { background: #991b1b; color: #fde68a; border-color: #7a1313; }
.bd-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.bd-pill { padding: 5px 12px; border-radius: 999px; background: #efe6d2; border: 1px solid #c8b084; color: #3b3026; cursor: pointer; font-weight: 600; }
.bd-pill.active { background: #7c2d12; color: #fff7e6; border-color: #7c2d12; }
.bd-hint { color: #6b5f52; font-style: italic; margin: 4px 0 10px; }
.bd-compose { margin: 10px 0 16px; }
.bd-compose .sheet-input, .bd-compose .sheet-select { width: 100%; box-sizing: border-box; }
.bd-body { resize: vertical; min-height: 90px; }
.bd-list { display: flex; flex-direction: column; gap: 10px; }
.bd-post { background: #f7f1e3; border: 1px solid #c5a875; border-left: 4px solid #c5a059; border-radius: 6px; padding: 10px 14px; box-shadow: 0 2px 8px rgba(45, 35, 22, 0.08); color: #29221c; }
.bd-post.pinned { border-left-color: #991b1b; background: #fbf3df; }
.bd-post.st-risolto { border-left-color: #4b7a3a; } .bd-post.st-in_lavorazione { border-left-color: #b45309; } .bd-post.st-chiuso { opacity: 0.75; }
.bd-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.bd-head strong { font-family: 'Cinzel', serif; font-size: 15px; color: #7c2d12; }
.bd-badges { display: inline-flex; gap: 6px; }
.bd-badge { padding: 1px 8px; border-radius: 999px; background: #e7d9b8; border: 1px solid #c8b084; font-size: 11.5px; font-weight: 700; color: #5b4a2e; }
.bd-badge.st-aperto { background: #fde68a; } .bd-badge.st-in_lavorazione { background: #fed7aa; } .bd-badge.st-risolto { background: #bbf7d0; } .bd-badge.st-chiuso { background: #e5e7eb; }
.bd-text { white-space: pre-wrap; margin: 6px 0; line-height: 1.5; }
.bd-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.bd-status { width: auto; }
.bd-thread { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.bd-thread:empty { display: none; }
.bd-reply { background: #efe6d2; border: 1px solid #c8b084; border-radius: 4px; padding: 6px 10px; }
.bd-reply.staff { border-left: 3px solid #991b1b; }
.bd-thread textarea { width: 100%; box-sizing: border-box; }
.bd-post .sht-meta, .bd-reply .sht-meta { color: #6b5f52; }

/* Richiamo: tendina per scegliere la creatura, sotto il badge della tecnica scelta */
.summon-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.summon-pick[hidden] { display: none; }
.summon-pick select { min-width: 260px; max-width: 100%; }
.summon-pick .hint { opacity: .8; flex: 1 1 100%; }

/* Pool di missioni per grado (Mondo di Gioco → Gradi e Gerarchia) */
.codex-sub { margin: 18px 0 6px; font-size: 15px; color: #29221c; }
.codex-rank-pool { width: 100%; border-collapse: collapse; margin: 8px 0 6px; font-size: 14px; }
.codex-rank-pool th, .codex-rank-pool td { border: 1px solid #c5a875; padding: 8px 10px; text-align: left; vertical-align: top; }
.codex-rank-pool thead th { background: #e9dcc3; color: #3a2e22; }
.codex-rank-pool tbody tr:nth-child(even) td { background: #f5ede0; }
.codex-note { font-size: 13.5px; opacity: .85; margin: 4px 0 12px; }
@media (max-width: 640px) { .codex-rank-pool { font-size: 13px; } .codex-rank-pool th, .codex-rank-pool td { padding: 6px; } }

/* Questionario di accesso ai Master */
.rq-quiz { margin: 10px 0 18px; border-top: 3px solid #991b1b; }
.rq-q { border: 1px solid rgba(161, 124, 67, 0.4); border-radius: 5px; margin: 0; padding: 8px 12px 10px; }
.rq-q legend { font-weight: 600; padding: 0 6px; }
.rq-opt { display: block; padding: 3px 0; cursor: pointer; }

/* Registrazione: regole della password e attesa della conferma email */
.pw-rules { list-style: none; margin: -4px 0 6px; padding: 0; font-size: 12.5px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.pw-rules li.ok { color: #6fbf73; }
.pw-rules li.no { opacity: .75; }
@media (max-width: 480px) { .pw-rules { grid-template-columns: 1fr; } }
.verify-pending { text-align: center; padding: 6px 4px 12px; }
.verify-pending h2 { margin: 6px 0 10px; font-size: 20px; }
.verify-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Modulo missione (Master e staff) */
.mf-set { border: 1px solid rgba(161, 124, 67, 0.45); border-radius: 6px; margin: 10px 0; padding: 10px 12px; display: grid; gap: 8px; }
.mf-set legend { font-weight: 700; padding: 0 6px; }
.mf-field { display: grid; gap: 4px; }
.mf-req { color: #b91c1c; }
.mf-req-ai { color: #b45309; font-size: 12px; opacity: .45; }
.mf.mf-ai .mf-req-ai { opacity: 1; font-weight: 700; }
.mf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mf-rows { display: grid; gap: 8px; margin: 6px 0; }
.mf-row { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 8px; align-items: start; }
.mf-row > select:first-child:nth-last-child(2) { grid-column: 1 / span 3; }
.mf-unlock { grid-template-columns: 1fr 1fr 1.5fr 1.2fr auto; }
.mf-subpanel { border: 1px dashed rgba(161, 124, 67, 0.6); border-radius: 6px; padding: 8px 10px; margin-top: 8px; display: grid; gap: 6px; }
.mf-error { color: #b91c1c; background: rgba(185, 28, 28, 0.08); border: 1px solid rgba(185, 28, 28, 0.35); border-radius: 5px; padding: 8px 10px; margin: 8px 0; white-space: pre-wrap; }
.mb-fit { color: #b45309; }
@media (max-width: 760px) { .mf-pair, .mf-row, .mf-unlock { grid-template-columns: 1fr; } .mf-row > select:first-child:nth-last-child(2) { grid-column: auto; } }

/* Quest di sblocco */
.tech-flag.locked { background: rgba(185, 28, 28, 0.12); color: #b91c1c; border-color: rgba(185, 28, 28, 0.4); }
.tech-flag.quest { background: rgba(180, 83, 9, 0.12); color: #b45309; border-color: rgba(180, 83, 9, 0.4); font-size: 11px; }

/* Schede delle creature d'evocazione (Codice → Evocazioni) */
.creature-sheet { border: 1px solid rgba(120, 90, 50, 0.45); border-radius: 3px; margin: 6px 0; background: rgba(0, 0, 0, 0.06); }
.creature-sheet > summary { cursor: pointer; padding: 6px 10px; }
.creature-sheet .cr-body { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.creature-sheet .cr-body p { margin: 0; }
.cr-fam { font-size: 12px; font-weight: 400; opacity: 0.75; margin-left: 6px; text-transform: capitalize; }
.cr-famhead { margin: 10px 0 2px; text-transform: capitalize; }
.cr-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-stat { display: inline-flex; gap: 6px; align-items: baseline; padding: 2px 8px; border: 1px solid rgba(120, 90, 50, 0.4); border-radius: 3px; }
.cr-stat i { font-style: normal; font-size: 11px; opacity: 0.75; }
.cr-h { margin: 8px 0 2px; }
.cr-kvs { flex-wrap: wrap; gap: 10px; }

/* Superfici chiare (pergamena): lì il testo «attenuato» e le etichette sono scuri e i campi di testo chiari con testo scuro, ovunque compaiano
   (editor tecniche, bacheche, richieste, schede dei luoghi). I pulsanti restano com'erano. */
.tech-edit-box, .tech-detail-box, .bd-root, .rq-card, .rq-row, .place-card, .sdat-corps, .codex-rank-pool { --muted: #4a3b27; }
.tech-edit-box .stf-hint, .tech-edit-box .stf-field, .tech-edit-box .stf-field span, .tech-edit-box .stf-check, .tech-edit-box .stf-who, .tech-edit-box h3, .tech-edit-box h4 { color: #3b2e1c; }
.tech-edit-box .stf-field span { font-weight: 600; }
.bd-root .stf-check, .rq-card .stf-check, .rq-row .stf-check { color: #2b1d12; font-weight: 600; }
.tech-edit-box input:not([type="checkbox"]):not([type="radio"]), .tech-edit-box select, .tech-edit-box textarea,
.bd-root input:not([type="checkbox"]):not([type="radio"]), .bd-root select, .bd-root textarea,
.rq-card input:not([type="checkbox"]):not([type="radio"]), .rq-card select, .rq-card textarea,
.rq-row input:not([type="checkbox"]):not([type="radio"]), .rq-row select, .rq-row textarea {
  background: #fbf6ea; color: #2b1d12; border: 1px solid #b08d57; color-scheme: light;
}
.tech-edit-box input::placeholder, .tech-edit-box textarea::placeholder, .bd-root input::placeholder, .bd-root textarea::placeholder, .rq-card input::placeholder, .rq-row input::placeholder { color: #7a6a4f; opacity: 1; }
.tech-edit-box select option, .bd-root select option, .rq-card select option, .rq-row select option { background: #fbf6ea; color: #2b1d12; }
.tech-edit-box input:focus, .tech-edit-box select:focus, .tech-edit-box textarea:focus, .bd-root input:focus, .bd-root select:focus, .bd-root textarea:focus { outline: none; border-color: #991b1b; background: #fffaf0; }

/* Prerequisiti dell'editor tecniche: etichette e menu con ricerca */
.prq-box { display: flex; flex-direction: column; gap: 6px; }
.prq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prq-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; background: #efe6d2; color: #2b1d12; border: 1px solid #b08d57; border-radius: 999px; font-size: 13px; font-weight: 600; }
.prq-chip button { background: transparent; border: 0; color: #991b1b; padding: 0 6px; cursor: pointer; font-weight: 700; }
.prq-add { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; align-items: center; }
@media (max-width: 760px) { .prq-add { grid-template-columns: 1fr; } }

/* Regole «nessun effetto» dell'editor tecniche: righe che si aggiungono e si tolgono */
.imm-rows { display: flex; flex-direction: column; gap: 6px; }
.imm-row { position: relative; padding-right: 38px; }
.imm-del { position: absolute; right: 0; top: 22px; background: transparent; border: 1px solid #b08d57; color: #991b1b; border-radius: 4px; padding: 4px 9px; cursor: pointer; font-weight: 700; }
.imm-add { align-self: flex-start; background: #efe6d2; color: #2b1d12; border: 1px solid #b08d57; border-radius: 4px; padding: 6px 12px; font-weight: 700; cursor: pointer; }

/* Malus provvisori alle statistiche, accanto alla statistica nella Scheda (sfondo chiaro: testo scuro) */
.stat-malus { display: block; color: #8a1f10; font-weight: 700; margin-top: 2px; }
.sheet-stat-val.has-malus { color: #a6321d; }
.sheet-malus-box { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; padding: 8px 10px; border: 1px solid #a6321d; border-radius: 8px; background: #f6e3dc; color: #3b1d14; }
.sheet-malus-box strong { color: #8a1f10; }
.sheet-malus-box small { display: block; color: #3b1d14; }


.combat-helper {
  background: linear-gradient(180deg, #161b22, #0d1117);
  border: 1px solid rgba(216, 179, 106, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.combat-helper.phase-attack {
  border-left: 4px solid #d8b36a;
}
.combat-helper.phase-defense {
  border-left: 4px solid #58a6ff;
}
.combat-helper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.combat-helper-title {
  font-weight: bold;
  color: #e6edf3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.combat-helper-vitals {
  display: flex;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: bold;
}
.combat-helper-vitals .hp {
  color: #f85149;
}
.combat-helper-vitals .ck {
  color: #58a6ff;
}
.combat-helper-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.combat-helper select, .combat-helper input[type="number"] {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.84rem;
}
.combat-helper select:focus, .combat-helper input:focus {
  border-color: #d8b36a;
  outline: none;
}
.combat-helper .btn-reset-action {
  background: transparent;
  border: 1px solid #484f58;
  color: #8b949e;
  border-radius: 4px;
  cursor: pointer;
  padding: 3px 8px;
  font-size: 0.78rem;
}
.combat-helper .btn-reset-action:hover {
  border-color: #f85149;
  color: #f85149;
}

/* Pannello Staff · Lezioni: editor dei contenuti delle lezioni d'Accademia */
.les-editor { max-height: 72vh; }
.les-card { gap: 10px; }
.les-group { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border-left: 3px solid #4a3d31; background: rgba(0, 0, 0, 0.12); }
.les-group h5 { margin: 0; color: var(--accent); font-size: 13px; }
.les-list { display: flex; flex-direction: column; gap: 6px; }
.les-item { display: flex; gap: 6px; align-items: flex-start; }
.les-item .stf-in { flex: 1; resize: vertical; }
.les-btns { display: flex; flex-direction: column; gap: 3px; }
.les-card .stf-card-head .les-btns { flex-direction: row; margin-left: auto; }
.les-btns button { padding: 1px 7px; background: transparent; border: 1px solid #4a3d31; color: var(--muted); cursor: pointer; border-radius: 3px; }
.les-btns button:disabled { opacity: 0.35; cursor: default; }
.les-btns button.danger { border-color: #b4443a; color: #ffb3aa; }
.les-add { align-self: flex-start; padding: 5px 12px; background: transparent; border: 1px dashed #8a6d3b; color: var(--accent); cursor: pointer; border-radius: 3px; }
.les-add:hover { background: rgba(197, 160, 89, 0.08); }
.les-extras { display: flex; flex-direction: column; gap: 10px; }
.les-extra { border-left-color: #5b9a5b; }
.stf-char.active { border-color: var(--accent); }
.les-turn { border-left-color: #8a6d3b; }
.les-card details > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.les-rest { display: flex; flex-direction: column; gap: 10px; }
