/* D-EDIFICIOS-3 F2 D-ED3-T6 (adenda F2 de claude/_CLAUDE_D_EDIFICIOS_3_MESA.md) — la pantalla de la Torre del mago
   (src/modules/torre_vista.ts). Pantalla completa sin scroll, en los dos estilos del esqueleto de los sitios (sitio.css): A Salón dorado
   y B Estandartes. Clases propias `tor-*`; nada de ui/marco.css. El violeta del portal (barra.css) para lo que es de la Torre. */

.sitio-raiz[data-sitio="torre"] .sitio-acciones { display: flex; gap: 8px; align-items: center; }
.tor-cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---- la portada: la Torre por fuera, con su nivel y lo que da */
.tor-portada { position: relative; flex: 0 0 34%; min-height: 150px; border-radius: 10px; overflow: hidden;
  background: #0b0a12 var(--arte) center 40% / cover no-repeat; border: 1px solid rgba(190,170,255,.45);
  box-shadow: inset 0 -80px 90px -30px rgba(6,4,12,.92), inset 0 0 0 1px rgba(0,0,0,.4); }
.sitio-raiz[data-estilo="B"] .tor-portada { border-radius: 4px; border-color: rgba(200,168,96,.55); }
.tor-portada__texto { position: absolute; left: 18px; bottom: 14px; display: flex; flex-direction: column; gap: 3px; max-width: 70%;
  text-shadow: 0 1px 3px rgba(0,0,0,.95); }
