/* TsBot War — estadísticas (war.tsbot.co/app/#/s/…): secciones «War» y «Exp» del diseño aprobado. Usa las variables y
   las piezas de app.css (tarjetas, botones, píldoras); aquí solo va lo propio de esta pantalla. Sin recursos remotos.
   Colores de las series: los del diseño (amigos turquesa, enemigos coral), comprobados para daltonismo sobre el fondo
   de las tarjetas; nunca van solos: cada serie lleva su nombre en la leyenda y en el recuadro de valores. */
.ws { --ws-fr: #1998ae; --ws-en: #ec5a3c; --ws-h: 220px; }
.ws-body { display: flex; flex-direction: column; gap: 24px; }

/* ── secciones, periodos y vista ── */
.ws-bar { display: flex; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.ws-secs { display: flex; }
.ws-secs a { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-bottom: 2px solid transparent; font-family: var(--display); font-size: 16px;
  font-weight: 600; color: var(--muted); }
.ws-secs a[aria-current="page"] { border-bottom-color: var(--coral); color: var(--strong); }
.ws-seg { display: inline-flex; margin-bottom: 8px; max-width: 100%; }
.ws-seg button { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: 13px; white-space: nowrap; }
.ws-seg button + button { border-left: 0; }
.ws-seg button:first-child { border-radius: 10px 0 0 10px; }
.ws-seg button:last-child { border-radius: 0 10px 10px 0; }
.ws-seg button[aria-pressed="true"] { background: var(--teal-deep); border-color: var(--teal-line); color: var(--cyan-soft); }
.ws-seg button[aria-pressed="true"] + button { border-left: 1px solid var(--teal-line); margin-left: -1px; }
.ws-seg button:hover:not(:disabled):not([aria-pressed="true"]) { color: var(--text); }
.ws-seg button:focus-visible { position: relative; z-index: 1; }
.ws-seg.pill { margin: 0; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); }
.ws-seg.pill button { height: 30px; border: 0; border-radius: 999px; background: none; font-weight: 500; }
.ws-seg.pill button[aria-pressed="true"] { background: var(--accent); color: #fff; margin-left: 0; border: 0; }
.ws-range { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--soft); }

/* ── cifras ── */
.ws-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ws-stat { padding: 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ws-num { font-family: var(--display); font-size: 42px; font-weight: 700; line-height: 1.12; color: var(--strong); overflow-wrap: anywhere; }
.ws-num.cy { color: var(--cyan-soft); }
.ws-num.co { color: var(--coral-soft); }
.ws-sub { font-size: 13px; color: var(--muted); }

/* ── tarjetas ── */
.ws-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-chead { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.ws-chead h2 { font-size: 20px; font-weight: 600; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--soft); }
.ws-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ws-sq { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--ws-fr); }
.ws-sq.en { background: var(--ws-en); }
.ws-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ws-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ── gráfica de series ── */
.ws-chart { display: flex; gap: 12px; }
.ws-yax { position: relative; flex: none; width: 34px; height: var(--ws-h); font-size: 11px; color: var(--muted-2); }
.ws-yax span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.ws-plotcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ws-plot { --bw: 14px; position: relative; display: flex; height: var(--ws-h); cursor: crosshair; touch-action: pan-y; border-radius: 4px; }
.ws-plot.few { --bw: 26px; }
.ws-plot.mid { --bw: 6px; }
.ws-plot.dense { --bw: 3px; }
.ws-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); pointer-events: none; }
.ws-grid.zero { background: var(--line-3); }
.ws-g { position: relative; flex: 1 1 0; height: 100%; min-width: 0; }
.ws-g.on { background: rgba(255, 255, 255, .045); }
/* un tramo sin datos se ve: rayado, no vacío ni a cero */
.ws-g.none { background: repeating-linear-gradient(135deg, rgba(125, 143, 158, .13) 0 4px, transparent 4px 9px); }
.ws-b { position: absolute; left: 50%; width: var(--bw); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--ws-fr); }
.ws-b.en { background: var(--ws-en); }
.ws-b.a { margin-left: calc(-1px - var(--bw)); }
.ws-b.b { margin-left: 1px; }
.ws-b.solo { margin-left: calc(var(--bw) / -2); }
.ws-b.neg { border-radius: 0 0 4px 4px; }
.ws-g.part .ws-b { opacity: .62; }
.ws-g.on .ws-b { filter: brightness(1.25); }
.ws-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ws-line { fill: none; stroke: var(--ws-fr); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ws-line.en { stroke: var(--ws-en); }
.ws-gap { fill: rgba(125, 143, 158, .09); }
.ws-stop { stop-color: var(--ws-fr); }
.ws-stop.en { stop-color: var(--ws-en); }
.ws-stop.a { stop-opacity: .32; }
.ws-stop.z { stop-opacity: 0; }
.ws-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); pointer-events: none; }
.ws-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ws-fr); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.ws-dot.en { background: var(--ws-en); }
.ws-tip { position: absolute; top: 12px; z-index: 3; transform: translateX(12px); pointer-events: none; padding: 10px 12px; border: 1px solid var(--line-3); border-radius: 10px;
  background: var(--bg-2); box-shadow: 0 14px 30px rgba(0, 0, 0, .5); font-size: 12.5px; line-height: 1.6; white-space: nowrap; }
