/* Champion Pool · Pizarra de Cristal.
   Los tokens viven en ../shared/pizarra.css.
   Aquí los cinco marcadores significan los cinco roles de LoL (top coral, jungla lima, mid cian, ADC amarillo, support violeta).
   Los tiers NO usan color: se leen por la letra y por el brillo de la tiza (Z/S confort = tiza plena, A/B = tenue, C/D = apagada).
   Herramienta de trabajo en PC: texto >= 13px, filetes visibles, sin sombras ni degradados. */

:root{
  --tier-hi: var(--pz-chalk);
  --tier-mid: var(--pz-chalk-faint);
  --tier-lo: var(--pz-line-strong);
  --side-blue: var(--pz-mid);
  --side-red: var(--pz-top);
}

html, body{ margin: 0; padding: 0; min-height: 100vh; }
button{ font-family: inherit; cursor: pointer; }
input[type=file]{ display: none; }

.ic{ width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- contenedor ---------- */
.app{ max-width: 1600px; margin: 0 auto; padding: 0 32px 72px; min-width: 0; }
main{ min-width: 0; }
@media (max-width: 700px){ .app{ padding: 0 16px 56px; } }

/* ---------- pantalla de carga ---------- */
#loading-screen{
  position: fixed; inset: 0; z-index: 1000; background: var(--pz-glass);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .28s ease;
}
#loading-screen.is-leaving{ opacity: 0; pointer-events: none; }
#loading-screen .loading-mark{ display: flex; align-items: center; gap: 14px; }
#loading-screen .loading-text{ font-size: 38px; font-weight: 800; font-stretch: 62%; letter-spacing: .03em; line-height: 1; }
#loading-screen .brand-strokes i{ width: 8px; height: 34px; animation: strokeUp .7s var(--pz-ease) both; transform-origin: bottom; }
#loading-screen .brand-strokes i:nth-child(2){ animation-delay: .08s; }
#loading-screen .brand-strokes i:nth-child(3){ animation-delay: .16s; }
#loading-screen .brand-strokes i:nth-child(4){ animation-delay: .24s; }
#loading-screen .brand-strokes i:nth-child(5){ animation-delay: .32s; }
@keyframes strokeUp{ from{ transform: scaleY(.15); opacity: .3; } to{ transform: scaleY(1); opacity: 1; } }

/* ---------- barra superior ---------- */
header.topbar{
  position: sticky; top: 0; z-index: 20;
  background: var(--pz-glass);
  border-bottom: 1px solid var(--pz-line-strong);
  padding: 14px 0 0; margin: 0 0 28px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
}
.topbar-row > *{ min-width: 0; }
.topbar-row{ display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar-row.row-nav{ align-items: flex-end; }

.brand{ display: flex; align-items: center; gap: 14px; }
.brand-strokes{ display: inline-flex; gap: 4px; align-items: flex-end; }
.brand-strokes i{ display: block; width: 6px; height: 24px; border-radius: 2px; }
.brand-strokes i:nth-child(1){ background: var(--pz-top); }
.brand-strokes i:nth-child(2){ background: var(--pz-jg); }
.brand-strokes i:nth-child(3){ background: var(--pz-mid); }
.brand-strokes i:nth-child(4){ background: var(--pz-adc); }
.brand-strokes i:nth-child(5){ background: var(--pz-sup); }
.brand h1{ margin: 0; font-size: 28px; font-weight: 700; font-stretch: 75%; letter-spacing: .005em; line-height: 1; white-space: nowrap; }

.header-right{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.user-chip{ color: var(--pz-chalk-dim); white-space: nowrap; }
.sync-indicator{ display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pz-chalk-dim); white-space: nowrap; }
.sync-indicator::before{ content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pz-chalk-faint); }
.sync-indicator[data-state="ok"]::before{ background: var(--pz-jg); }
.sync-indicator[data-state="syncing"]::before{ background: var(--pz-adc); }
.sync-indicator[data-state="off"]::before{ background: var(--pz-top); }
.hub-link{ text-decoration: none; }

.topbar-ctrl{ display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 10px; }
.team-bar{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.team-bar label{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); white-space: nowrap; }
.team-bar select{ max-width: 220px; }

