/**
 * help_kvk.css
 * Foglio di stile dedicato per la sezione Help KvK (Simulatore Crystal Tech)
 * Albero verticale compatto con foto, badge livello, nomi ricerche e frecce SVG dinamiche.
 * Versione: v2.5.2 · 04/10/2026
 */

/* Container Principale */
.help-kvk-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px 12px 80px 12px;
  color: #e2e8f0;
}

@media (min-width: 768px) {
  .help-kvk-container {
    padding: 24px 20px 100px 20px;
  }
}

/* Banner Introduttivo (Hero) */
.help-kvk-hero {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 22px 18px;
  margin-bottom: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.help-kvk-hero::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.help-kvk-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.help-kvk-hero-title {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .help-kvk-hero-title {
    font-size: 30px;
  }
}

.help-kvk-hero-title span {
  color: #38bdf8;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

.help-kvk-hero-desc {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.6;
  max-width: 860px;
}

/* Toolbar con Preset e Contatori */
.help-kvk-toolbar {
  background: linear-gradient(145deg, #101625 0%, #0c111c 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.28);
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Riga 1: Preset Rapidi e Reset */
.help-kvk-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.help-kvk-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.help-kvk-preset-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1.2;
}

.help-kvk-preset-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}

.help-kvk-preset-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28) 0%, rgba(14, 165, 233, 0.18) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.help-kvk-preset-btn.btn-gold.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.18) 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.help-kvk-preset-btn.btn-purple.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28) 0%, rgba(147, 51, 234, 0.18) 100%);
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.help-kvk-preset-btn.btn-reset-tree {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  margin-left: auto;
}

.help-kvk-preset-btn.btn-reset-tree:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.help-kvk-preset-btn.disabled,
.help-kvk-preset-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.7);
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
}

.help-kvk-preset-btn.disabled:hover,
.help-kvk-preset-btn:disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

/* Riga 2: Griglia Statistiche e Contatori Proporzionati */
.help-kvk-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .help-kvk-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.help-kvk-stat-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.help-kvk-stat-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.help-kvk-stat-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.help-kvk-stat-icon {
  font-size: 13px;
  line-height: 1;
}