.tor-portada__nivel { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #c9bcff; }
.tor-portada__efecto { font-size: 18px; color: #f1ecff; font-weight: 700; }
.tor-portada__texto small { font-size: 12px; color: #d4cde8; }
.tor-portada__obra { color: #ffd38a !important; }
.tor-portada__platino { position: absolute; right: 14px; top: 12px; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.6); border: 1px solid rgba(233,196,106,.5); color: #f3dca0; font-size: 13px; }
.tor-pips { display: inline-flex; gap: 4px; }
.tor-pip { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(190,170,255,.75); background: rgba(0,0,0,.4); }
.tor-pip--hecha { background: radial-gradient(circle at 35% 35%, #f1ecff, #a08cff 60%, #4b3aa8); }

/* ---- las dos columnas: los sitios atados y cómo se ata */
.tor-columnas { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px 16px; }
.tor-col .sitio-seccion__cuerpo { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.tor-nota { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ui-tinta-2, #8d8773); }

.tor-atados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.tor-atado { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; min-width: 0;
  background: rgba(120,100,230,.08); border: 1px solid rgba(160,140,255,.35); }
.sitio-raiz[data-estilo="B"] .tor-atado { border-radius: 3px; }
.tor-atado__sello { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #a08cff;
  box-shadow: 0 0 8px rgba(160,140,255,.55), inset 0 0 4px rgba(160,140,255,.55); }
.tor-atado__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tor-atado__nombre { color: #f1ecff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tor-atado__region { font-size: 11.5px; color: var(--ui-tinta-1, #c8c1ac); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tor-atado__acciones { flex: none; display: flex; gap: 6px; }
.tor-atado--aqui { border-color: #a08cff; }
.tor-atado--hueco { background: transparent; border-style: dashed; border-color: rgba(160,140,255,.25); }
.tor-atado--hueco .tor-atado__sello { border-color: rgba(160,140,255,.35); box-shadow: none; }
.tor-atado--hueco .tor-atado__nombre { font-weight: 400; color: var(--ui-tinta-2, #8d8773); }

.tor-pasos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.4; color: var(--ui-tinta-0, #efe9d7); }
.tor-pasos li::marker { color: #c9bcff; font-weight: 700; }
.tor-niveles { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tor-niveles th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-tinta-2, #8d8773);
  padding: 3px 8px; border-bottom: 1px solid rgba(160,140,255,.25); }
.tor-niveles td { padding: 3px 8px; color: var(--ui-tinta-1, #c8c1ac); }
.tor-niveles__actual td { color: #f1ecff; background: rgba(160,140,255,.14); font-weight: 700; }

/* ---- los botones (propios: no los de marco.css) */
.tor-boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: #e6e0ff; background: linear-gradient(180deg, rgba(64,52,120,.92), rgba(30,24,60,.94)); border: 1px solid rgba(160,140,255,.6);
  transition: border-color .15s ease, color .15s ease, transform .15s ease; white-space: nowrap; }
.tor-boton:hover:not(:disabled), .tor-boton:focus-visible { border-color: #c9bcff; color: #fff; transform: translateY(-1px); outline: none; }
.tor-boton:disabled { opacity: .45; cursor: not-allowed; }
.tor-boton--soltar { background: transparent; border-color: rgba(220,120,100,.45); color: #f0c8bf; }
.tor-boton--volver, .sitio-raiz[data-sitio="torre"] .sitio-acciones .tor-boton { color: #f3dca0; border-color: rgba(233,196,106,.6); background: linear-gradient(180deg, rgba(70,50,20,.9), rgba(36,26,10,.92)); }
.tor-boton--portal { align-self: flex-start; margin-top: auto; padding: 8px 16px; font-size: 14px; font-weight: 700; }
.sitio-raiz[data-estilo="B"] .tor-boton { border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }

/* ---- D-EDIFICIOS-3 F2b-F2c D-ED3-E4 (adenda F2b-F2c) — las tres pestañas: Portales, Encantar e Investigar */
.tor-cuerpo > .tor-portada { flex-basis: 30%; }
.tor-portada__resumen { color: #c9bcff !important; }
.tor-pestanas { flex: none; display: flex; gap: 6px; }
.tor-pestana { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 13px;
  color: var(--ui-tinta-1, #c8c1ac); background: rgba(30,24,60,.55); border: 1px solid rgba(160,140,255,.3); border-bottom-color: rgba(160,140,255,.55); }
.tor-pestana em { font-style: normal; font-size: 11px; color: var(--ui-tinta-2, #8d8773); font-variant-numeric: tabular-nums; }
.tor-pestana:hover, .tor-pestana:focus-visible { color: #f1ecff; border-color: #c9bcff; outline: none; }
.tor-pestana--actual { color: #f1ecff; font-weight: 700; background: linear-gradient(180deg, rgba(90,72,170,.75), rgba(40,32,80,.85)); border-color: #a08cff; }
.tor-pestana--actual em { color: #c9bcff; }
.sitio-raiz[data-estilo="B"] .tor-pestana { border-radius: 3px 3px 0 0; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }

/* Encantar: los armeros, con el sello de su runa */
.tor-armero { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; min-width: 0;
  background: rgba(120,100,230,.06); border: 1px solid rgba(160,140,255,.28); }
.sitio-raiz[data-estilo="B"] .tor-armero { border-radius: 3px; }
.tor-armero__runa { flex: none; width: 18px; height: 18px; transform: rotate(45deg); border: 2px solid rgba(160,140,255,.35); background: rgba(0,0,0,.35); }
.tor-armero--filo { border-color: rgba(120,200,255,.6); }
.tor-armero--filo .tor-armero__runa { border-color: #7cc8ff; box-shadow: 0 0 9px rgba(124,200,255,.65); background: radial-gradient(circle, rgba(124,200,255,.55), rgba(0,0,0,.2)); }
.tor-armero--temple { border-color: rgba(255,170,90,.6); }
.tor-armero--temple .tor-armero__runa { border-color: #ffaa5a; box-shadow: 0 0 9px rgba(255,170,90,.6); background: radial-gradient(circle, rgba(255,170,90,.5), rgba(0,0,0,.2)); }
.tor-armero__lleva { font-style: normal; font-weight: 400; color: #c9bcff; }
.tor-boton--runa { padding: 5px 10px; }
.tor-boton--puesta:disabled { opacity: 1; cursor: default; color: #fff; border-color: #c9bcff; background: linear-gradient(180deg, rgba(110,90,200,.95), rgba(60,46,120,.95)); }
.tor-runas { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.4; color: var(--ui-tinta-0, #efe9d7); }
.tor-runas b { color: #f1ecff; }
.tor-linea { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ui-tinta-1, #c8c1ac); }
.tor-coste { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tor-coste__pieza { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: #e6e0ff;
  background: rgba(160,140,255,.12); border: 1px solid rgba(160,140,255,.35); }
.tor-coste__pieza--falta { color: #ffb4a6; border-color: rgba(220,120,100,.55); background: rgba(220,120,100,.1); }

/* Investigar: los saberes, con su estado */
.tor-saber { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; min-width: 0;
  background: rgba(120,100,230,.06); border: 1px solid rgba(160,140,255,.28); }
.sitio-raiz[data-estilo="B"] .tor-saber { border-radius: 3px; }
.tor-saber__sello { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: #c9bcff; border: 2px solid rgba(160,140,255,.5); background: rgba(0,0,0,.35); }
.tor-saber__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tor-saber__linea { font-size: 12px; color: #c9bcff; }
.tor-saber__coste { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tor-saber__coste small { font-size: 11.5px; color: var(--ui-tinta-2, #8d8773); }
.tor-saber--hecho { border-color: rgba(140,210,140,.55); }
.tor-saber--hecho .tor-saber__sello { color: #0b0a12; border-color: #9fe39f; background: radial-gradient(circle at 35% 35%, #e8ffe8, #8fd48f 60%, #3f7a3f); }
.tor-saber--hecho .tor-saber__linea { color: #b8eab8; }
.tor-saber--investigando { border-color: #a08cff; }
.tor-saber--cerrado { opacity: .62; border-style: dashed; }
.tor-barra { display: block; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.45); border: 1px solid rgba(160,140,255,.35); }
.tor-barra i { display: block; height: 100%; background: linear-gradient(90deg, #6d5ad8, #c9bcff); }

/* ---- pantallas bajas o estrechas: lo mismo, más apretado (sin scroll en 1366×768 y más) */
@media (max-height: 760px) {
  .tor-portada, .tor-cuerpo > .tor-portada { flex-basis: 24%; min-height: 100px; }
  .tor-portada__efecto { font-size: 15px; }
  .tor-atado, .tor-armero, .tor-saber { padding: 5px 9px; }
  .tor-pasos { font-size: 12px; gap: 2px; }
  .tor-pestana { padding: 4px 12px; }
}
@media (max-width: 900px) {
  .tor-columnas { grid-template-columns: 1fr; overflow-y: auto; }
}