/* ---------- botones ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--pz-font); padding: 11px 16px; border-radius: var(--pz-radius);
  border: 1px solid var(--pz-line-strong); background: transparent; color: var(--pz-chalk);
  white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover{ background: var(--pz-glass-3); border-color: var(--pz-chalk-faint); }
.btn.primary{ background: var(--pz-chalk); border-color: var(--pz-chalk); color: var(--pz-glass); }
.btn.primary:hover{ background: #fff; border-color: #fff; }
.btn.danger{ color: var(--pz-danger); border-color: #6a3a30; }
.btn.danger:hover{ background: rgba(255,122,89,.1); border-color: var(--pz-danger); }
.btn.small{ padding: 9px 13px; font-size: 13px; }
.btn:disabled{ opacity: .45; cursor: not-allowed; }
.btn[hidden]{ display: none !important; }

/* ---------- campos ---------- */
select{
  background-color: var(--pz-glass); color: var(--pz-chalk);
  border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius);
  padding: 9px 32px 9px 12px; font: 400 14px/1.3 var(--pz-font);
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a3aab1' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer; transition: border-color .15s; color-scheme: dark;
}
select:hover{ border-color: var(--pz-chalk-faint); }
select:focus-visible{ outline: 2px solid var(--pz-focus); outline-offset: 1px; border-color: var(--pz-focus); }
select:disabled{ opacity: .5; cursor: not-allowed; }
select option{ background: var(--pz-glass-2); color: var(--pz-chalk); }
select optgroup{ background: var(--pz-glass); color: var(--pz-chalk-dim); font-style: normal; font-weight: 700; }
select[hidden]{ display: none !important; }

.champ-search, .comp-notes{
  width: 100%; font: 400 14px/1.4 var(--pz-font); color: var(--pz-chalk);
  background: var(--pz-glass); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius);
  padding: 10px 12px; transition: border-color .15s;
}
.champ-search::placeholder, .comp-notes::placeholder{ color: var(--pz-chalk-faint); }
.champ-search:hover, .comp-notes:hover{ border-color: var(--pz-chalk-faint); }
.champ-search:focus-visible, .comp-notes:focus-visible{ outline: 2px solid var(--pz-focus); outline-offset: 1px; border-color: var(--pz-focus); }

/* ---------- pestañas: el trazo de rotulador marca la activa ---------- */
nav.tabs{ display: flex; gap: 2px; flex-wrap: wrap; }
button.tab-btn{
  position: relative; background: none; border: none; border-radius: var(--pz-radius) var(--pz-radius) 0 0;
  color: var(--pz-chalk-dim); font: 600 15px/1 var(--pz-font);
  padding: 12px 16px 16px; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
button.tab-btn:hover{ color: var(--pz-chalk); background: var(--pz-glass-2); }
button.tab-btn.active{ color: var(--pz-chalk); font-weight: 700; }
button.tab-btn::after{
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 8px;
  background: var(--pz-adc);
  -webkit-mask: var(--pz-stroke-mask) 0 0 / 100% 100% no-repeat; mask: var(--pz-stroke-mask) 0 0 / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path .45s var(--pz-ease);
}
button.tab-btn.active::after{ clip-path: inset(0 0 0 0); }
button.tab-btn:focus-visible{ outline-offset: -2px; }

/* ---------- secciones ---------- */
.section{ display: none; }
.section.active{ display: block; }
.section > h2{
  font-size: 32px; font-weight: 700; font-stretch: 75%; line-height: 1.1; letter-spacing: .005em;
  margin: 0 0 8px; width: fit-content; text-wrap: balance;
}
/* un título sin texto de apoyo necesita aire antes de su contenido */
.section > h2 + :not(.hint){ margin-top: 18px; }
.section > .hint{ color: var(--pz-chalk-dim); font-size: 14px; line-height: 1.5; max-width: 80ch; margin: 0 0 20px; }
.subsection-title{
  font-size: 22px; font-weight: 700; font-stretch: 75%; line-height: 1.1; letter-spacing: .005em;
  margin: 40px 0 14px;
}
.empty-hint{ color: var(--pz-chalk-dim); font-size: 14px; padding: 22px 4px; grid-column: 1 / -1; }
.panel{ background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); }

