/* =====================================================================
   SKILL BUILDER (skill-builder.php)
   - Parte 1: utilidades mínimas que antes daba Bootstrap. El JS de la
     página crea los elementos con esas clases (row, col-6, bg-dark, ...),
     así que se definen aquí, limitadas a .nw-sb.
   - Parte 2: reglas funcionales del CSS original (tooltip, ventana de
     detalles, árboles Combo/Heroic, Dragon Scion), con colores nuevos.
   - Parte 3: apariencia nueva.
   ===================================================================== */

/* ---------- Parte 1: utilidades (antes Bootstrap) ---------- */

.nw-sb .row {
  --sb-gx: 1.5rem;
  --sb-gy: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--sb-gy));
  margin-right: calc(-0.5 * var(--sb-gx));
  margin-left: calc(-0.5 * var(--sb-gx));
}
.nw-sb .row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--sb-gx) * 0.5);
  padding-left: calc(var(--sb-gx) * 0.5);
  margin-top: var(--sb-gy);
}
.nw-sb .g-1 { --sb-gx: 0.25rem; --sb-gy: 0.25rem; }
.nw-sb .gx-2 { --sb-gx: 0.5rem; }
.nw-sb .gx-3 { --sb-gx: 1rem; }
.nw-sb .row > .col-4 { flex: 0 0 auto; width: 33.333333%; }
.nw-sb .row > .col-6 { flex: 0 0 auto; width: 50%; }
@media (min-width: 768px) {
  .nw-sb .row > .col-md-6 { flex: 0 0 auto; width: 50%; }
}
@media (min-width: 992px) {
  .nw-sb .row > .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .nw-sb .row > .col-lg-6 { flex: 0 0 auto; width: 50%; }
}
.nw-sb .mb-1 { margin-bottom: 0.25rem; }
.nw-sb .mb-2 { margin-bottom: 0.5rem; }
.nw-sb .mb-3 { margin-bottom: 1rem; }
.nw-sb .mb-4 { margin-bottom: 1.5rem; }
.nw-sb .mb-5 { margin-bottom: 3rem; }
.nw-sb .mx-auto { margin-left: auto; margin-right: auto; }
.nw-sb .d-block { display: block; }
.nw-sb .d-flex { display: flex; }
.nw-sb .align-items-center { align-items: center; }
.nw-sb .justify-content-center { justify-content: center; }
.nw-sb .text-center { text-align: center; }
.nw-sb .text-white,
.nw-sb .text-light { color: var(--nw-text); }
.nw-sb .text-info { color: var(--nw-gold-soft); }
.nw-sb .text-muted { color: var(--nw-muted); }
.nw-sb .small { font-size: 0.875em; }
.nw-sb .p-2 { padding: 0.5rem; }
.nw-sb .rounded { border-radius: var(--nw-radius); }
.nw-sb .border { border: 1px solid var(--nw-line-soft); }
.nw-sb .bg-dark { background: rgba(10, 7, 8, 0.85); }
.nw-sb .bg-secondary { background: #3a2c2c; }
.nw-sb .position-relative { position: relative; }
.nw-sb .position-absolute { position: absolute; }

/* ---------- Parte 2: reglas funcionales del CSS original ---------- */

.skill-img { width: 64px; height: 64px; object-fit: contain; }
.hidden-fields { display: none; }

/* Tooltip styles */
.skill-tooltip {
 position: absolute;
 background: rgba(0, 0, 0, 0.95);
 border: 1px solid #444;
 border-radius: 4px;
 padding: 15px;
 min-width: min(600px, calc(100vw - 20px));
 max-width: min(900px, calc(100vw - 20px));
 max-height: 75vh;
 overflow: auto;
 z-index: 1000;
 font-size: 12px;
 color: #fff;
 box-shadow: 0 2px 10px rgba(0,0,0,0.8);
 pointer-events: auto;
 display: none;
}

.tooltip-header {
 color: var(--nw-gold);
 font-weight: bold;
 font-size: 14px;
 margin-bottom: 6px;
}

.tooltip-desc {
 color: #ccc;
 margin-bottom: 8px;
 font-size: 12px;
}

.tooltip-table {
 width: 100%;
 border-collapse: collapse;
 font-size: 11px;
 table-layout: fixed;
}

.tooltip-table th {
 background: rgba(40, 40, 40, 0.8);
 color: var(--nw-gold);
 padding: 4px 2px;
 text-align: center;
 border: 1px solid #555;
 font-size: 10px;
 white-space: nowrap;
 overflow: hidden;
 width: 28px;
}

.tooltip-table th:first-child {
 width: 170px;
 white-space: normal;
 overflow-wrap: anywhere;
 text-align: left;
 padding-left: 6px;
}

.tooltip-table td {
 padding: 3px 2px;
 text-align: center;
 border: 1px solid #333;
 background: rgba(20, 20, 20, 0.6);
 white-space: nowrap;
 overflow: hidden;
 font-size: 10px;
}

.tooltip-table td:first-child {
 text-align: left;
 padding-left: 6px;
 font-weight: bold;
}

.tooltip-table .current-level {
 background: rgba(224, 169, 106, 0.4);
 color: var(--nw-gold);
 font-weight: bold;
}

.tooltip-table .max-effect {
 background: rgba(220, 20, 60, 0.3);
 border: 1px solid #dc143c;
}

.skill-warning {
 background: rgba(220, 20, 60, 0.2);
 border: 1px solid #dc143c;
 color: #ff6b6b;
 padding: 4px 8px;
 border-radius: 3px;
 margin-top: 8px;
 font-size: 10px;
}

.item-bonus {
 background: rgba(34, 139, 34, 0.2);
 border: 1px solid #228b22;
 color: #90ee90;
 padding: 2px 4px;
 border-radius: 2px;
 font-size: 9px;
 margin-left: 5px;
}

.tooltip-req {
 margin-top: 8px;
 padding-top: 6px;
 border-top: 1px solid #555;
 color: #888;
 font-size: 10px;
}

.prerequisite-warning {
 color: #ff6b6b;
 font-size: 10px;
 margin-top: 2px;
}

.skill-unavailable {
 opacity: 0.5;
 pointer-events: none;
}

.skill-unavailable .btn {
 opacity: 0.3;
}

.tooltip-spec-table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.tooltip-spec-table th, .tooltip-spec-table td {
 padding: 4px 6px; border: 1px solid #444; text-align: left; overflow-wrap: anywhere;
}
.tooltip-req summary { cursor: pointer; color: var(--nw-gold); }

.skill-details-popup {
 position: fixed; inset: 0; margin: auto; padding: 0;
 width: min(1100px, calc(100vw - 32px)); max-width: none;
 max-height: calc(100vh - 32px); color: #fff;
 background: rgba(10, 10, 10, 0.98); border: 1px solid var(--nw-gold);
 border-radius: 8px; box-shadow: 0 12px 50px rgba(0, 0, 0, 0.8);
}
.skill-details-popup::backdrop { background: rgba(0, 0, 0, 0.75); }
.skill-popup-actions { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.skill-popup-content { padding: 12px 20px 20px; max-height: calc(100vh - 100px); overflow: auto; }
.skill-popup-content .tooltip-table { min-width: 750px; font-size: 13px; }
.skill-popup-content .tooltip-table th, .skill-popup-content .tooltip-table td { font-size: 12px; }
.skill-popup-content .tooltip-header { font-size: 18px; }
.skill-popup-content .tooltip-desc { font-size: 14px; }
.skill-popup-icon { cursor: pointer; }
.skill-popup-icon:focus-visible { outline: 2px solid var(--nw-gold); outline-offset: 3px; }
@media (max-width: 768px) {
 .skill-details-popup { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
 .skill-popup-content { padding: 10px; max-height: calc(100dvh - 80px); }
}

/* Normal skill sections use Bootstrap columns; keep spacing scoped to their panels. */
#normal-layout > [class*="col-"] {
 margin-bottom: 24px;
}

#normal-layout > .col-xl-3 {
 padding-left: 10px;
 padding-right: 10px;
}

/* Combo Tree Styles */
.combo-tree-container {
 position: relative;
 min-height: 600px;
 background: rgba(20, 20, 20, 0.8);
 border-radius: 8px;
 padding: 18px;
 width: 100%;
 max-width: 450px;
}

.combo-connection {
 position: absolute;
 background: #666;
 z-index: 0;
 pointer-events: none;
}

.combo-connection.horizontal {
 height: 2px;
}

.combo-connection.vertical {
 width: 2px;
}

.combo-connection.active {
 background: var(--nw-gold);
}

.combo-skill-wrapper {
 position: absolute;
 z-index: 2;
}

/* MOBIL JAVÍTÁSOK */

/* Alapvető viewport és érintés javítások */
* {
 -webkit-tap-highlight-color: transparent;
 -webkit-touch-callout: none;
 -webkit-user-select: none;
 -moz-user-select: none;
 -ms-user-select: none;
 user-select: none;
}

input, textarea {
 -webkit-user-select: auto;
 -moz-user-select: auto;
 -ms-user-select: auto;
 user-select: auto;
}

/* Responzív layout javítások */
@media (max-width: 1200px) {
 .row.mb-5.gx-2 {
   flex-direction: column;
 }
 
 .row.mb-5.gx-2 > .col-2 {
   width: 100% !important;
   max-width: 100% !important;
   flex: 0 0 100% !important;
   margin-bottom: 20px;
 }
 
 .row.mb-5.gx-2 > .col-4 {
   width: 100% !important;
   max-width: 100% !important;
   flex: 0 0 100% !important;
 }
 
 .combo-tree-container {
   max-width: 100%;
   width: 100% !important;
   min-height: 500px;
   overflow-x: auto;
   overflow-y: hidden;
 }
}

@media (max-width: 768px) {
 /* Container padding csökkentése */
 .container-fluid {
   padding-left: 10px !important;
   padding-right: 10px !important;
 }
 
 /* Skill grid javítások */
 #section-Combat .row.g-1,
 #section-Buff .row.g-1,
 #section-Class .row.g-1,
 #section-Passive .row.g-1 {
   margin: 0;
 }
 
 #section-Combat .col-6,
 #section-Buff .col-6,
 #section-Class .col-6,
 #section-Passive .col-6 {
   padding: 1px;
   flex: 0 0 50%;
   max-width: 50%;
   margin-bottom: 15px !important;
 }
 
 /* Skill box méretezés és layout */
 .p-2.bg-dark.rounded.border.border-secondary.text-center {
   padding: 4px !important;
   min-height: auto !important;
 }
 
 /* Skill képek */
 .skill-img {
   width: 40px !important;
   height: 40px !important;
   margin-bottom: 3px !important;
 }
 
 /* Skill nevek */
 .text-light.small.mb-1.text-center {
   font-size: 9px !important;
   margin-bottom: 2px !important;
   line-height: 1.1 !important;
   height: 22px !important;
   display: flex !important;
   align-items: center !important;
   justify-content: center !important;
   overflow: hidden !important;
   text-overflow: ellipsis !important;
 }
 
 /* Min level info */
 .text-info.small.text-center {
   font-size: 8px !important;
   margin-bottom: 3px !important;
 }
 
 /* Gombok kompaktabbá tétele */
 .btn-group-sm {
   width: 100% !important;
 }
 
 .btn-group-sm .btn {
   padding: 2px 4px !important;
   font-size: 10px !important;
   min-width: 24px !important;
   min-height: 24px !important;
   flex: 1 !important;
 }
 
 /* Combo tree container teljes szélesség */
 .combo-tree-container {
   max-width: none !important;
   width: 100vw !important;
   margin-left: calc(-50vw + 50%) !important;
   padding: 10px;
   transform: none !important;
   min-height: 400px;
   overflow-x: auto;
   overflow-y: hidden;
   position: relative;
   background: transparent !important;
   border: none !important;
   border-radius: 0 !important;
 }
 
 /* Parent row container módosítása */
 .row.mb-5.gx-2 > .col-4 {
   width: 100vw !important;
   max-width: 100vw !important;
   margin-left: calc(-50vw + 50%) !important;
   padding: 0 !important;
 }
 
 /* Prerequisite warning text */
 .prerequisite-warning {
   font-size: 8px !important;
   line-height: 1.1 !important;
   margin-top: 1px !important;
 }
 
 /* Stats sor mobil optimalizálás */
 .row.text-center.text-warning.mb-4 {
   font-size: 12px;
 }
 
 .row.text-center.text-warning.mb-4 .col-lg-4.col-6 {
   flex: 0 0 100%;
   max-width: 100%;
   margin-bottom: 8px !important;
 }
 
 /* Combo skill wrapper javítás - egyetlen media query */
 .combo-skill-wrapper {
   transform: scale(0.7) translateX(-60px);
   transform-origin: center;
 }
 
 .combo-skill-wrapper button {
   width: 28px !important;
   height: 28px !important;
   font-size: 18px !important;
 }
 
 .combo-skill-wrapper div[id*="combo-counter"] {
   width: 36px !important;
   height: 28px !important;
   font-size: 16px !important;
 }
}

