:root {
  --bg: #080b10;
  --surf: #0d1117;
  --surf2: #131920;
  --brd: rgba(255, 255, 255, .06);
  --txt: #e8eaf0;
  --mut: #5a6070;
  --dim: #3a4050;
  --s: #e53935;
  --sh: rgba(229, 57, 53, .55);
  --a: #00e5ff;
  --gold: #ffd700;
  --goldg: rgba(255, 215, 0, .55);
  --c1: #888;
  --c2: #4caf50;
  --c3: #2196f3;
  --c4: #9c27b0;
  --c5: #ffd700;
  --tS: #e53935;
  --tA: #ff9800;
  --tB: #4caf50;
  --tC: #607d8b;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: .4;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* ================================================================
   1. ESTRUCTURA GLOBAL (NAV, ADS, ROOT)
   ================================================================ */
.ad-top {
  width: 100%;
  background: var(--surf);
  border-bottom: 1px solid var(--brd);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  position: relative;
  z-index: 10;
}

.ad-top-in {
  width: 728px;
  height: 90px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .005));
  border: 1px dashed rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 16, .95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--brd);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
}

.logo {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--s);
  text-shadow: 0 0 20px var(--sh);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 40px;
}

.nav-tabs {
  display: flex;
  height: 60px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: var(--mut);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--txt);
  border-bottom-color: rgba(255, 255, 255, .15);
}

.nav-tab.on {
  color: var(--a);
  border-bottom-color: var(--a);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.patch {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--mut);
}

/* LAYOUT ROOT */
.builder-root {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px;
}

.builder-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.comp-name-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.comp-name-wrap .cni {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 13px;
}

.comp-name-wrap input {
  width: 100%;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 4px;
  color: var(--txt);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 9px 16px 9px 34px;
  outline: none;
  transition: border-color .2s;
}

.comp-name-wrap input:focus {
  border-color: rgba(0, 229, 255, .4);
}

.comp-name-wrap input::placeholder {
  color: var(--dim);
}

.topbar-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ================================================================
   2. BOTONES Y ACCIONES
   ================================================================ */
.btn-sec, .btn-pri {
  position: relative;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .18s;
  border: 1px solid;
  white-space: nowrap;
}

.btn-sec {
  background: var(--surf);
  border-color: var(--brd);
  color: var(--mut);
}

.btn-sec:hover {
  background: var(--surf2);
  color: var(--txt);
  border-color: rgba(255, 255, 255, .15);
}

.btn-pri {
  background: rgba(0, 229, 255, .08);
  border-color: var(--a);
  color: var(--a);
}

.btn-pri:hover {
  background: rgba(0, 229, 255, .15);
}

.btn-pri.accent {
  background: rgba(255, 215, 0, .08);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-pri.accent:hover {
  background: rgba(255, 215, 0, .18);
}

.btn-pri.game {
  background: rgba(76, 175, 80, .08);
  border-color: #4caf50;
  color: #4caf50;
}

.btn-pri.game:hover {
  background: rgba(76, 175, 80, .18);
}

.btn-pri:disabled {
  opacity: .5;
  cursor: wait;
}

.copy-ok {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2332;
  border: 1px solid var(--brd);
  color: var(--a);
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.btn-pri.copied .copy-ok {
  opacity: 1;
}

/* ================================================================
   3. COLUMNA DE RASGOS (IZQUIERDA)
   ================================================================ */
   
.builder-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.traits-col {
  width: 170px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}

.traits-header {
  margin-bottom: 10px;
}

.traits-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
  display: block;
}

.traits-hint {
  font-size: 10px;
  color: var(--dim);
  display: block;
}

.traits-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.traits-empty {
  font-size: 11px;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  line-height: 1.5;
}

.trait-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid var(--brd);
  background: var(--surf);
  transition: all .15s;
}

.trait-row.active {
  border-color: rgba(0, 229, 255, .3);
  background: rgba(0, 229, 255, .05);
}

.trait-row.active-gold {
  border-color: rgba(255, 215, 0, .35);
  background: rgba(255, 215, 0, .06);
}

.trait-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trait-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trait-name {
  flex: 1;
  font-size: 11px;
  color: var(--mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trait-row.active .trait-name {
  color: var(--txt);
}

.trait-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surf2);
  color: var(--dim);
  flex-shrink: 0;
}

.trait-row.active .trait-count {
  background: rgba(0, 229, 255, .12);
  color: var(--a);
}

.trait-row.active-gold .trait-count {
  background: rgba(255, 215, 0, .12);
  color: var(--gold);
}

/* ================================================================
   4. COLUMNA CENTRAL: CABECERA Y CURSOR
   ================================================================ */
.board-col {
  flex: 1;
  min-width: 0;
}

.board-label {
  margin-bottom: 10px;
}

.bl-title {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
}

.bl-hint {
  font-size: 11px;
  color: var(--dim);
  display: block;
  margin-top: 2px;
}

