/* endgame.zzzlatam.net — "Sala de Guerra"
   New Eridu: negro/amarillo, Anton + Archivo, hazard stripes, grano CRT, REC.
   Diseño editorial sobrio: jerarquía tipográfica fuerte, mucho aire (ma),
   acentos de peligro usados con mesura, datos en primer plano. */

:root {
  --bg: #0e0f0e;
  --panel: #16171a;
  --panel-2: #1b1c20;
  --line: #26272b;
  --ink: #f4f3ee;
  --ink-dim: #9a9a93;
  --ink-faint: #6b6b66;
  --zzz-yellow: #ffde17;
  --hazard: repeating-linear-gradient(-45deg, #ffde17 0 14px, #0e0f0e 14px 28px);
  --radius: 5px;

  /* elementos ZZZ */
  --el-physical: #f7c948;
  --el-fire: #ff5a3c;
  --el-ice: #79e0ff;
  --el-electric: #b79bff;
  --el-ether: #ff6fce;
  --el-wind: #5fe3a1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 82% -10%, rgba(255, 222, 23, 0.06), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(255, 222, 23, 0.035), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 22px; border-bottom: 2px solid #000;
  background: linear-gradient(180deg, #121311, #0e0f0e);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand__mark {
  font-family: 'Anton', sans-serif; font-size: 30px; letter-spacing: 1px;
  color: #0e0f0e; background: var(--zzz-yellow); padding: 0 10px;
  transform: skewX(-8deg); line-height: 1.15;
}
.brand__sub { font-family: 'Archivo Narrow'; color: var(--ink-dim); letter-spacing: 3px; font-size: 12px; }
.topnav { display: flex; gap: 18px; margin-left: 8px; }
.topnav a {
  color: var(--ink-dim); text-decoration: none; text-transform: uppercase;
  letter-spacing: 2px; font-size: 13px; font-weight: 700; padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.topnav a:hover, .topnav a.active { color: var(--zzz-yellow); border-color: var(--zzz-yellow); }
.rec { margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-family: 'Archivo Narrow'; letter-spacing: 2px; color: #ff5a4d; font-size: 13px; }
.rec i { width: 9px; height: 9px; border-radius: 50%; background: #ff5a4d; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- layout ---------- */
.view { flex: 1; width: min(1200px, 100%); margin: 0 auto; padding: 30px 20px 60px; }
.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: 12px; font-family: 'Archivo Narrow'; letter-spacing: 1px;
}
.msg { color: var(--ink-dim); padding: 40px 6px; font-size: 15px; }
.msg.error { color: #ff7a6c; }

/* ---------- intro ---------- */
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.intro h1 { font-family: 'Anton'; font-weight: 400; font-size: clamp(34px, 6vw, 58px); line-height: .92; margin: 0; letter-spacing: .5px; }
.intro h1 em { color: var(--zzz-yellow); font-style: normal; }
.intro p { color: var(--ink-dim); max-width: 60ch; margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.intro p b { color: var(--ink); font-weight: 700; }
.meta { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-faint); line-height: 1.7; white-space: nowrap; }
.meta b { color: var(--zzz-yellow); }

/* ---------- mode tabs ---------- */
.modetabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.modetabs button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: 'Anton'; font-size: 20px; letter-spacing: .5px; color: var(--ink-faint);
  padding: 12px 18px 14px; position: relative; transition: color .15s ease;
}
.modetabs button:hover { color: var(--ink); }
.modetabs button.active { color: var(--ink); }
.modetabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--zzz-yellow);
}

/* ---------- cabecera de ciclo ---------- */
.cyc { display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(150deg, #15161a, #0f1012 80%); position: relative; overflow: hidden; }
.cyc::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--hazard); }
.cyc__id { padding-left: 8px; }
.cyc__name { font-family: 'Anton'; font-size: 26px; line-height: 1; }
.cyc__win { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-dim); margin-top: 5px; }
.cyc__count { margin-left: auto; text-align: center; }
.cyc__count .n { font-family: 'Anton'; font-size: 26px; color: var(--zzz-yellow); line-height: 1; font-variant-numeric: tabular-nums; }
.cyc__count .l { font-family: 'Archivo Narrow'; letter-spacing: 2px; font-size: 10px; color: var(--ink-dim); text-transform: uppercase; }
.cyc__count.ended .n { color: #ff7a6c; }

/* segmented actual/próximo */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #101113; }
.seg button { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-dim);
  font-family: 'Archivo Narrow'; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  font-size: 12px; padding: 7px 16px; border-radius: 999px; transition: all .15s ease; }
.seg button.active { background: var(--zzz-yellow); color: #111; }

/* ---------- panel de buffs de temporada / condiciones ---------- */
.season { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px;
  margin-bottom: 20px; background: linear-gradient(150deg, #17181c, #0f1012 82%); position: relative; overflow: hidden; }
.season::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--hazard); opacity: .8; }
.season__h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tag { font-family: 'Anton'; font-size: 16px; letter-spacing: 1px; color: var(--zzz-yellow); }
.season__hint { font-family: 'Archivo Narrow'; letter-spacing: 1.5px; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; }
.season__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.sbuff { border-left: 2px solid var(--zzz-yellow); background: rgba(255,222,23,.05); padding: 10px 13px; border-radius: 0 4px 4px 0; }
.sbuff .buff__t { font-family: 'Archivo'; font-weight: 800; font-size: 13px; color: var(--zzz-yellow); margin-bottom: 4px; }
.sbuff .buff__d { font-size: 12.5px; line-height: 1.5; color: #d9d8d2; }

/* ---------- Deadly Assault: tarjetas de jefe con retrato ---------- */
.bosses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.boss { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #121317;
  display: flex; flex-direction: column; box-shadow: 0 12px 30px rgba(0,0,0,.45); }

.boss__art { position: relative; height: 236px; overflow: hidden; background: #0a0b0d; }
.boss__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 6%; }
/* el retrato ya viene compuesto con su propio scrim; este refuerzo inferior solo
   garantiza la legibilidad del nombre sobre cualquier imagen */
.boss__scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(8,9,11,.5) 100%); }
.boss__no { position: absolute; top: 8px; left: 12px; font-family: 'Anton'; font-size: 34px; line-height: 1;
  color: var(--zzz-yellow); text-shadow: 0 1px 4px rgba(0,0,0,.85); z-index: 2; }
.boss__lvl { position: absolute; top: 12px; right: 12px; z-index: 2; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #111; background: var(--zzz-yellow); padding: 3px 9px; border-radius: 3px; font-weight: 700; }
.boss__name { position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 2; margin: 0;
  font-family: 'Anton'; font-weight: 400; font-size: 21px; line-height: 1.04; letter-spacing: .3px;
  text-shadow: 0 2px 12px rgba(0,0,0,.95); }

.boss__body { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 12px; }
.boss__hp { display: flex; align-items: flex-end; gap: 12px; }
.hp__fig { display: flex; flex-direction: column; }
.hp__v { font-family: 'Anton'; font-size: 30px; line-height: .9; font-variant-numeric: tabular-nums; }
.hp__l { font-family: 'Archivo Narrow'; letter-spacing: 2px; font-size: 9px; color: var(--ink-dim); text-transform: uppercase; margin-top: 3px; }
.hp__trend { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.delta { font-family: 'JetBrains Mono', monospace; font-size: 11px; margin-top: 2px; }
.delta.up { color: var(--zzz-yellow); }
.delta.flat { color: var(--ink-faint); }

.lbl { display: block; font-family: 'Archivo Narrow'; letter-spacing: 2px; font-size: 9px;
  color: var(--ink-faint); text-transform: uppercase; margin-bottom: 6px; }
.boss__weak .els { display: flex; flex-wrap: wrap; gap: 6px; }
.el { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  padding: 3px 9px 3px 5px; border-radius: 999px; border: 1px solid var(--line); }
.el img { width: 17px; height: 17px; object-fit: contain; }
.el--weak { background: rgba(255,222,23,.1); border-color: color-mix(in srgb, var(--zzz-yellow) 45%, transparent); color: #fff; }
.el--resist { opacity: .55; }
.el--resist::after { content: " ✕"; color: #ff7a6c; }
.el--none { font-size: 12px; color: var(--ink-faint); font-style: italic; }

.ranks { display: flex; gap: 8px; flex-wrap: wrap; }
.rk { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 9px; border-radius: 4px;
  background: #1b1c20; border: 1px solid var(--line); color: var(--ink-dim); }
.rk b { color: var(--ink); font-weight: 700; }
.rk--s b { color: #ffd34d; }

.boss__cond .buff { border-left: 2px solid color-mix(in srgb, var(--zzz-yellow) 50%, #555); background: rgba(255,255,255,.02);
  padding: 8px 11px; border-radius: 0 4px 4px 0; margin-top: 6px; }
.buff__t { font-family: 'Archivo'; font-weight: 800; font-size: 12px; color: var(--zzz-yellow); margin-bottom: 3px; }
.buff__d { font-size: 12.5px; line-height: 1.5; color: #cfcec8; }
.buff__d.clamp { max-height: 4.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); }
.buff__more { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-dim);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 4px 0 0; }
.buff__more:hover { color: var(--zzz-yellow); }

.season__tba { font-size: 13px; color: var(--ink-dim); font-style: italic; }

/* ---------- Shiyu Defense: nodos + rooms ---------- */
.nodes { display: flex; flex-direction: column; gap: 14px; }
.node { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #16171b, #101115 85%); }
.node__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); }
.node__no { font-family: 'Anton'; font-size: 26px; line-height: 1; color: var(--zzz-yellow); min-width: 28px; text-align: center; }
.node__id { display: flex; flex-direction: column; }
.node__nm { font-family: 'Archivo'; font-weight: 800; font-size: 15px; }
.node__lvl { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.node__weak { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.node__weak .el { font-size: 11px; padding: 2px 8px 2px 4px; }
.node__weak .el img { width: 15px; height: 15px; }

.node__rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); }
.room { background: #121317; padding: 11px 14px 13px; }
.room__h { font-family: 'Archivo Narrow'; letter-spacing: 1.5px; font-size: 10px; color: var(--ink-faint);
  text-transform: uppercase; margin-bottom: 9px; }
.room__ens { display: flex; gap: 10px; flex-wrap: wrap; }

.enc { width: 74px; }
.enc__img { width: 74px; height: 74px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line);
  background: #0a0b0d; display: grid; place-items: center; }
.enc__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.enc__nm { font-size: 10px; line-height: 1.2; color: var(--ink-dim); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.enc__hp { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--zzz-yellow); }

/* ---------- botón (historial) + popover flotante ---------- */
.enc__hist { appearance: none; background: none; border: 0; cursor: pointer; padding: 3px 0 0; margin-top: 1px;
  font-family: 'Archivo Narrow', sans-serif; font-size: 10px; letter-spacing: .4px; color: var(--ink-faint);
  transition: color .15s; }
.enc__hist:hover { color: var(--zzz-yellow); text-decoration: underline; }
.hp__trend .enc__hist { margin-top: 3px; }

.histpop__ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(6,7,9,.72); backdrop-filter: blur(4px); animation: histfade .15s ease; }
@keyframes histfade { from { opacity: 0; } to { opacity: 1; } }
.histpop { width: min(440px, 100%); max-height: 82vh; display: flex; flex-direction: column; overflow: hidden;
  background: #121317; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: histrise .18s cubic-bezier(.2,.8,.3,1); }
@keyframes histrise { from { transform: translateY(10px) scale(.98); opacity: .5; } to { transform: none; opacity: 1; } }
.histpop__head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,222,23,.06), transparent); }
.histpop__t { margin: 0; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 19px; letter-spacing: .4px; flex: 1; line-height: 1.1; }
.histpop__x { appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-dim); font-size: 15px; padding: 4px 2px; line-height: 1; }
.histpop__x:hover { color: var(--zzz-yellow); }
.histpop__body { padding: 14px 16px 16px; overflow-y: auto; }
.histpop__trend { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; }
.histpop__d { display: flex; flex-direction: column; gap: 2px; }
.histpop__cnt { font-family: 'Archivo Narrow'; font-size: 10px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; }
.histpop__tbl { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.histpop__tbl th { text-align: right; font-weight: 700; font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-faint); padding: 0 0 7px; border-bottom: 1px solid var(--line); }
.histpop__tbl th:first-child { text-align: left; }
.histpop__tbl th.c, .histpop__tbl td.c { text-align: center; }
.histpop__tbl td { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--ink-dim); white-space: nowrap; }
.histpop__tbl td.num { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; padding-left: 10px; }
.histpop__tbl td.num:first-of-type { color: var(--zzz-yellow); font-weight: 700; }
.histpop__tbl tbody tr:last-child td { border-bottom: 0; }
.histpop__note { margin-top: 11px; font-size: 11.5px; color: var(--ink-faint); font-style: italic; line-height: 1.45; }

/* ---------- responsive ---------- */
@media (max-width: 900px) { .bosses { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .intro { align-items: flex-start; } .meta { text-align: left; }
  .node__head { flex-wrap: wrap; } .node__weak { margin-left: 0; width: 100%; justify-content: flex-start; }
}
