/* Traits v2 (13/11/2026, local). Sustituye a traits-full.css. */
html.tv2 body.aw-page-traits:not(:has(.bv-build)) { --tv2-left: 400px; }
html.tv2 .tt-top { display: none !important; }              /* título y bloque antiguo: las piezas útiles se mueven a .tv2-head */
html.tv2 .tt-title { display: none !important; }

/* ---------- cabecera: menú de clase (tipo Z-C sin letras), armas, opciones ---------- */
.tv2-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 22px; padding: 6px 0 8px; position: relative; z-index: 30; }
.tv2-badge { position: absolute; top: -3px; right: -2px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: #e0c47a; color: #14120d; font: 700 .6875rem/16px Inter, Arial, sans-serif; text-align: center; }
.tv2-weapons .aw-picker { margin: 0 !important; }
.tv2-weapons .aw-picker__label, .tv2-weapons .tt-key { display: none !important; }
.tv2-weapons .tt-wrow { display: flex; justify-content: flex-start; }
.tv2-weapons .tt-wname { margin: 2px 0 0; text-align: left; }
.tv2-opts { margin-left: auto; position: relative; }
.tv2-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(440px, 92vw); max-height: 70vh; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(16, 15, 12, .98); border: 1px solid rgba(255, 255, 255, .45); box-shadow: 0 14px 40px rgba(0, 0, 0, .65); }
.tv2-panel[hidden] { display: none !important; }
.tv2-panel .tt-title__tools, .tv2-panel .tt-controls, .tv2-panel .tt-views { position: static !important; display: flex !important; flex-wrap: wrap; gap: 8px; width: auto !important; max-width: none !important; background: none !important; pointer-events: auto !important; }
.tv2-panel .tt-title__tools { flex-direction: column; align-items: stretch; }
.tv2-panel .tt-controls { flex-direction: column; align-items: stretch; }