.item-cursor {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 215, 0, .1);
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 10px;
  animation: ic-pop .15s ease;
}

@keyframes ic-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.item-cursor.active {
  display: flex;
}

.ic-img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--surf2);
  border: 1px solid rgba(255, 215, 0, .3);
}

.ic-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.ic-hint {
  font-size: 10px;
  color: rgba(255, 215, 0, .6);
  font-family: 'Space Mono', monospace;
}

/* ================================================================
   5. TABLERO HEXAGONAL (CLIP-PATH)
   ================================================================ */
.hex-board {
  display: flex;
  flex-direction: column;
  user-select: none;
  overflow: visible;
}

.hex-row-wrap {
  overflow: visible;
  margin-bottom: 24px;
}

.hex-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: -14px;
  overflow: visible;
}

.hex-row.offset {
  margin-left: 37px;
}

.hex-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 3px;
  overflow: visible;
  position: relative;
}

.hex-cell {
  width: 68px;
  height: 78px;
  position: relative;
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: filter .15s, transform .15s;
  cursor: crosshair;
  overflow: hidden;
}

.hex-cell.empty { background: rgba(255, 255, 255, .08); }
.hex-cell.empty:hover { background: rgba(0, 229, 255, .18); }

.hex-cell.can-receive { background: rgba(255, 215, 0, .18) !important; }
.hex-cell.can-receive:hover { background: rgba(255, 215, 0, .28) !important; }

.hex-wrap.drag-over .hex-cell {
  background: rgba(0, 229, 255, .3) !important;
  filter: brightness(1.5) !important;
  transform: scale(1.06);
}