@media (max-width: 480px) {
 .combo-skill-wrapper {
   transform: scale(0.6) translateX(-20px);
   transform-origin: center;
 }
}

/* Tooltip mobilbarát */
@media (max-width: 768px) {
 .skill-tooltip {
   position: fixed !important;
   left: 5px !important;
   right: 5px !important;
   bottom: 10px !important;
   top: auto !important;
   min-width: auto !important;
   max-width: none !important;
   width: auto !important;
   max-height: 50vh;
   overflow-x: auto !important;
   overflow-y: auto !important;
   pointer-events: auto !important;
   z-index: 9999;
 }
 
 .tooltip-table {
   font-size: 9px;
   min-width: 500px;
   white-space: nowrap;
 }
 
 .tooltip-table th {
   font-size: 9px;
   padding: 2px 1px;
 }
 
 .tooltip-table td {
   font-size: 9px;
   padding: 2px 1px;
 }
 
 .tooltip-header {
   font-size: 13px;
 }
 
 .tooltip-desc {
   font-size: 11px;
 }
}

/* Touch események javítása */
.skill-img,
.combo-skill,
.btn {
 touch-action: manipulation;
}


/* Combo button effects */
.combo-skill-wrapper button:active {
 transform: scale(0.9);
}

/* Tooltip asztali verziójának nagyobb betűméretei */
@media (min-width: 769px) {
 .skill-tooltip {
   font-size: 15px;
 }
 
 .tooltip-header {
   font-size: 17px;
 }
 
 .tooltip-desc {
   font-size: 14px;
 }
 
 .tooltip-table {
   font-size: 13px;
 }
 
 .tooltip-table th {
   font-size: 12px;
 }
 
 .tooltip-table td {
   font-size: 12px;
 }
 
 .tooltip-req {
   font-size: 12px;
 }
 
 .skill-warning {
   font-size: 12px;
 }
 
 .item-bonus {
   font-size: 11px;
 }
}