.help-kvk-stat-lbl {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.help-kvk-stat-val {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.help-kvk-stat-val.cyan {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.help-kvk-stat-val.gold {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.help-kvk-stat-val.amber {
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Card Speciale: Centro Ricerche Cristalli */
.help-kvk-stat-card.rc-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.help-kvk-rc-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.help-kvk-rc-step-btn {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.help-kvk-rc-step-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: translateY(-1px);
}

.help-kvk-rc-step-btn:active {
  transform: translateY(1px);
}

.help-kvk-rc-select {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  height: 28px;
}

.help-kvk-rc-select:focus,
.help-kvk-rc-select:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.help-kvk-rc-select option {
  background: #0f172a;
  color: #f8fafc;
}

.soc-modal-stat-value.red-warning {
  color: #ef4444 !important;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

/* Banner Descrizione Preset Ordinato */
.help-kvk-preset-info {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(17, 24, 39, 0.7) 100%);
  border-left: 4px solid #38bdf8;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-kvk-preset-info-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

/* Ribbon Riepilogo Bonus Truppe */
.help-kvk-buffs-summary-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

@media (min-width: 768px) {
  .help-kvk-buffs-summary-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.help-kvk-buff-pill {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.help-kvk-buff-pill.inf { border-color: rgba(59, 130, 246, 0.35); }
.help-kvk-buff-pill.arc { border-color: rgba(16, 185, 129, 0.35); }
.help-kvk-buff-pill.cav { border-color: rgba(239, 68, 68, 0.35); }
.help-kvk-buff-pill.sie { border-color: rgba(245, 158, 11, 0.35); }

.help-kvk-buff-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.help-kvk-buff-pill.inf .help-kvk-buff-title { color: #60a5fa; }
.help-kvk-buff-pill.arc .help-kvk-buff-title { color: #34d399; }
.help-kvk-buff-pill.cav .help-kvk-buff-title { color: #f87171; }
.help-kvk-buff-pill.sie .help-kvk-buff-title { color: #fbbf24; }

.help-kvk-buff-stats {
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: monospace;
}

/* ================= CANVAS ALBERO VERTICALE CON FRECCE SVG ================= */
.soc-tree-vertical-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

.soc-tree-canvas-wrapper {
  position: relative;
  max-width: 880px;
  min-width: 640px;
  margin: 0 auto;
  background: radial-gradient(circle at 50% 10%, rgba(18, 26, 44, 0.95) 0%, rgba(9, 14, 24, 0.98) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.28);
  border-radius: 24px;
  padding: 32px 16px 60px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(56, 189, 248, 0.1);
  isolation: isolate;
}

/* Overlay SVG per le Frecce */
.soc-connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.soc-conn-path {
  fill: none;
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 2.2px;
  transition: stroke 0.25s ease, filter 0.25s ease;
}

.soc-conn-path.active {
  stroke: #38bdf8;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.65));
}

.soc-conn-path.max {
  stroke: #f59e0b;
  stroke-width: 2.6px;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.75));
}

/* Righe dei 18 Tier */
.soc-tree-tiers {
  position: relative;
  z-index: 10;
  width: 100%;
}

.soc-tier-row {
  position: relative;
  height: 116px;
  margin-bottom: 46px;
  z-index: 10;
}

.soc-tier-pill-label {
  position: absolute;
  left: 2px;
  top: 20px;
  font-size: 10px;
  font-weight: 900;
  color: rgba(56, 189, 248, 0.55);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  user-select: none;
  z-index: 11;
}

/* ================= NODO COMPATTO (FOTO + BADGE + NOME) ================= */
.soc-node-tile {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px;
  cursor: pointer;
  user-select: none;
  z-index: 20;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.soc-node-tile:hover {
  transform: translateX(-50%) translateY(-3px);
  z-index: 50;
}

.soc-node-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: all 0.22s ease;
  z-index: 22;
}

.soc-node-tile:hover .soc-node-icon-box {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
}

.soc-node-tile.active .soc-node-icon-box {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.soc-node-tile.max .soc-node-icon-box {
  border-color: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

.soc-node-tile.locked .soc-node-icon-box {
  opacity: 0.42;
  filter: grayscale(0.8);
}

.soc-node-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.soc-node-tile:hover .soc-node-icon-box img {
  transform: scale(1.06);
}

.soc-node-lock-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 23;
  box-sizing: border-box;
}

.soc-node-tile.locked .soc-node-lock-badge {
  display: flex;
}

/* Gruppo Contenitore Badge Ruolo (Rally + Garrison) */
.soc-node-roles-group {
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 23;
  pointer-events: none;
}

/* Badge Singolo Rally Leader e Garrison Leader */
.soc-node-role-badge {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.75);
}

.soc-node-role-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.soc-node-role-badge.rally {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.75) 0%, rgba(185, 28, 28, 0.95) 100%);
  border: 1px solid #fca5a5;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.soc-node-role-badge.garrison {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.75) 0%, rgba(29, 78, 216, 0.95) 100%);
  border: 1px solid #93c5fd;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
}

.soc-node-tile.has-rally .soc-node-role-badge.rally {
  display: flex;
}

.soc-node-tile.has-garrison .soc-node-role-badge.garrison {
  display: flex;
}

/* Pannello Controlli Master nel Modale Tecnologie */
.soc-modal-master-bar {
  margin: 10px 0 14px 0;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px dashed rgba(168, 85, 247, 0.45);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.soc-master-bar-title {
  font-size: 11px;
  font-weight: 800;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.soc-master-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.soc-master-tag-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.7);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.soc-master-tag-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
}

.soc-master-tag-btn.active.rally {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(185, 28, 28, 0.7) 100%);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

.soc-master-tag-btn.active.garrison {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(29, 78, 216, 0.7) 100%);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
}

/* Badge Livello sotto l'icona */
.soc-node-lvl-badge {
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 1.5px 7px;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 24;
}

.soc-node-tile.active .soc-node-lvl-badge {
  color: #38bdf8;
  border-color: #38bdf8;
  background: #0c2136;
  font-weight: 900;
}

.soc-node-tile.max .soc-node-lvl-badge {
  color: #fbbf24;
  border-color: #f59e0b;
  background: #231b0e;
  font-weight: 900;
}

/* Nome della ricerca sotto il badge */
.soc-node-name-label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  text-align: center;
  line-height: 1.2;
  width: 100%;
  padding: 2px 4px;
  background: rgba(11, 16, 26, 0.95);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.soc-node-tile:hover .soc-node-name-label {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* ================= MODALE INTERATTIVO DETTAGLIATO ================= */
.soc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.soc-modal-overlay.hidden {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.soc-modal-card {
  background: linear-gradient(145deg, #162032 0%, #0f1725 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 24px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.15);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.soc-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.soc-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* Header Modale */
.soc-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-right: 32px;
}

.soc-modal-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(56, 189, 248, 0.4);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.soc-modal-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.soc-modal-cat-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: inline-block;
}

.soc-modal-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.soc-modal-status-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.soc-modal-status-badge.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.soc-modal-status-badge.max {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.soc-modal-status-badge.locked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.soc-modal-status-badge.unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Descrizione Modale */
.soc-modal-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* Griglia Costi e Requisiti Modale */
.soc-modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.soc-modal-stat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.soc-modal-stat-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.soc-modal-stat-value {
  font-size: 13.5px;
  font-weight: 900;
  color: #38bdf8;
}

.soc-modal-stat-value.gold { color: #fbbf24; }
.soc-modal-stat-value.amber { color: #f59e0b; }

/* Box Prerequisiti */
.soc-modal-prereq-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.soc-modal-prereq-title {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.soc-modal-prereq-item {
  font-size: 12px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.soc-modal-prereq-item.ok {
  color: #34d399;
}

.soc-modal-prereq-item.missing {
  color: #f87171;
}

/* Controlli di Regolazione Modale Proporzionati */
.soc-modal-controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.soc-modal-stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 16px;
}

.soc-modal-lvl-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
}

.soc-modal-lvl-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.soc-modal-lvl-numbers {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.soc-modal-lvl-curr {
  font-size: 26px;
  font-weight: 900;
  color: #38bdf8;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.soc-modal-lvl-max {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.soc-modal-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.soc-ctrl-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 800;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.soc-ctrl-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.soc-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.soc-ctrl-btn.btn-step {
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.soc-ctrl-btn.btn-step:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.soc-ctrl-btn.btn-text {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
}

.soc-ctrl-btn.btn-max {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.18) 100%);
  border-color: #f59e0b;
  color: #fbbf24;
}

.soc-ctrl-btn.btn-max:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.45) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.soc-ctrl-btn.btn-reset {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.soc-ctrl-btn.btn-reset:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.soc-ctrl-btn.btn-done {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: #10b981;
  color: #34d399;
}

.soc-ctrl-btn.btn-done:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48) 0%, rgba(5, 150, 105, 0.38) 100%);
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  color: #ffffff;
}

/* Toast Notifica per Requisiti Mancanti */
.soc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #ef4444;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(239, 68, 68, 0.3);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
  text-align: center;
}

.soc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= OTTIMIZZAZIONI MOBILE SPECIFICHE (< 640px) ================= */
@media (max-width: 640px) {
  .help-kvk-container {
    padding: 10px 8px 80px 8px;
  }

  /* Hero Banner compatto */
  .help-kvk-hero {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .help-kvk-hero-title {
    font-size: 20px;
  }

  .help-kvk-hero-desc {
    font-size: 12.5px;
    line-height: 1.5;
  }

  /* Toolbar e Preset su Mobile */
  .help-kvk-toolbar {
    padding: 14px 12px;
    gap: 12px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .help-kvk-presets-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
  }

  .help-kvk-preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .help-kvk-preset-btn {
    padding: 7px 10px;
    font-size: 11.5px;
    justify-content: center;
  }

  .help-kvk-preset-btn.btn-reset-tree {
    width: 100%;
    margin-left: 0;
    padding: 8px 12px;
  }

  /* Griglia Statistiche 2x2 pulita */
  .help-kvk-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .help-kvk-stat-card {
    padding: 10px 8px;
    border-radius: 12px;
  }

  .help-kvk-stat-lbl {
    font-size: 10px;
  }

  .help-kvk-stat-val {
    font-size: 15px;
  }

  .help-kvk-rc-step-btn {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .help-kvk-rc-select {
    font-size: 12px;
    padding: 2px 5px;
    height: 26px;
  }

  /* Banner Descrizione Preset */
  .help-kvk-preset-info {
    padding: 10px 12px;
    font-size: 12px;
    margin-bottom: 16px;
    border-radius: 10px;
  }

  /* Albero Verticale Adattato al 100% dello Schermo (Zero Scroll Orizzontale) */
  .soc-tree-vertical-container {
    width: 100%;
    overflow-x: hidden;
    padding-bottom: 20px;
  }

  .soc-tree-canvas-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 18px 4px 40px 4px;
    border-radius: 16px;
    box-sizing: border-box;
  }

  .soc-tier-row {
    height: 94px;
    margin-bottom: 24px;
  }

  .soc-node-tile {
    width: 58px;
  }

  .soc-node-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border-width: 1.5px;
  }

  .soc-node-lock-badge {
    width: 14px;
    height: 14px;
    font-size: 9px;
    bottom: 1px;
    right: 1px;
  }

  .soc-node-role-badge {
    width: 14px;
    height: 14px;
  }

  .soc-node-lvl-badge {
    font-size: 8.5px;
    padding: 0.5px 4px;
    margin-top: 3px;
  }

  .soc-node-name-label {
    font-size: 9px;
    padding: 1.5px 2px;
    margin-top: 2px;
    border-radius: 4px;
    line-height: 1.1;
  }

  .soc-conn-path {
    stroke-width: 1.6px;
  }

  .soc-conn-path.active {
    stroke-width: 1.9px;
  }

  .soc-conn-path.max {
    stroke-width: 2px;
  }

  /* Modale Regolazione Tecnologia su Mobile */
  .soc-modal-overlay {
    padding: 10px;
  }

  .soc-modal-card {
    padding: 18px 14px;
    border-radius: 16px;
    max-height: 92vh;
  }

  .soc-modal-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .soc-modal-icon-box {
    width: 52px;
    height: 52px;
  }

  .soc-modal-title {
    font-size: 16px;
  }

  .soc-modal-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .soc-modal-stat-card {
    padding: 6px 10px;
  }

  .soc-modal-stat-title {
    font-size: 9.5px;
  }

  .soc-modal-stat-value {
    font-size: 12px;
  }

  .soc-modal-desc {
    font-size: 12px;
    padding: 8px 10px;
    margin-bottom: 12px;
  }

  .soc-modal-prereq-box {
    padding: 8px 10px;
    margin-bottom: 14px;
  }

  .soc-modal-prereq-item {
    font-size: 11px;
  }

  /* Stepper e Azioni Modale */
  .soc-modal-stepper-row {
    padding: 6px 12px;
    gap: 12px;
  }

  .soc-ctrl-btn.btn-step {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .soc-modal-lvl-curr {
    font-size: 22px;
  }

  .soc-modal-actions-row {
    gap: 6px;
  }

  .soc-ctrl-btn.btn-text {
    padding: 9px 8px;
    font-size: 12px;
  }
}