.ws-tip.flip { transform: translateX(calc(-100% - 12px)); }
.ws-tiph { font-size: 11px; color: var(--muted-2); }
.ws-tipr { display: flex; align-items: center; gap: 8px; color: var(--soft); }
.ws-tipr .mono { margin-left: auto; padding-left: 10px; color: var(--strong); }
.ws-tipn { color: var(--muted); white-space: normal; max-width: 220px; }
.ws-xax { display: flex; font-size: 11px; color: var(--muted-2); }
.ws-xax span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; }

/* ── barras horizontales ── */
.ws-hbars { display: flex; flex-direction: column; gap: 14px; }
.ws-hrow { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.ws-three .ws-hrow { grid-template-columns: minmax(0, 124px) minmax(0, 1fr) auto; gap: 10px; }
.ws-hrow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-hrow .mono { min-width: 28px; text-align: right; color: var(--strong); font-size: 12px; }
.ws-hb { height: 14px; border-radius: 0 4px 4px 0; background: var(--ws-fr); }
.ws-hb.en { background: var(--ws-en); }
.ws-hrow:hover .ws-hb { filter: brightness(1.25); }

/* ── cuándo está online el enemigo ── */
.ws-ramp { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.ws-ramp i, .ws-cell { display: block; border-radius: 3px; }
.ws-ramp i { width: 10px; height: 10px; border-radius: 2px; }
.ws-ramp i.hx { margin-left: 10px; }
.h0 { background: #10222d; } .h1 { background: #12465a; } .h2 { background: #0f6c84; } .h3 { background: #1998ae; } .h4 { background: #6fd6e8; }
.hx { background: repeating-linear-gradient(135deg, rgba(125, 143, 158, .22) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--line-2); }
.ws-heat { display: flex; flex-direction: column; gap: 2px; }
.ws-hrw { display: grid; grid-template-columns: 44px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; font-size: 11px; color: var(--muted-2); }
.ws-hrw.ax { margin-top: 4px; font-size: 10.5px; }
.ws-hrw.ax span { text-align: center; }
.ws-cell { height: 22px; }
.ws-cell:hover { filter: brightness(1.25); }
.ws-hnote { font-size: 13px; color: var(--muted); }

/* ── tablas ── */
.ws-scroll { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* El mismo idioma de color que las gráficas: cabecera teñida con el punto del bando, lo nuestro en turquesa y lo suyo
   en coral, subidas en verde y bajadas en rojo (siempre con su signo o su cabecera: el color acompaña, no informa solo),
   filas alternas y resalte al pasar. Todo el texto, a 4,5:1 o más sobre el fondo más claro de la tarjeta. */
.ws-table thead th { padding: 8px; border-bottom: 1px solid var(--teal-line); background: rgba(0, 124, 153, .13); font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--soft); text-align: left; white-space: nowrap; }
.ws-table thead th:first-child { border-top-left-radius: 8px; }
.ws-table thead th:last-child { border-top-right-radius: 8px; }
.ws-table thead .ws-sq { margin-right: 7px; }
.ws-table tbody th, .ws-table td { padding: 8px; border-bottom: 1px solid var(--row-line); font-weight: 400; text-align: left; color: var(--text); }
.ws-table tr > :first-child { padding-left: 12px; }
.ws-table tr > :last-child { padding-right: 12px; }
.ws-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .024); }
.ws-table tbody tr:hover { background: rgba(34, 188, 214, .075); }
.ws-table .num { text-align: right; font-family: var(--mono); }
.ws-table td.num + td:not(.num), .ws-table th.num + th:not(.num) { padding-left: 24px; }
.ws-table .strong { color: var(--strong); }
.ws-table td small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); }
.ws-table .wa-tagl { color: var(--muted); }
.ws-table td.fr, .ws-table span.fr { color: var(--cyan-soft); }
.ws-table td.en, .ws-table span.en { color: var(--coral-soft); }
.ws-table td.up { color: var(--green); } .ws-table td.dn { color: var(--coral); }
.ws-table td.soft { color: var(--muted); }
/* sin dato: la raya, atenuada; la fila entera más callada y su motivo en ámbar */
.ws-table td.nil { color: var(--muted); }
.ws-table tr.none > th { color: var(--muted); }
.ws-table tfoot th, .ws-table tfoot td { padding: 10px 8px; border-top: 1px solid var(--teal-line); background: rgba(0, 124, 153, .09); font-weight: 600; text-align: left; color: var(--strong); }
.ws-table tfoot tr:last-child > :first-child { border-bottom-left-radius: 8px; }
.ws-table tfoot tr:last-child > :last-child { border-bottom-right-radius: 8px; }
.ws-table tfoot tr + tr > * { border-top-color: var(--row-line); }
.ws-tag { display: inline-flex; align-items: center; padding: 1px 9px; border: 1px solid var(--line-3); border-radius: 10px; font-family: var(--body); font-size: 11.5px;
  font-weight: 500; line-height: 1.55; color: var(--soft); }