/* További skill sections alatti térköz */
#section-Combat,
#section-Buff, 
#section-Class,
#section-Passive {
 padding-bottom: 20px !important;
}



/* Mobilon combo skillek - végső egyszerű megoldás */
@media (max-width: 768px) {
  /* Parent container fix */
  .row.mb-5.gx-2 > .col-4 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }
  
  /* Combo tree container - NE változtassunk semmit, csak centrálás */
  .combo-tree-container {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    /* MINDEN MÁS maradjon az eredeti JavaScript által beállított értéken */
  }
  
  /* Skill wrapper méret növelés mobilon - nagyobb képek */
  .combo-skill-wrapper img {
    width: 80px !important;  /* Nagyobb mint az eredeti 72px */
    height: 80px !important;
    border: 3px solid #444 !important; /* Vastagabb border mobilon */
  }
  
  /* Mobilon a skill státusz kereteket is nagyobbra kell venni */
  .combo-skill-wrapper img[style*="border-color: #00ff00"] {
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.6) !important;
  }
  
  .combo-skill-wrapper img[style*="border-color: #d4af37"] {
    box-shadow: none !important;
  }
  
  .combo-skill-wrapper button {
    width: 30px !important;
    height: 30px !important;
    font-size: 18px !important;
  }
  
  .combo-skill-wrapper div[id*="combo-counter"] {
    width: 36px !important;
    height: 30px !important;
    font-size: 16px !important;
  }
  
  /* Tooltipok mobilon */
  .skill-tooltip {
    position: fixed !important;
    left: 5px !important;
    right: 5px !important;
    bottom: 10px !important;
    top: auto !important;
    min-width: auto !important;
    max-width: none !important;
    width: auto !important;
    max-height: 50vh !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
  }
}