/* barra de controles de cada pestaña */
.tl-controls{ display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.tl-controls label{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); }
.tl-controls .note{ font-size: 13px; color: var(--pz-chalk-dim); }
.field-inline{ display: inline-flex; align-items: center; gap: 8px; }
.field-inline[hidden]{ display: none !important; }

/* ---------- iconos de campeón ---------- */
.champ-icon{
  width: 48px; height: 48px; border-radius: 6px; cursor: grab; position: relative;
  border: 1px solid var(--pz-line-strong); overflow: hidden;
  transition: border-color .15s; user-select: none; -webkit-user-select: none; touch-action: none;
}
/* pointer-events:none deja todos los eventos en el div (el arrastre por puntero escucha ahí, no en la <img>). */
.champ-icon img{ width: 100%; height: 100%; display: block; pointer-events: none; }
.champ-icon:hover{ border-color: var(--pz-chalk); z-index: 2; }
.champ-icon.dragging{ opacity: .3; }
.champ-drag-ghost{
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 5000;
  border: 2px solid var(--pz-adc); border-radius: 6px; cursor: grabbing;
  transition: none !important; will-change: transform;
}

/* Tier de un campeón al elegirlo para una composición: letra en la esquina + brillo del borde. */
.tier-border-Z, .tier-border-S{ border-color: var(--tier-hi) !important; border-width: 2px; }
.tier-border-A, .tier-border-B{ border-color: var(--tier-mid) !important; border-width: 2px; }
.tier-border-C, .tier-border-D{ border-color: var(--tier-lo) !important; }
.champ-icon[data-tier]::after{
  content: attr(data-tier); position: absolute; right: 0; bottom: 0;
  font: 800 12px/1 var(--pz-font); padding: 3px 5px 3px 6px; border-top-left-radius: 5px;
  background: var(--pz-glass); color: var(--pz-chalk);
}
.pool-picker-legend{ display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--pz-chalk-dim); }
.pool-picker-legend span{ display: inline-flex; align-items: center; gap: 6px; }
.tier-swatch{ width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--pz-line-strong); display: inline-block; }
.tier-swatch.tier-border-Z, .tier-swatch.tier-border-S, .tier-swatch.tier-border-A, .tier-swatch.tier-border-B{ border-width: 2px; }

/* ---------- pestaña tier list ---------- */
.tierlist-layout{ display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.champ-gallery{ padding: 16px; position: sticky; top: 150px; }
.champ-gallery h3{ margin: 0 0 12px; font-size: 18px; font-weight: 700; font-stretch: 75%; }
.champ-gallery .champ-search{ margin-bottom: 12px; }
.champ-grid{
  display: grid; grid-template-columns: repeat(auto-fill, 48px); gap: 6px;
  max-height: calc(100vh - 340px); min-height: 110px; overflow-y: auto; padding: 6px;
  border: 1px dashed var(--pz-line-strong); border-radius: var(--pz-radius);
}
.champ-grid.dragover, .tier-row .tier-drop.dragover{ background: var(--pz-glass-3); border-color: var(--pz-adc); }

#tierRows{ border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); background: var(--pz-glass-2); overflow: hidden; }
.tier-row{ display: flex; align-items: stretch; border-bottom: 1px solid var(--pz-line); }
.tier-row:last-child{ border-bottom: 0; }
.tier-label{
  width: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--pz-glass-3); border-right: 1px solid var(--pz-line);
  font-size: 38px; font-weight: 800; font-stretch: 75%; line-height: 1;
}
.tier-Z .tier-label, .tier-S .tier-label{ color: var(--pz-chalk); }
.tier-A .tier-label, .tier-B .tier-label{ color: var(--pz-chalk-dim); }
.tier-C .tier-label, .tier-D .tier-label{ color: var(--pz-chalk-faint); }
.tier-drop{
  flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; min-height: 70px; align-content: flex-start;
  border: 1px solid transparent; border-radius: 0;
}
.tier-drop .champ-icon.insert-before{ box-shadow: -3px 0 0 var(--pz-adc); }
.tier-drop .champ-icon.insert-after{ box-shadow: 3px 0 0 var(--pz-adc); }