.ws-tag.warn { color: var(--amber-soft); border-color: rgba(232, 184, 74, .5); background: rgba(232, 184, 74, .11); }
.ws-tag.live { color: var(--cyan-soft); border-color: var(--teal-line); background: var(--teal-deep); }
.ws-tag.note { padding: 0; border: 0; color: var(--amber-soft); }
.ws-tag.ok { padding: 0; border: 0; color: var(--muted); }
.ws-hsw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ws-gname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-gname .wa-nm { color: var(--strong); }
.ws-chars thead .num .wa-sort { justify-content: flex-end; width: 100%; }
.ws-chars .c-guild { color: var(--muted); }
.ws-chars .c-voc .wa-voc { display: inline-block; min-width: 30px; padding: 1px 4px; }
.ws-chars .c-deaths { color: var(--muted); }
.ws-table .s { display: none; }                              /* en el móvil, la cifra corta (+2.72 B) en vez de la entera */
.ws-table tbody th, .ws-table tfoot th { white-space: nowrap; }
.ws-more { display: flex; justify-content: center; }
.ws-more:empty { display: none; }
.ws-foot { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted-2); }
.ws-how summary { padding: 14px 20px; cursor: pointer; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--soft); }
.ws-how ul { margin: 0; padding: 0 20px 18px 40px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); max-width: 980px; }
.ws .wa-foot { padding: 0; border: 0; }

/* ── pantallas medianas y móvil ── */
@media (max-width: 1040px) {
  .ws-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-two, .ws-three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ws { --ws-h: 180px; }
  .ws-body { gap: 16px; }
  .ws-bar { border-bottom: 0; gap: 8px; }
  .ws-secs { width: 100%; border-bottom: 1px solid var(--line); }
  .ws-secs a { flex: 1; justify-content: center; }
  .ws-bar > .wa-grow { display: none; }
  .ws-seg { overflow-x: auto; scrollbar-width: none; margin-bottom: 0; }
  .ws-seg button { height: 40px; }
  .ws-seg.pill button { height: 34px; }
  .ws-stats { gap: 10px; }
  .ws-stat { padding: 14px; }
  .ws-num { font-size: 28px; }
  .ws-sub { font-size: 12px; }
  .ws-card { padding: 16px; gap: 14px; }
  .ws-chead h2 { font-size: 18px; }
  .ws-chead > .wa-grow { display: none; }
  .ws-chart { gap: 8px; }
  .ws-yax { width: 28px; font-size: 10px; }
  .ws-plot { --bw: 8px; }
  .ws-plot.few { --bw: 14px; }
  .ws-plot.mid { --bw: 3px; }
  .ws-plot.dense { --bw: 2px; }
  .ws-tip { max-width: 46%; white-space: normal; }
  .ws-tipr { flex-wrap: wrap; gap: 2px 8px; }
  .ws-xax { font-size: 10px; }
  .ws-hrow, .ws-three .ws-hrow { grid-template-columns: minmax(0, 118px) minmax(0, 1fr) auto; gap: 8px; }
  .ws-hrw { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; font-size: 10px; }
  .ws-hrw.ax span:not(:nth-child(3n + 2)) { visibility: hidden; }
  .ws-cell { height: 16px; border-radius: 2px; }
  .ws-ramp { width: 100%; }
  .ws-table { font-size: 13px; }
  .ws-table thead th, .ws-table tbody th, .ws-table td { padding-left: 4px; padding-right: 4px; }
  .ws-table tr > :first-child { padding-left: 8px; }
  .ws-table tr > :last-child { padding-right: 8px; }
  .ws-table thead th { letter-spacing: .04em; }
  .ws-table thead .ws-sq { margin-right: 5px; }
  .ws-gt { min-width: 500px; }                               /* cinco columnas: se desliza dentro de su tarjeta */
  .ws-chars { font-size: 12.5px; }
  .ws-chars .c-guild, .ws-chars .c-voc, .ws-chars .c-levels, .ws-table .f, .ws-table .opt { display: none; }
  .ws-table .s { display: inline; }
  .ws-table td.num + td:not(.num), .ws-table th.num + th:not(.num) { padding-left: 10px; }
  .ws-table .ws-tag { white-space: nowrap; padding-left: 6px; padding-right: 6px; font-size: 11px; }
  .ws-by .wa-search { width: 100%; height: 40px; }
  .ws-by .wa-search input { width: 100%; }
}