@media (max-width: 480px) {
  /* Kis mobilon is nagyobb képek */
  .combo-skill-wrapper img {
    width: 75px !important;
    height: 75px !important;
  }
  
  .combo-skill-wrapper button {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }
  
  .combo-skill-wrapper div[id*="combo-counter"] {
    width: 34px !important;
    height: 28px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 768px) {
  #dragonscion-layout .col-4,
  #dragonscion-layout .col-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px;
  }
}

/* Dragonscion skill grid */
#section-Scion .col-6,
#section-Slayer .col-6,
#section-Orbiter .col-6,
#section-Summoner .col-6 {
  flex: 0 0 33.333333% !important;  /* 3 skill per row */
  max-width: 33.333333% !important;
}

#section-DragonPassive .col-6 {
  flex: 0 0 20% !important;  /* 5 skill per row */
  max-width: 20% !important;
}

/* Mobil responsive */
@media (max-width: 768px) {
  #dragonscion-layout .col-4,
  #dragonscion-layout .col-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px;
  }
  
  #section-Scion .col-6,
  #section-Slayer .col-6,
  #section-Orbiter .col-6,
  #section-Summoner .col-6,
  #section-DragonPassive .col-6 {
    flex: 0 0 50% !important;  /* 2 skill per row on mobile */
    max-width: 50% !important;
  }
}

/* Dragonscion kategória box stílusok */
#dragonscion-layout .col-4,
#dragonscion-layout .col-8 {
  padding: 15px;
}