/* ---------- pestaña estrategias: una composición por fila ---------- */
.comp-grid{ background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); overflow: hidden; }
.comp-grid:empty{ display: none; }
.comp-card{
  display: grid; gap: 14px 32px; padding: 22px 24px; align-items: start;
  grid-template-columns: minmax(220px, 1fr) auto minmax(240px, 320px);
  grid-template-areas: "head slots arch" "notes notes actions";
  border-bottom: 1px solid var(--pz-line);
}
.comp-card:last-child{ border-bottom: 0; }
.comp-head{ grid-area: head; display: grid; gap: 10px; align-content: start; }
.comp-slots{ grid-area: slots; display: flex; gap: 10px; }
.comp-card .archetype-widget{ grid-area: arch; margin: 0; }
.comp-notes{ grid-area: notes; min-height: 56px; resize: vertical; }
.comp-card-actions{ grid-area: actions; display: flex; justify-content: flex-end; align-items: flex-start; }
input.comp-name{
  background: transparent; border: none; border-bottom: 1px solid var(--pz-line-strong); border-radius: 0;
  color: var(--pz-chalk); font: 700 26px/1.1 var(--pz-font); font-stretch: 75%; letter-spacing: .005em;
  width: 100%; padding: 2px 0 8px; transition: border-color .15s;
}
input.comp-name:hover{ border-bottom-color: var(--pz-chalk-faint); }
input.comp-name:focus-visible{ outline: none; border-bottom-color: var(--pz-adc); box-shadow: 0 1px 0 var(--pz-adc); }
select.comp-type{ width: fit-content; }

.comp-slot{ width: 64px; text-align: center; }
.comp-slot .slot-icon{
  width: 64px; height: 64px; border-radius: 8px; border: 1px dashed var(--pz-chalk-faint);
  background: var(--pz-glass); display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; color: var(--pz-chalk-dim); font-size: 22px; font-weight: 300;
  transition: border-color .15s, background-color .15s;
}
.comp-slot .slot-icon:hover{ border-color: var(--pz-chalk); background: var(--pz-glass-3); }
.comp-slot .slot-icon:has(img){ border-style: solid; border-color: var(--pz-line-strong); }
.comp-slot .slot-icon img{ width: 100%; height: 100%; display: block; }

/* Roles: el marcador de cada rol más su nombre. */
.role-mark{ display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.role-mark::before{ content: ""; width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; background: var(--role-c, var(--pz-chalk-faint)); }
[data-role="top"]{ --role-c: var(--pz-top); }
[data-role="jungle"]{ --role-c: var(--pz-jg); }
[data-role="mid"]{ --role-c: var(--pz-mid); }
[data-role="adc"]{ --role-c: var(--pz-adc); }
[data-role="support"]{ --role-c: var(--pz-sup); }
.slot-role{ font-size: 13px; color: var(--pz-chalk-dim); margin-top: 8px; justify-content: center; }

/* selector de pool (modal) */
.pool-picker-overlay{
  display: none; position: fixed; inset: 0; background: rgba(13,15,18,.82); z-index: 900;
  align-items: center; justify-content: center; padding: 16px;
}
.pool-picker-overlay.open{ display: flex; }
.pool-picker-box{
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg);
  width: min(620px, 100%); max-height: 84vh; overflow-y: auto; padding: 24px;
}
.pool-picker-box h3{ margin: 0 0 14px; font-size: 24px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.pool-picker-box select{ margin-bottom: 14px; }
.pool-picker-grid{ display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 8px; }
.pool-picker-grid .champ-icon{ width: 52px; height: 52px; cursor: pointer; }
.modal-actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--pz-line); }