/* Colores de costo */
.hex-cell.c1 { background: linear-gradient(150deg, #3a3a3a, #1a1a1a); }
.hex-cell.c2 { background: linear-gradient(150deg, #1e5230, #0d2e1a); }
.hex-cell.c3 { background: linear-gradient(150deg, #0e3068, #071a3e); }
.hex-cell.c4 { background: linear-gradient(150deg, #4a0e70, #280640); }
.hex-cell.c5 { background: linear-gradient(150deg, #6e5000, #3e2d00); }
.hex-cell.c7 { background: linear-gradient(150deg, #8B0000, #4a0000); }

.hex-cell:not(.empty):hover {
  filter: brightness(1.18);
  transform: scale(1.05);
  z-index: 5;
}

.hex-cell .hc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  z-index: 2;
  pointer-events: none;
}

.hex-cell .hc-ini {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
  z-index: 1;
  pointer-events: none;
}

.hex-cell .hc-name {
  position: absolute;
  bottom: 7px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
  z-index: 5;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}

.hex-cell:hover .hc-name {
  opacity: 1;
}

/* ================================================================
   6. ÍTEMS EN EL TABLERO Y EQUIPAMIENTO
   ================================================================ */
.hex-items {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  min-height: 20px;
  justify-content: center;
  pointer-events: all;
}

.hci {
  width: 21px;
  height: 21px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(8, 11, 16, .95);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color .15s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}

.hci img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

.hci:hover {
  border-color: var(--s);
}

.hci::after {
  content: '✕';
  position: absolute;
  inset: 0;
  background: rgba(229, 57, 53, .85);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 3;
}

.hci:hover::after {
  opacity: 1;
}

/* PANEL DE EQUIPAMIENTO */
.equip-panel {
  margin-top: 24px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 60px;
}

.equip-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.equip-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
}

.equip-hint {
  font-size: 10px;
  color: var(--dim);
}

.equip-empty {
  font-size: 11px;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
}

.equip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 8px 12px;
  animation: eq-in .2s ease;
}

@keyframes eq-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.equip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
}

.equip-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  z-index: 2;
}

.equip-avatar .ea-ini {
  position: relative;
  z-index: 1;
}

.equip-avatar.c1 { border-color: var(--c1); }
.equip-avatar.c2 { border-color: var(--c2); }
.equip-avatar.c3 { border-color: var(--c3); }
.equip-avatar.c4 { border-color: var(--c4); }
.equip-avatar.c5 { border-color: var(--c5); box-shadow: 0 0 8px var(--goldg); }
.equip-avatar.c7 { border-color: #e53935; box-shadow: 0 0 8px rgba(229, 57, 53, .5); }

.equip-champ-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--txt);
  min-width: 50px;
}

.equip-items {
  display: flex;
  gap: 6px;
  align-items: center;
}

.equip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.equip-item-box {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  border: 2px solid;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}

.equip-item-box:hover {
  transform: scale(1.1);
}

.equip-item-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

.equip-item-box .fbk {
  position: relative;
  z-index: 1;
  font-size: 14px;
}

.equip-item-box.tS { border-color: var(--tS); box-shadow: 0 0 10px rgba(229, 57, 53, .6); }
.equip-item-box.tA { border-color: var(--tA); box-shadow: 0 0 10px rgba(255, 152, 0, .55); }
.equip-item-box.tB { border-color: var(--tB); box-shadow: 0 0 8px rgba(76, 175, 80, .5); }
.equip-item-box.tC { border-color: var(--tC); }

.equip-item-box::after {
  content: '✕';
  position: absolute;
  inset: 0;
  background: rgba(229, 57, 53, .85);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 4;
}

.equip-item:hover .equip-item-box::after {
  opacity: 1;
}

.equip-item-name {
  font-size: 7px;
  color: var(--dim);
  text-align: center;
  max-width: 44px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   7. POOL DE CAMPEONES
   ================================================================ */
.pool-section {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
}

.pool-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.pool-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
}

.cost-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--dim);
}

.cl { font-size: 14px; }
.cl.c1 { color: var(--c1); }
.cl.c2 { color: var(--c2); }
.cl.c3 { color: var(--c3); }
.cl.c4 { color: var(--c4); }
.cl.c5 { color: var(--c5); }

.champ-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.pool-divider {
  width: 100%;
  height: 1px;
  background: var(--brd);
  margin: 4px 0;
}

.pool-champ {
  width: 46px;
  height: 52px;
  position: relative;
  cursor: grab;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: transform .15s, filter .15s;
  overflow: hidden;
}

.pool-champ.c1 { background: linear-gradient(150deg, #3a3a3a, #1a1a1a); }
.pool-champ.c2 { background: linear-gradient(150deg, #1e5230, #0d2e1a); }
.pool-champ.c3 { background: linear-gradient(150deg, #0e3068, #071a3e); }
.pool-champ.c4 { background: linear-gradient(150deg, #4a0e70, #280640); }
.pool-champ.c5 { background: linear-gradient(150deg, #6e5000, #3e2d00); }
.pool-champ.c7 { background: linear-gradient(150deg, #8B0000, #4a0000); }

.pool-champ img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  z-index: 2;
  pointer-events: none;
}

.pool-champ .pc-ini {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
  z-index: 1;
  pointer-events: none;
}

.pool-champ:hover {
  transform: scale(1.14);
  filter: brightness(1.22);
  z-index: 10;
}

.pool-champ:active {
  cursor: grabbing;
}

.pool-champ.placed {
  opacity: .3;
  filter: grayscale(.6);
}

/* ================================================================
   8. PANEL DE OBJETOS (DERECHA)
   ================================================================ */
.items-col {
  width: 205px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}

.items-header {
  margin-bottom: 10px;
}

.items-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
  display: block;
}

.items-hint {
  font-size: 10px;
  color: var(--dim);
  display: block;
}

.items-panel-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.item-tier-sep {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 6px 2px;
  margin-top: 6px;
}

.item-tier-sep.tS { color: var(--tS); }
.item-tier-sep.tA { color: var(--tA); }
.item-tier-sep.tB { color: var(--tB); }
.item-tier-sep.tC { color: var(--dim); }

.item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  background: var(--surf);
}

.item-row:hover {
  background: var(--surf2);
  border-color: var(--brd);
  transform: translateX(2px);
}

.item-row.item-selected {
  background: rgba(255, 215, 0, .08) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 8px rgba(255, 215, 0, .25);
  transform: translateX(3px);
}

.item-icon {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--surf2);
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

.item-icon .fbk {
  position: relative;
  z-index: 1;
  font-size: 14px;
}

.item-row-name {
  font-size: 12px;
  color: var(--mut);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row.item-selected .item-row-name {
  color: var(--gold);
}

/* ================================================================
   9. MODALES, FOOTER Y RESPONSIVE
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 28px;
  width: 440px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-desc {
  font-size: 13px;
  color: var(--mut);
}

.modal-input {
  width: 100%;
  height: 90px;
  background: var(--bg);
  border: 1px solid var(--brd);
  border-radius: 4px;
  color: var(--txt);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 10px;
  resize: none;
  outline: none;
  transition: border-color .2s;
}

.modal-input:focus {
  border-color: rgba(0, 229, 255, .4);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.import-error {
  font-size: 12px;
  color: var(--s);
  min-height: 16px;
}

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--brd);
  padding: 24px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  letter-spacing: .05em;
  margin-top: 40px;
}

footer a {
  color: var(--dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--mut);
}

/* --- MEDIA QUERIES --- */
@media(max-width: 1100px) {
  .traits-col { display: none; }
}

@media(max-width: 900px) {
  .builder-main { flex-direction: column-reverse; }
  .items-col { width: 100%; position: static; max-height: none; }
  .items-panel-list { flex-direction: row; flex-wrap: wrap; }
  .item-tier-sep { width: 100%; }
}

@media(max-width: 640px) {
  nav { padding: 0 12px; }
  .nav-tab { padding: 0 10px; font-size: 11px; }
  .builder-root { padding: 14px 10px; }
  .hex-cell { width: 52px; height: 60px; }
  .hex-row.offset { margin-left: 29px; }
}