/* Kategória konténerek alapstílusa */
.dragonscion-category {
  background: linear-gradient(135deg, 
    rgba(26, 26, 26, 0.95) 0%, 
    rgba(42, 42, 42, 0.85) 100%);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 20px 15px 25px 15px;
  margin-bottom: 20px;
  position: relative;
  backdrop-filter: blur(5px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Kategóriánkénti színek */
.category-scion {
  background: linear-gradient(135deg, 
    rgba(220, 20, 60, 0.15) 0%, 
    rgba(26, 26, 26, 0.95) 100%);
  border-image: linear-gradient(45deg, #b56d19, #b56d19) 1;
  border-style: solid;
}

.category-slayer {
  background: linear-gradient(135deg, 
    rgba(255, 69, 0, 0.15) 0%, 
    rgba(26, 26, 26, 0.95) 100%);
  border-image: linear-gradient(45deg, #b56d19, #b56d19) 1;
  border-style: solid;
}

.category-orbiter {
  background: linear-gradient(135deg, 
    rgba(65, 105, 225, 0.15) 0%, 
    rgba(26, 26, 26, 0.95) 100%);
  border-image: linear-gradient(45deg, #b56d19, #b56d19) 1;
  border-style: solid;
}

.category-summoner {
  background: linear-gradient(135deg, 
    rgba(138, 43, 226, 0.15) 0%, 
    rgba(26, 26, 26, 0.95) 100%);
  border-image: linear-gradient(45deg, #b56d19, #b56d19) 1;
  border-style: solid;
}

.category-passive {
  background: linear-gradient(135deg, 
    rgba(224, 169, 106, 0.15) 0%, 
    rgba(26, 26, 26, 0.95) 100%);
  border-image: linear-gradient(45deg, var(--nw-gold), #b8860b) 1;
  border-style: solid;
}

/* Fejléc stílusok */
.dragonscion-category h5 {
  color: #fff;
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 20px;
  position: relative;
}

/* Fejléc alatti vonal */
.dragonscion-category h5::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    currentColor 50%, 
    transparent 100%);
  margin: 8px auto 0;
  border-radius: 2px;
}

/* Speciális effektek */
.category-scion h5 { color: #b56d19; }
.category-slayer h5 { color: #b56d19; }
.category-orbiter h5 { color: #b56d19; }
.category-summoner h5 { color: #b56d19; }
.category-passive h5 { color: #b56d19; }

/* Hover effektus */
.dragonscion-category:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

/* Corner ornaments */
.dragonscion-category::before,
.dragonscion-category::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid;
  border-color: inherit;
}

.dragonscion-category::before {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.dragonscion-category::after {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* Mobil optimalizálás */
@media (max-width: 768px) {
  .dragonscion-category {
    margin-bottom: 15px;
    padding: 15px 10px 20px 10px;
  }
  
  .dragonscion-category h5 {
    font-size: 18px;
    margin-bottom: 15px;
  }
}

/* Match Dragon Scion specialty panels with the standard skill-builder panel style. */
.dragonscion-category,
.dragonscion-category.category-scion,
.dragonscion-category.category-slayer,
.dragonscion-category.category-orbiter,
.dragonscion-category.category-summoner,
.dragonscion-category.category-passive,
.dragonscion-category.category-heroic {
  background: rgba(12, 12, 14, 0.72) !important;
  border: 1px solid rgba(224, 169, 106, 0.18) !important;
  border-image: none !important;
  border-radius: 0 !important;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.42) !important;
  transform: none !important;
}
.dragonscion-category::before,
.dragonscion-category::after {
  display: none !important;
}
.dragonscion-category h5,
.category-scion h5,
.category-slayer h5,
.category-orbiter h5,
.category-summoner h5,
.category-passive h5 {
  color: var(--nw-gold) !important;
  text-shadow: none !important;
}
.dragonscion-category h5::after {
  display: none !important;
}

/* Ne zsugorítsuk le a combo fákat desktopon */
@media (min-width: 992px) {
  .combo-skill-wrapper { 
    transform: none !important; 
  }
}

/* Dragon Scion passzív fa legyen nagyobb */
#section-DragonPassive .combo-tree-container {
  max-width: none;
  transform: scale(1.15);          /* 1.1–1.3 között próbáld */
  transform-origin: top center;
}

/* Dragon Scion passzív fa méret javítások */

/* Először az oszlop szélességét kell felülírni */
#dragonscion-layout .col-4:has(#section-DragonPassive),
.col-4:has(#section-DragonPassive) {
  max-width: 450px !important;       /* Az oszlop maga legyen keskenyebb */
  flex: 0 0 450px !important;        /* Fix szélesség Bootstrap flexbox-ban */
}

#section-DragonPassive .combo-tree-container {
  max-width: 350px !important;        /* Szélesség csökkentése 450px-ről */
  width: 350px !important;            /* Fix szélesség */
  margin: 0 auto !important;          /* Középre igazítás */
  transform: scale(1.3) !important;  /* Megtartjuk a scale-t */
  transform-origin: top center;
}

/* Háttér (szürke rész) szélesítése és magasítása */
#section-DragonPassive {
  background: rgba(40, 40, 40, 0.6) !important;  /* Láthatóbb háttér */
  border-radius: 12px !important;
  padding: 25px 40px !important;      /* Nagyobb oldalsó padding */
  margin: 0 auto !important;
  max-width: 400px !important;        /* Háttér szélesebb mint a fa */
  width: 100% !important;
  min-height: 600px !important;       /* A háttér box legyen magasabb */
}

/* Mobil responzivitás */
@media (max-width: 768px) {
  #dragonscion-layout .col-4:has(#section-DragonPassive),
  .col-4:has(#section-DragonPassive) {
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  #section-DragonPassive .combo-tree-container {
    max-width: 300px !important;
    width: 300px !important;
  }
  
  #section-DragonPassive {
    max-width: 380px !important;
    padding: 20px 30px !important;
    min-height: 800px !important;
  }
}

@media (max-width: 480px) {
  #section-DragonPassive .combo-tree-container {
    max-width: 280px !important;
    width: 280px !important;
  }
  
  #section-DragonPassive {
    max-width: 350px !important;
    padding: 15px 25px !important;
  }
}

/* PASSIVE – sárga keretes box keskenyebbre */
.dragonscion-category.category-passive {
  max-width: 550px !important;   /* állítsd 430–480 közé ízlés szerint */
  margin: 0 auto !important;
}

/* Az oszlop, ami ezt tartja – igazodjon a keskenyebb boxhoz */
#dragonscion-layout .col-4:has(#section-DragonPassive),
.col-4:has(#section-DragonPassive) {
  max-width: 570px !important;   /* legyen egy kicsit nagyobb, mint a sárga box */
  flex: 0 0 480px !important;
}

/* A fa mögötti SZÜRKE HÁTTÉR – keskenyebb, de hagyjon pár px körmargót */
#section-DragonPassive {
  max-width: 540px !important;   /* 440 ≈ 402px fa + ~2×16px padding */
  padding: 20px 16px !important; /* kisebb oldalsó padding, hogy belférjen */
  margin: 0 auto !important;
  background: rgba(40,40,40,0.6) !important;
  border-radius: 12px !important;
}

/* A fa tényleges mérete (VÁLTOZATLAN – csak, hogy ne írja felül semmi) */
#section-DragonPassive .combo-tree-container {
  width: 350px !important;
  max-width: 350px !important;
  transform: scale(1.3) !important;
  transform-origin: top center;
}

#section-DragonPassive .combo-tree-container {
  transform: scale(1.231) !important;
  transform-origin: top center;
}

.heroic-tree-container { min-height: 600px; }


/* Add a small gutter between the large normal skill category panels. */
#normal-layout > .row.mb-4.gx-2 {
  --bs-gutter-x: 18px;
  row-gap: 18px;
}