/* ---------- escritorio: columna izquierda + cuadro grande del árbol ---------- */
@media (min-width: 900px) {
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) main.tt-page { max-width: none !important; width: 100% !important; padding-inline: clamp(16px, 2vw, 40px) !important; margin: 0 !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-body {
    display: grid !important; grid-template-columns: var(--tv2-left) minmax(0, 1fr) !important; gap: 16px !important; align-items: stretch !important;
    height: calc(100dvh - var(--tv2-top, 190px) - var(--tv2-bottom, 70px)) !important; min-height: 420px !important; margin: 0 !important;
  }
  /* columna izquierda: puntos + ficha */
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) main.tt-page { display: block !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side > .tt-points { position: static !important; display: block !important; width: auto !important; max-width: none !important; margin: 0 0 8px !important; padding: 0 4px; pointer-events: auto !important; font-size: 1.25rem; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side {
    grid-column: 1 !important; grid-row: 1 !important; position: static !important; display: block !important; inset: auto !important; transform: none !important;
    width: auto !important; max-width: none !important; max-height: none !important; height: 100% !important; overflow: hidden !important; display: flex !important; flex-direction: column; pointer-events: auto !important; z-index: 2 !important;
  }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side::after { display: none !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail { max-height: none !important; min-height: 100%; width: 100% !important; flex: 1 1 auto; box-shadow: none !important; overflow: auto !important; pointer-events: auto !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side [data-d-close] { display: none !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail.is-empty { display: block !important; opacity: 1 !important; visibility: visible !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail__desc,
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail__combo { font-size: 1rem !important; -webkit-line-clamp: unset !important; max-height: none !important; overflow: visible !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail__name { font-size: 1.3rem !important; overflow-wrap: anywhere; white-space: normal !important; }
  /* el árbol: cuadro grande a la derecha */
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-tree { grid-column: 2 !important; grid-row: 1 !important; height: 100% !important; min-height: 0; display: flex !important; flex-direction: column; position: relative; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-tree > .tt-head { display: none !important; }
  html.tv2.tt-js body.aw-page-traits:not(:has(.bv-build)) .tt-stage:not(.is-catalog-stage) {
    position: relative !important; inset: auto !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
    flex: 1 1 auto; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; overflow: hidden !important;
    background: rgba(10, 10, 9, .55) !important; border: 1px solid rgba(255, 255, 255, .28) !important; box-shadow: inset 0 0 40px rgba(0, 0, 0, .5) !important; z-index: 1;
    cursor: default;
  }
  html.tv2.tt-js body.aw-page-traits:not(:has(.bv-build)) .tt-stage.is-free { cursor: grab; }
  html.tv2.tt-js body.aw-page-traits:not(:has(.bv-build)) .tt-stage.is-catalog-stage { position: relative !important; inset: auto !important; flex: 1 1 auto; height: 100% !important; overflow: auto !important; }
  html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-stage > .tt-zoom { margin: 0 !important; transform-origin: 0 0; }
  .tv2-lock { position: absolute; z-index: 20; right: calc(clamp(16px, 2vw, 40px) + 12px); margin-top: 12px; }
  .tt-tree { position: relative; }
}
/* el botón queda dentro del cuadro: lo colocamos encima del stage con posición absoluta respecto a .tt-tree */
.tv2-lock { position: absolute; top: 10px; right: 12px; z-index: 20; }
.tt-tree .tv2-lock { top: 12px; right: 12px; }
html.tv2 .tt-tree { position: relative; }

/* ---------- móvil / tablet: árbol bloqueado y ajustado, sin botón de desbloqueo ---------- */
@media (max-width: 899px), (hover: none) and (pointer: coarse) {
  .tv2-lock { display: none !important; }
  .tv2-head { gap: 6px 10px; }
  .tv2-opts { margin-left: 0; }
  .tv2m__lbl { font-size: 13px; } .tv2m__item { min-width: 0; padding: 3px 7px; }
  html.tv2 .tt-stage { touch-action: pan-y !important; }
}

@media (max-width: 899px), (hover: none) and (pointer: coarse) {
  html.tv2 body.aw-page-traits .tt-side.is-closed { display: none !important; }
  .tv2-head .tt-points { flex: 1 0 100%; position: static !important; margin: 4px 0 0 !important; pointer-events: auto !important; width: auto !important; max-width: none !important; }
  .tv2-weapons .aw-pick { min-width: 0 !important; padding-inline: 6px !important; }
  .tv2-weapons .aw-pick__label { font-size: .75rem !important; overflow-wrap: normal; white-space: nowrap; }
  .tv2m .tv2-create { border-left: 0; margin-left: 0; }
}
html.tv2 .aw-mtt-create, html.tv2 .aw-mzoom { display: none !important; }   /* en v2 la creación está en el menú de clase y el árbol móvil no se mueve ni hace zoom */

/* ---- ronda 2 (13/11/2026) ---- */
/* puntos dentro del cuadro del árbol, arriba a la izquierda, con los tamaños de texto del resto de la web */
html.tv2 .tt-tree > .tt-points { position: absolute !important; top: 12px; left: 14px; z-index: 20; margin: 0 !important; padding: 6px 12px; display: flex !important; align-items: baseline; gap: 8px;
  width: auto !important; max-width: none !important; pointer-events: auto !important; background: rgba(14, 13, 11, .78); border: 1px solid rgba(201, 178, 127, .25); font: 500 .875rem/1.2 Inter, system-ui, Arial, sans-serif !important; color: #b5b0a2; }
html.tv2 .tt-tree > .tt-points b { font: 600 1.0625rem/1.2 Inter, system-ui, Arial, sans-serif !important; color: #f0ece1; display: inline-flex; align-items: baseline; }
html.tv2 .tt-tree > .tt-points .tt-points__in { font: 600 1.0625rem/1.2 Inter, system-ui, Arial, sans-serif !important; color: #f0ece1; }
/* marcos y fondos como en Personaje y Equipación */
html.tv2 body.aw-page-traits:not(:has(.bv-build)) .tt-side .aw-detail,
html.tv2.tt-js body.aw-page-traits:not(:has(.bv-build)) .tt-stage:not(.is-catalog-stage) {
  border: 1px solid transparent !important; border-image: var(--ui-frame) var(--ui-frame-slice) / var(--ui-frame-w) / 0 stretch !important; border-radius: 0 !important;
  background: rgba(20, 19, 17, .78) !important; box-shadow: none !important;
}
/* un solo scroll de página: la cabecera ya no suma altura extra */
html.tv2 body.aw-page-traits main.tt-page { padding-top: 0 !important; margin-top: 0 !important; }
html.tv2 .tv2-head { padding-top: 0; margin-top: -6px; }
/* modo creación de personaje: solo la clase elegida y sus opciones a la derecha */
body.aw-creating .tv2m .tv2-cls:not(.is-on):not(.tv2-wpn), body.aw-creating .tv2m .tv2-create { display: none !important; }
.tv2-head #aw-pc-tools.is-in-nav, .tv2-head #aw-pc-tools { position: static !important; margin: 0 0 0 4px !important; flex: 0 1 auto; align-self: center; justify-content: flex-start; max-width: none; }

html body .tv2-head #aw-pc-tools, html body .tv2-head #aw-pc-tools.is-in-nav { order: 0 !important; flex: 0 1 auto !important; margin: 0 0 0 4px !important; justify-content: flex-start !important; position: static !important; }

/* ---- ronda 3 (13/11/2026) ---- */
/* menú de clase alineado a la izquierda con el Z-C y 3 px de separación; sin recorte de iconos */
html body .tv2-head { margin-top: 3px !important; padding-top: 4px !important; padding-left: var(--tv2-ml, 0px) !important; overflow: visible; }
html body .tv2-head--page { margin-bottom: 0 !important; }
/* armas: compactas y pegadas a su clase, sin línea entre clase y armas */
.tv2m__wgrp { display: inline-flex; align-items: center; gap: 2px; margin-left: -4px; padding: 3px 5px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(200,185,141,.16); }
.tv2m .tv2-wpn { flex-direction: row; gap: 5px; min-width: 0; padding: 2px 4px; border-radius: 5px; }
.tv2m .tv2-wpn .tv2m__icon { width: 24px; height: 24px; border-radius: 4px; border-color: transparent; }
.tv2m .tv2-wpn .tv2m__icon img { width: 18px; height: 18px; }
.tv2m .tv2-wpn .tv2m__lbl { display: none; font: 600 12px/1 Inter, Arial, sans-serif; letter-spacing: 0; }
.tv2m .tv2-wpn.is-on .tv2m__lbl { display: block; }
.tv2m .tv2-wpn.is-on::after { left: 4px; right: 4px; bottom: -2px; }
.tv2m .tv2-wpn .tv2-badge { top: -7px; right: -5px; min-width: 13px; font-size: .625rem; line-height: 13px; }
/* acciones junto a Opciones: compartir, descargar imagen */
.tv2-head { align-items: center; }
.tv2-acts { margin-left: auto; display: flex; gap: 6px; }
.tv2-opts { margin-left: 0 !important; }
.tv2-ico { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; color: #e8dfc6; cursor: pointer; background: rgba(20,19,17,.78); border: 1px solid rgba(201,178,127,.4); border-radius: 6px; transition: background .15s, border-color .15s, color .15s; }
.tv2-ico:hover { border-color: #e8c97a; color: #fff; background: rgba(201,178,127,.14); }
.tv2-ico .i-ok { position: absolute; opacity: 0; transform: scale(.4); }
.tv2-ico.is-copied { border-color: #7fcf6a; color: #bff0ad; background: rgba(127,207,106,.18); animation: tv2pop .5s cubic-bezier(.2,.9,.3,1.4); }
.tv2-ico.is-copied .i-link { opacity: 0; transform: scale(.4); }
.tv2-ico.is-copied .i-ok { opacity: 1; transform: scale(1); transition: all .25s .05s; }
@keyframes tv2pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* Reportar abajo a la derecha del cuadro (rama y catálogo) */
.tv2-report { position: absolute !important; right: 12px; bottom: 12px; z-index: 25; }
/* ventana «Ver detalles» justo a la derecha de la ficha de la habilidad */
html.tv2 .tt-statuswin { left: var(--tv2-sidex, 420px) !important; right: auto !important; width: min(340px, 30vw) !important; z-index: 40; }
/* botones de la ficha: Estadísticas, Fijar, Reportar apilados a la izquierda abajo */
html.tv2 .tt-side .aw-detail { display: flex !important; flex-direction: column; }
html.tv2 .tt-side .aw-detail__foot, html.tv2 .tt-side .aw-detail__btns, html.tv2 .tt-side .aw-detail__pinwrap { display: contents !important; }
html.tv2 .tt-side .aw-detail__status { order: 80; margin-top: auto; padding-top: 10px; }
html.tv2 .tt-side .aw-detail__btns [data-d-action] { order: 81; align-self: flex-start; margin: 6px 0 0; }
html.tv2 .tt-side .aw-sn-row { order: 90; margin: 8px 0 0 !important; align-self: flex-start; }
html.tv2 .tt-side .aw-detail__pin { order: 91; align-self: flex-start; margin: 6px 0 0; }
html.tv2 .tt-side .aw-detail__btns [data-d-report] { order: 92; align-self: flex-start; margin: 6px 0 0; }html.tv2 .tt-side .aw-sn-row { flex-direction: column !important; align-items: flex-start !important; flex-wrap: nowrap !important; gap: 6px; margin-top: 6px !important; }
html.tv2 .tt-side .aw-sn-row > * { margin: 0 !important; }
html.tv2 .tt-side .aw-detail__pin, html.tv2 .tt-side .aw-detail__btns [data-d-report] { margin-top: 6px !important; }

/* Catálogo: sustituye al árbol dentro del mismo cuadro y reparte las habilidades para ajustarse a él */
html.tv2 .tt-canvas.is-catalog { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-rows: min-content; gap: 12px 24px; align-content: start; padding: 14px 16px 52px; width: 100% !important; height: auto !important; box-sizing: border-box; }
html.tv2 .tt-canvas.is-catalog .tt-catalog__head { grid-column: 1 / -1; display: none; }
html.tv2 .tt-canvas.is-catalog .tt-catalog__sec { min-width: 0; }
html.tv2 .tt-canvas.is-catalog .tt-catalog__sec h3 { margin: 0 0 8px; }
html.tv2 .tt-canvas.is-catalog .tt-catalog__grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px 6px; }
html.tv2 .tt-canvas.is-catalog .tt-catalog__name { font-size: .6875rem; line-height: 1.15; }
html.tv2 .tt-stage.is-catalog-stage .tt-zoom { transform: none !important; width: 100% !important; zoom: 1 !important; }
html.tv2 body .tt-stage .tt-canvas.is-catalog { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important; max-width: none !important; }
html.tv2 body .skills-page .tt-stage.is-catalog-stage .tt-canvas.is-catalog, html.tv2 body .tt-stage.is-catalog-stage .tt-canvas.is-catalog { padding: 14px 16px 52px !important; }

/* ficha: botones pegados al final de la información, con márgenes, alineados y del mismo tamaño */
html.tv2 .tt-side .aw-detail__status { margin-top: 14px !important; padding: 0 18px !important; }
html.tv2 .tt-side .aw-detail__btns [data-d-action] { margin: 10px 18px 0 !important; }
html.tv2 .tt-side .aw-sn-row { margin: 12px 18px 0 !important; padding: 0 !important; gap: 8px !important; align-self: stretch !important; }
html.tv2 .tt-side .aw-sn-row > *, html.tv2 .tt-side .aw-detail__pin, html.tv2 .tt-side .aw-detail__btns [data-d-report] { width: 180px !important; min-height: 38px; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; }
html.tv2 .tt-side .aw-detail__pin, html.tv2 .tt-side .aw-detail__btns [data-d-report] { margin: 8px 0 0 18px !important; align-self: flex-start; }
html.tv2 .tt-side .aw-detail__btns [data-d-report] { margin-bottom: 18px !important; }
html.tv2 .tt-side .aw-detail__vd.aw-btn { gap: 8px; }
/* el desplegable de idioma de la leyenda (abajo a la derecha) sobra: ya está arriba en la cabecera */
html.tv2 .aw-legend--traits label.aw-lang, html.tv2 .aw-legend--traits #lang-legend { display: none !important; }