/* ---------- diagnóstico de daño y arquetipo ---------- */
.archetype-widget{ border: 1px solid var(--pz-line); border-radius: var(--pz-radius); background: var(--pz-glass); padding: 12px 14px; }
.archetype-widget .arch-title{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); margin-bottom: 8px; }
.dmg-bar-track{ width: 100%; height: 10px; border-radius: 3px; overflow: hidden; display: flex; gap: 2px; background: var(--pz-line); margin-bottom: 6px; }
.dmg-bar-ad{ background: var(--pz-top); height: 100%; }
.dmg-bar-ap{ background: var(--pz-mid); height: 100%; }
.dmg-bar-labels{ display: flex; justify-content: space-between; font-size: 13px; color: var(--pz-chalk); margin-bottom: 10px; }
.archetype-tag{
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--pz-chalk);
  border: 1px solid var(--pz-line-strong); border-radius: 6px; padding: 4px 10px;
}
.archetype-warning{
  margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--pz-chalk-dim);
  display: flex; gap: 8px; align-items: flex-start;
}
.archetype-warning::before{ content: ""; width: 9px; height: 9px; border-radius: 2px; margin-top: 5px; flex-shrink: 0; background: var(--pz-adc); }
.archetype-empty{ color: var(--pz-chalk-dim); font-size: 13px; }

/* ---------- simulador de draft ---------- */
.draft-wrapper{ display: flex; flex-direction: column; gap: 16px; }
.draft-status-bar{ display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px; }
.turn-indicator{ display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; font-stretch: 75%; letter-spacing: .005em; }
.turn-indicator::before{ content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--turn-c, var(--pz-chalk-faint)); flex-shrink: 0; }
.turn-blue{ --turn-c: var(--side-blue); }
.turn-red{ --turn-c: var(--side-red); }
.turn-done{ --turn-c: var(--pz-jg); }

.draft-boards{ display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.side-board, .draft-champ-select{ background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); padding: 18px; }
.side-board h3{
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 700; font-stretch: 75%; line-height: 1.1;
}
.side-board h3::before{ content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--side-blue); }
.side-board.red h3::before{ background: var(--side-red); }
.draft-bans{ display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.draft-ban-slot{
  width: 40px; height: 40px; border-radius: 6px; background: var(--pz-glass);
  border: 1px solid var(--pz-line-strong); overflow: hidden; position: relative;
}
.draft-ban-slot img{ width: 100%; height: 100%; display: block; filter: grayscale(1); opacity: .75; }
.draft-ban-slot:has(img)::after{ content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: 2px; background: var(--pz-top); transform: rotate(-45deg); }
.draft-picks{ display: flex; flex-direction: column; gap: 6px; }
.draft-pick-slot{
  display: flex; align-items: center; gap: 12px; background: var(--pz-glass); border-radius: var(--pz-radius);
  padding: 6px 10px 6px 6px; border: 1px solid var(--pz-line); min-height: 54px;
}
.draft-pick-slot.active-slot{ border-color: var(--pz-adc); background: var(--pz-glass-3); }
.draft-pick-slot .pick-icon{
  width: 42px; height: 42px; border-radius: 6px; overflow: hidden; background: var(--pz-glass-3);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--pz-chalk-faint);
}
.draft-pick-slot .pick-icon img{ width: 100%; height: 100%; display: block; }
.draft-pick-slot .pick-role{ font-size: 13px; color: var(--pz-chalk-dim); }
.draft-pick-slot .pick-name{ font-size: 15px; color: var(--pz-chalk); font-weight: 600; }
.draft-champ-select h3{ margin: 0 0 12px; font-size: 22px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.draft-champ-select .champ-search{ margin-bottom: 12px; }
.draft-champ-grid{ display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 6px; max-height: 480px; overflow-y: auto; padding: 2px; }
.draft-champ-grid .champ-icon{ width: 52px; height: 52px; cursor: pointer; }
.draft-champ-grid .champ-icon.used{ opacity: .2; pointer-events: none; filter: grayscale(1); }

/* ---------- cobertura de pool ---------- */

.analysis-wrap{ overflow-x: auto; }
table.analysis-table{
  width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0;
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg);
}
table.analysis-table th{ color: var(--pz-chalk-faint); font-size: 13px; font-weight: 600; padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--pz-line-strong); }
table.analysis-table td{ padding: 14px 18px; border-bottom: 1px solid var(--pz-line); font-size: 14px; vertical-align: middle; }
table.analysis-table tr:last-child td{ border-bottom: 0; }
.sub-tag{ margin-left: 8px; font-size: 13px; color: var(--pz-chalk-faint); font-weight: 400; }
.mini-champ-row{ display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.mini-champ{ width: 32px; height: 32px; border-radius: 4px; overflow: hidden; border: 1px solid var(--pz-line-strong); }
.mini-champ img{ width: 100%; height: 100%; display: block; }
.no-comfort{ color: var(--pz-chalk-faint); font-size: 13px; }
.count-badge{ min-width: 24px; margin-right: 6px; font-size: 15px; font-weight: 700; color: var(--pz-chalk); text-align: center; }
.badge{ display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--pz-chalk); }
.badge::before{ content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--badge-c, var(--pz-chalk-faint)); }
.badge.ok{ --badge-c: var(--pz-jg); }
.badge.warn{ --badge-c: var(--pz-adc); }
.badge.crit{ --badge-c: var(--pz-top); }