#normal-layout > .row.mb-4.gx-2 > [class*="col-"] {
  padding-left: 9px !important;
  padding-right: 9px !important;
}
/* Compact normal skill cards: keep each card close to the icon/text instead of stretching to the column width. */
#normal-layout #section-Combat,
#normal-layout #section-Buff,
#normal-layout #section-Class,
#normal-layout #section-Passive {
  justify-content: center;
  align-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 6px;
  gap: 6px 8px;
}

#normal-layout .normal-skill-col {
  flex: 0 0 104px !important;
  max-width: 104px !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

#normal-layout .normal-skill-box {
  padding: 5px 4px !important;
  min-height: auto !important;
}

#normal-layout .normal-skill-box .skill-img {
  width: 50px !important;
  height: 50px !important;
  margin-bottom: 4px !important;
}

#normal-layout .normal-skill-box .text-light.small,
#normal-layout .normal-skill-box .text-info.small {
  font-size: 9px !important;
  line-height: 1.1 !important;
}

#normal-layout .normal-skill-box .text-light.small {
  min-height: 20px;
  margin-bottom: 2px !important;
}

#normal-layout .normal-skill-box .text-info.small {
  margin-bottom: 3px !important;
}

#normal-layout .normal-skill-controls {
  gap: 3px !important;
  margin-top: 3px !important;
}

#normal-layout .normal-skill-controls button {
  width: 20px !important;
  height: 20px !important;
  font-size: 13px !important;
}

#normal-layout .normal-skill-controls div[id^="counter-"] {
  width: 26px !important;
  height: 20px !important;
  font-size: 12px !important;
}
.heroic-tree-container {
  min-height: 600px;
  overflow: visible;
}
#section-Heroic .combo-skill-wrapper {
  z-index: 2;
}

/* Dragon Scion specializations: show two aligned panels per row.
   Row 1: Scion + selected specialization. Row 2: Passive + Heroics. */
#dragonscion-layout > .dragon-scion-row-column {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

/* Final Dragon Scion alignment pass.
   Older test-page overrides above force the passive column to a narrow fixed
   width and scale its tree, which makes the Slayer/Orbiter/Summoner layouts
   look uneven once only four Dragon panels are visible. Keep the rendered
   skill trees intact, but give every visible Dragon panel the same Bootstrap
   footprint and centered content so the page reads as a clean 2x2 grid. */
#dragonscion-layout {
  align-items: stretch;
  row-gap: 24px;
}

#dragonscion-layout > .dragon-scion-row-column,
#dragonscion-layout > .dragon-scion-row-column:has(#section-DragonPassive) {
  flex: 0 0 50% !important;
  max-width: 50% !important;
  width: 50% !important;
}

#dragonscion-layout > .dragon-scion-row-column .dragonscion-category,
#dragonscion-layout > .dragon-scion-row-column .dragonscion-category.category-passive {
  width: 100% !important;
  max-width: none !important;
  min-height: 100%;
  margin: 0 !important;
  overflow: visible;
}

#section-Scion,
#section-Slayer,
#section-Orbiter,
#section-Summoner,
#section-DragonPassive,
#section-DragonHeroic {
  box-sizing: border-box;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#section-DragonPassive {
  width: 100% !important;
  padding: 24px 16px !important;
}

#section-DragonPassive.combo-tree-container {
  transform: none !important;
  transform-origin: top center;
}

@media (max-width: 1199px) {
  #dragonscion-layout > .dragon-scion-row-column,
  #dragonscion-layout > .dragon-scion-row-column:has(#section-DragonPassive) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 1199px) {
  #dragonscion-layout > .col-4, #dragonscion-layout > .col-8 { flex: 0 0 100%; max-width: 100%; }
}
@media (max-width: 768px) {
  .skill-builder-hero { padding: 30px 18px; }
  .skill-builder-stats, .skill-builder-toolbar, .builder-overview, .builder-utilities { grid-template-columns: 1fr; }
  .utility-group { align-items: stretch; }
  .utility-group > * { width: 100%; }
}


/* ---------- Parte 3: apariencia nueva ---------- */

.nw-sb-page {
  max-width: 1480px;
}

/* Cabecera: estadísticas del build */
.nw-sb-hero-inner {
  flex-wrap: wrap;
}
.nw-sb-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 22px;
}
.nw-sb-stat {
  padding: 12px 14px;
  border: 1px solid var(--nw-frame);
  background: rgba(10, 8, 9, 0.85);
  text-align: center;
}
.nw-sb-stat > span {
  display: block;
  color: var(--nw-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nw-sb-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--nw-red-hot);
  font-family: var(--nw-font-display);
  font-size: 24px;
  line-height: 1.15;
}
.nw-sb-stat--class strong {
  color: var(--nw-gold);
  font-size: 20px;
}

/* Paneles */
.nw-sb .skill-builder-panel {
  margin-bottom: 18px;
  padding: 18px;
}
.nw-sb .toolbar-label {
  display: block;
  margin-bottom: 10px;
  color: var(--nw-gold);
  font-family: var(--nw-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Selector de clase */
.nw-sb .skill-builder-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: end;
}
.nw-sb .class-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.nw-sb .class-btn {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--nw-frame);
  border-radius: var(--nw-radius);
  color: var(--nw-text);
  background: linear-gradient(180deg, rgba(30, 20, 18, 0.92), rgba(8, 6, 6, 0.92));
  font-family: var(--nw-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.nw-sb .class-btn:hover,
.nw-sb .class-btn:focus-visible {
  border-color: var(--nw-gold);
  box-shadow: 0 0 14px rgba(224, 169, 106, 0.22);
  outline: none;
}
.nw-sb .class-btn.active {
  color: #fff;
  border-color: rgba(255, 140, 110, 0.65);
  background: linear-gradient(180deg, #ef3b2c 0%, #b8170f 55%, #8d0f09 100%);
  box-shadow: 0 0 18px rgba(255, 60, 40, 0.4), inset 0 1px 0 rgba(255, 210, 190, 0.35);
}
.nw-sb .requirement-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--nw-line-soft);
  background: rgba(0, 0, 0, 0.3);
  color: var(--nw-text);
  font-size: 14px;
  cursor: pointer;
}
.nw-sb .requirement-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--nw-red);
  cursor: pointer;
}
.nw-sb .requirement-toggle i {
  color: var(--nw-muted);
}

/* Resumen de puntos */
.nw-sb .builder-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}
.nw-sb .overview-metric {
  padding: 10px;
  border: 1px solid var(--nw-line-soft);
  background: rgba(0, 0, 0, 0.3);
  color: var(--nw-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nw-sb .overview-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--nw-text);
  font-family: var(--nw-font-display);
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
}

/* Compartir build / bonus de ítems */
.nw-sb .builder-utilities {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: end;
}
.nw-sb .utility-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.nw-sb .utility-group .toolbar-label {
  width: 100%;
  margin-bottom: 0;
}
.nw-sb .share-utility #share-url {
  flex: 1 1 260px;
  min-width: 0;
}
.nw-sb .utility-group .nw-input {
  min-height: 40px;
}
.nw-sb .utility-group .nw-btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 13px;
}
.nw-sb .bonus-utility #item-bonus {
  width: 90px;
  padding: 0 8px;
  text-align: center;
}
.nw-sb .bonus-utility small {
  color: var(--nw-muted);
  font-size: 12px;
}

/* Títulos de cada grupo de skills */
.nw-sb .nw-sb-heading {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--nw-line);
  color: var(--nw-gold) !important;
  font-family: var(--nw-font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: none !important;
}

/* Contenedores de skills (paneles) */
.nw-sb #section-Combat,
.nw-sb #section-Buff,
.nw-sb #section-Class,
.nw-sb #section-Passive,
.nw-sb #section-Combo,
.nw-sb #section-Heroic,
.nw-sb .dragonscion-category {
  background: linear-gradient(180deg, rgba(20, 13, 14, 0.9), rgba(9, 7, 8, 0.9)) !important;
  border: 1px solid var(--nw-frame) !important;
  border-radius: var(--nw-radius) !important;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.45) !important;
}
.nw-sb #normal-layout > .row > [class*="col-"],
.nw-sb #dragonscion-layout > [class*="col-"] {
  padding: 10px;
}
.nw-sb .combo-tree-container {
  margin-bottom: 0;
}

/* Tarjeta de skill normal (Combat / Buff / Class / Passive) */
.nw-sb #normal-layout .normal-skill-box {
  height: 100%;
  border: 1px solid var(--nw-line-soft) !important;
  background: rgba(6, 4, 5, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nw-sb #normal-layout .normal-skill-box .skill-img {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
@media (min-width: 992px) {
  .nw-sb #normal-layout .normal-skill-col {
    flex-basis: 98px !important;
    max-width: 98px !important;
  }
}
/* Sin puntos: icono en gris. Con 1 punto o más: a color. */
.nw-sb #normal-layout .normal-skill-col:not(.is-learned) .skill-img {
  filter: grayscale(1) brightness(0.75);
}
.nw-sb #normal-layout .normal-skill-col.is-learned .normal-skill-box {
  border-color: rgba(224, 169, 106, 0.55) !important;
  box-shadow: 0 0 12px rgba(224, 169, 106, 0.18);
}
.nw-sb #normal-layout .normal-skill-col.is-learned .skill-img {
  border-color: var(--nw-gold);
}
.nw-sb .prerequisite-warning {
  color: #ff8a78;
}