.flexpick-grid{ display: flex; flex-wrap: wrap; gap: 1px; background: var(--pz-line); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); overflow: hidden; }
.flexpick-card{ background: var(--pz-glass-2); padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex: 1 1 230px; }
.flexpick-card .fp-icon{ width: 44px; height: 44px; border-radius: 6px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--pz-line-strong); }
.flexpick-card .fp-icon img{ width: 100%; height: 100%; display: block; }
.flexpick-card .fp-name{ font-size: 15px; color: var(--pz-chalk); font-weight: 700; }
.flexpick-card .fp-roles{ font-size: 13px; color: var(--pz-chalk-dim); margin-top: 2px; }

/* ---------- cheatsheet ---------- */
/* Flex en vez de grid: la última fila se estira y no deja celdas vacías pintadas con el color del filete. */
.cheatsheet-grid, .cheatsheet-comps{
  display: flex; flex-wrap: wrap; gap: 1px;
  background: var(--pz-line); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); overflow: hidden;
}
.cheatsheet-grid:empty, .cheatsheet-comps:empty{ display: none; }
.cheatsheet-comps:has(> .empty-hint){ display: block; background: var(--pz-glass-2); }
.player-card, .cs-comp-card{ background: var(--pz-glass-2); padding: 18px 20px; flex: 1 1 260px; }
.player-card .pc-role{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); }
.player-card .pc-name{ font-size: 26px; font-weight: 700; font-stretch: 75%; line-height: 1.1; margin: 6px 0 14px; }
.pc-top3{ display: flex; gap: 10px; }
.pc-champ{ width: 60px; text-align: center; }
.pc-champ .pc-champ-icon{ width: 60px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid var(--pz-chalk); }
.pc-champ .pc-champ-icon img{ width: 100%; height: 100%; display: block; }
.pc-champ .pc-champ-name{ font-size: 13px; color: var(--pz-chalk-dim); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-comp-card .cs-comp-name{ font-size: 22px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.cs-comp-card .cs-comp-type{ font-size: 13px; color: var(--pz-chalk-dim); margin: 4px 0 12px; }
.cs-comp-slots{ display: flex; gap: 6px; }
.cs-comp-slots .mini-champ{ width: 40px; height: 40px; }
.cs-comp-card .archetype-tag{ margin-top: 12px; }

/* ---------- tier list: separador de exportar / importar ---------- */
.tl-sep{ width: 1px; align-self: stretch; min-height: 28px; background: var(--pz-line-strong); margin: 0 4px; }

/* ---------- draft libre ---------- */
.turn-free{ --turn-c: var(--pz-chalk); }
.free-hint{ margin: 0; max-width: 90ch; color: var(--pz-chalk-dim); font-size: 14px; line-height: 1.5; }
.free-hint[hidden]{ display: none; }
.free-slot{ transition: border-color .15s, background-color .15s; }
.free-slot:not(.filled){ border-style: dashed; border-color: var(--pz-chalk-faint); }
.free-slot.filled{ cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.free-slot.drop-hover{ border-style: solid; border-color: var(--pz-adc); background: var(--pz-glass-3); }
.free-mode .draft-champ-grid .champ-icon{ cursor: grab; }
.draft-champ-grid .champ-icon.armed{ border-color: var(--pz-adc); border-width: 2px; }
.draft-champ-select{ transition: border-color .15s; }
.draft-champ-select.drop-remove{ border-color: var(--pz-adc); border-style: dashed; }

/* ---------- selector general de campeones ---------- */
.champ-picker-grid{ max-height: min(52vh, 440px); overflow-y: auto; padding: 2px; align-content: start; }
.champ-picker-grid .champ-icon{ cursor: pointer; }
.champ-icon.picked{ border-color: var(--pz-chalk) !important; border-width: 2px; }
.champ-icon.picked::after{
  content: ""; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; border-top-left-radius: 5px;
  background: var(--pz-chalk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 3 5-6' fill='none' stroke='%230d0f12' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.champ-picker-grid .empty-hint{ grid-column: 1 / -1; }

/* ---------- prioridades de pick ---------- */
.seg{ display: inline-flex; border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius); overflow: hidden; }
.seg button{
  background: none; border: 0; border-right: 1px solid var(--pz-line-strong); color: var(--pz-chalk-dim);
  font: 600 13px/1 var(--pz-font); padding: 10px 16px; transition: color .15s, background-color .15s;
}
.seg button:last-child{ border-right: 0; }
.seg button:hover{ color: var(--pz-chalk); background: var(--pz-glass-3); }
.seg button[aria-pressed="true"]{ background: var(--pz-chalk); color: var(--pz-glass); }

.plan-list, .fearless-games, .fearless-pool{
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); overflow: hidden;
}
.plan-list:empty, .fearless-games:empty, .fearless-pool:empty{ display: none; }
.plan-group{
  display: flex; align-items: center; gap: 10px; padding: 11px 24px;
  background: var(--pz-glass-3); border-bottom: 1px solid var(--pz-line);
  font-size: 13px; font-weight: 700; color: var(--pz-chalk-dim);
}
.plan-group-count{ font-weight: 600; color: var(--pz-chalk-faint); }
.plan-card{
  display: grid; gap: 16px 24px; padding: 22px 24px; align-items: start;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  grid-template-areas: "pick meta actions" "pick lists lists" "notes notes notes";
  border-bottom: 1px solid var(--pz-line);
}
.plan-card:last-child{ border-bottom: 0; }
.plan-pick{ grid-area: pick; width: 88px; text-align: center; }
.plan-icon{
  width: 88px; height: 88px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 1px dashed var(--pz-chalk-faint); background: var(--pz-glass); color: var(--pz-chalk-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.plan-icon .ic{ width: 24px; height: 24px; }
.plan-icon:hover{ border-color: var(--pz-chalk); background: var(--pz-glass-3); }
.plan-icon:has(img){ border-style: solid; border-color: var(--pz-line-strong); }
.plan-icon img{ width: 100%; height: 100%; display: block; }
.plan-champ-name{ margin-top: 8px; font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.plan-pick .slot-role{ margin-top: 4px; }
.plan-meta{ grid-area: meta; display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.plan-actions{ grid-area: actions; display: flex; justify-content: flex-end; }
.plan-lists{ grid-area: lists; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.plan-notes{ grid-area: notes; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.plan-notes .comp-notes{ grid-area: auto; min-height: 88px; }
.plan-field{ display: grid; gap: 6px; min-width: 0; }
.plan-field > span, .plan-label{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); }
.plan-label{ margin-bottom: 6px; }
.plan-field-list{ min-width: 0; }
.plan-subtitle{ margin: 28px 0 12px; font-size: 18px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }

.chip-row{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip{
  display: inline-flex; align-items: center; gap: 6px; padding: 3px;
  border: 1px solid var(--pz-line-strong); border-radius: 6px; background: var(--pz-glass);
  font-size: 13px; font-weight: 600; max-width: 100%;
}
.chip img{ width: 26px; height: 26px; border-radius: 4px; display: block; }
.chip-name{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.burned{ opacity: .55; }
.chip.burned .chip-name{ text-decoration: line-through; }
.chip-remove{
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0; flex-shrink: 0;
  background: none; border: 0; border-radius: 4px; color: var(--pz-chalk-dim); transition: color .15s, background-color .15s;
}
.chip-remove:hover{ color: var(--pz-chalk); background: var(--pz-glass-3); }
.chip-add{ padding: 6px 10px; }

/* ---------- serie fearless ---------- */
.fl-game{
  display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px;
  padding: 18px 24px; align-items: start; border-bottom: 1px solid var(--pz-line);
}
.fl-game:last-child{ border-bottom: 0; }
.fl-game-name{ font-size: 20px; font-weight: 700; font-stretch: 75%; line-height: 1.2; padding-top: 2px; }
.fl-row{
  display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) auto; gap: 10px 24px;
  padding: 14px 24px; align-items: center; border-bottom: 1px solid var(--pz-line); font-size: 14px;
}
.fl-row:last-child{ border-bottom: 0; }
.fl-status{ display: flex; align-items: center; gap: 14px; justify-content: flex-end; min-width: 170px; }
.fl-left{ font-size: 13px; color: var(--pz-chalk-dim); white-space: nowrap; }
.mini-champ.burned{ position: relative; opacity: .4; }
.mini-champ.burned img{ filter: grayscale(1); }
.mini-champ.burned::after{ content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: 2px; background: var(--pz-top); transform: rotate(-45deg); }

/* ---------- pie, aviso ---------- */
.toast{
  position: fixed; bottom: 24px; right: 24px; max-width: min(420px, calc(100vw - 32px));
  background: var(--pz-glass-3); border: 1px solid var(--pz-line-strong); color: var(--pz-chalk);
  padding: 12px 18px; border-radius: var(--pz-radius); font-size: 14px; z-index: 3000;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .25s var(--pz-ease);
}
.toast.show{ opacity: 1; transform: translateY(0); }

/* ---------- pantallas medianas y móvil ---------- */
@media (max-width: 1180px){
  .comp-card{ grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head head" "slots slots" "arch arch" "notes notes" "actions actions"; }
  .comp-card-actions{ justify-content: flex-start; }
  .draft-boards{ grid-template-columns: 1fr 1fr; }
  .draft-champ-select{ grid-column: 1 / -1; order: -1; }
  .plan-card{ grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "pick meta" "pick actions" "lists lists" "notes notes"; }
  .plan-actions{ justify-content: flex-start; }
  .plan-lists{ grid-template-columns: minmax(0, 1fr); }
  .fl-game{ grid-template-columns: minmax(0, 1fr); }
  .fl-row{ grid-template-columns: minmax(0, 1fr) auto; }
  .fl-row .mini-champ-row{ grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 900px){
  .tierlist-layout{ grid-template-columns: minmax(0, 1fr); }
  .champ-gallery{ position: static; }
  .champ-grid{ max-height: 260px; }
}
@media (max-width: 700px){
  .brand h1{ font-size: 24px; }
  header.topbar{ margin-bottom: 20px; }
  nav.tabs{ overflow-x: auto; flex-wrap: nowrap; width: 100%; scrollbar-width: none; }
  nav.tabs::-webkit-scrollbar{ display: none; }
  .header-right{ gap: 8px; }
  .team-bar select{ flex: 1 1 130px; max-width: none; min-width: 0; }
  .topbar-ctrl{ gap: 10px; width: 100%; }
  .team-bar{ width: 100%; flex-wrap: nowrap; }
  .team-bar .btn{ flex-shrink: 0; }
  .hub-link, .header-right .btn{ min-height: 40px; }
  .section > h2{ font-size: 26px; }
  .tier-label{ width: 56px; font-size: 30px; }
  .draft-boards{ grid-template-columns: minmax(0, 1fr); }
  .comp-card{ padding: 18px 16px; }
  .comp-slots{ flex-wrap: wrap; }
  .tl-sep{ display: none; }
  .plan-card{ padding: 18px 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "pick" "meta" "lists" "notes" "actions"; }
  .plan-pick{ width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; flex-wrap: wrap; }
  .plan-pick .slot-role{ margin-top: 0; }
  .plan-notes{ grid-template-columns: minmax(0, 1fr); }
  .plan-group{ padding: 11px 16px; }
  .fl-game, .fl-row{ padding-left: 16px; padding-right: 16px; }
  .plan-field select{ width: 100%; }
  .plan-meta .plan-field{ flex: 1 1 140px; }
  .seg button, .chip-add{ min-height: 44px; }
  .chip-remove{ width: 36px; height: 36px; }
  .chip img{ width: 32px; height: 32px; }
  .btn, select, button.tab-btn{ min-height: 44px; }
  .champ-icon{ width: 44px; height: 44px; }
  .champ-grid{ grid-template-columns: repeat(auto-fill, 44px); }
  .toast{ left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