/* Botones − / + y contador (el JS les pone colores en línea) */
.nw-sb .normal-skill-controls button,
.nw-sb .combo-skill-wrapper button,
.nw-sb .scion-skill-wrapper button {
  border-radius: 3px !important;
  color: #fff !important;
  line-height: 1;
}
.nw-sb .normal-skill-controls button:first-child,
.nw-sb .combo-skill-wrapper button:first-of-type,
.nw-sb .scion-skill-wrapper button:first-of-type {
  border: 1px solid rgba(201, 145, 88, 0.45) !important;
  background: #2a1717 !important;
}
.nw-sb .normal-skill-controls button:last-child,
.nw-sb .combo-skill-wrapper button:last-of-type,
.nw-sb .scion-skill-wrapper button:last-of-type {
  border: 1px solid rgba(255, 140, 110, 0.6) !important;
  background: linear-gradient(180deg, #ef3b2c, #a3140c) !important;
}
.nw-sb .normal-skill-controls button:first-child:hover,
.nw-sb .combo-skill-wrapper button:first-of-type:hover,
.nw-sb .scion-skill-wrapper button:first-of-type:hover {
  background: #45201c !important;
}
.nw-sb .normal-skill-controls button:last-child:hover,
.nw-sb .combo-skill-wrapper button:last-of-type:hover,
.nw-sb .scion-skill-wrapper button:last-of-type:hover {
  background: linear-gradient(180deg, #ff4a36, #b8170f) !important;
}
.nw-sb [id^="counter-"],
.nw-sb [id*="-counter-"] {
  border: 1px solid var(--nw-frame) !important;
  background: #120c0d !important;
  color: var(--nw-gold) !important;
}

/* Líneas de los árboles */
.nw-sb .combo-connection {
  background: #4a3a38;
}
.nw-sb .combo-connection.active,
.nw-sb .scion-connection.active {
  background: var(--nw-gold);
}

/* Tooltip y ventana de detalles */
.skill-tooltip {
  border-color: var(--nw-frame);
  background: rgba(10, 7, 8, 0.97);
  font-family: var(--nw-font-body);
}
.skill-tooltip .tooltip-header,
.skill-details-popup .tooltip-header {
  color: var(--nw-gold);
  font-family: var(--nw-font-display);
}
.tooltip-table th {
  background: rgba(40, 20, 18, 0.85);
  color: var(--nw-gold);
  border-color: rgba(201, 145, 88, 0.3);
}
.tooltip-table td {
  border-color: rgba(255, 255, 255, 0.07);
}
.tooltip-table .current-level {
  background: rgba(224, 169, 106, 0.3);
  color: #ffe3c2;
}
.tooltip-table .max-effect {
  background: rgba(227, 52, 42, 0.25);
  border-color: var(--nw-red);
}
.skill-details-popup {
  border-color: var(--nw-frame);
  border-radius: var(--nw-radius);
  background: rgba(10, 7, 8, 0.98);
  color: var(--nw-text);
  font-family: var(--nw-font-body);
}
.skill-details-popup::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.skill-popup-actions .nw-sb-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--nw-frame);
  border-radius: var(--nw-radius);
  background: rgba(30, 20, 18, 0.92);
  color: var(--nw-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.skill-popup-actions .nw-sb-popup-close:hover {
  border-color: var(--nw-gold);
}
.skill-popup-icon:focus-visible {
  outline-color: var(--nw-gold);
}

@media (max-width: 1100px) {
  .nw-sb-stats,
  .nw-sb .builder-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .nw-sb .skill-builder-toolbar,
  .nw-sb .builder-utilities {
    grid-template-columns: 1fr;
  }
  .nw-sb .class-button-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nw-sb .class-btn {
    padding: 0 4px;
    font-size: 11px;
  }
  /* Los árboles tienen ancho fijo: se desplazan dentro de su panel */
  .nw-sb .combo-tree-container {
    width: 100% !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden;
  }
  .nw-sb .dragonscion-category {
    overflow-x: auto !important;
  }
  .nw-sb #normal-layout > .row > [class*="col-"],
  .nw-sb #dragonscion-layout > [class*="col-"] {
    padding: 6px 0;
  }
  .nw-sb .row.mb-5.gx-2 > .col-4 {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 6px 0 !important;
  }
}

@media (max-width: 560px) {
  .nw-sb-stats,
  .nw-sb .builder-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nw-sb-stat--class {
    grid-column: 1 / -1;
  }
  .nw-sb .overview-metric:last-child {
    grid-column: 1 / -1;
  }
  .nw-sb .class-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nw-sb .skill-builder-panel {
    padding: 14px;
  }
}
