/**
 * Homepage league + cooking surfaces — proof above the fold.
 *
 * Pulls the league treatment from /rooms (throne row, crests, sparklines,
 * commissioner line) and the credential treatment from /ledger (caller
 * avatars, archetype chips, hit %). Lives ONLY on the homepage; /rooms
 * and /ledger keep their own dedicated CSS files.
 */

:root {
  /* mirror the trench-league palette so the embed matches the
     destination pages pixel-for-pixel — same vars, same intent. */
  --tl-bg: #0b0f0c;
  --tl-raised: #121913;
  --tl-panel: #0f1510;
  --tl-line: #243024;
  --tl-green: #c8d94b;
  --tl-green-bright: #9ee34a;
  --tl-emerald: #1f6b3a;
  --tl-ink: #e8ede6;
  --tl-dim: #8a938a;
  --tl-dimmer: #5a635a;
  --tl-gold: #e8c547;
  --tl-silver: #b8c0b8;
  --tl-bronze: #c98e4a;
}

.home-league,
.home-cooking {
  max-width: 920px;
  margin: 60px auto 0;
  padding: 0 16px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

.home-section-head {
  margin-bottom: 18px;
}

.home-section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tl-green-bright);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}

.home-section-eyebrow .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tl-green-bright);
  animation: tlBreathe 2.4s ease-in-out infinite;
  display: inline-block;
}

@keyframes tlBreathe {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.home-section-head h2 {
  font-family: var(--font-display, "Playfair Display", serif);
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.05;
  margin: 0 0 6px;
  color: var(--tl-ink);
}

.home-section-head h2 em {
  font-style: italic;
  color: var(--tl-green);
}

.home-section-sub {
  font-size: 12px;
  color: var(--tl-dim);
  margin: 0;
}

/* ── league rooms (mirrors /rooms standings rows) ────────────────── */
.home-league-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-league-row {
  display: grid;
  grid-template-columns: 36px 42px 1fr auto;
  gap: 0 12px;
  align-items: center;
  background: var(--tl-raised);
  border: 1px solid var(--tl-line);
  padding: 14px 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
}

.home-league-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(158, 227, 74, 0.07);
}

.home-league-row.is-throne {
  border-color: rgba(200, 217, 75, 0.55);
  background: linear-gradient(180deg, rgba(200, 217, 75, 0.06), var(--tl-raised) 60%);
  box-shadow: 0 0 40px rgba(200, 217, 75, 0.08), inset 0 1px 0 rgba(200, 217, 75, 0.18);
  padding: 18px 16px;
}

.home-league-row--skeleton {
  height: 70px;
  border-color: var(--tl-line);
  opacity: 0.4;
}

.home-league-row .rk {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--tl-dimmer);
  color: var(--tl-dim);
}

.home-league-row.is-throne .rk {
  border-color: var(--tl-gold);
  color: var(--tl-gold);
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.35);
}

.home-league-row.is-r2 .rk { border-color: var(--tl-silver); color: var(--tl-silver); }
.home-league-row.is-r3 .rk { border-color: var(--tl-bronze); color: var(--tl-bronze); }

.home-league-row .crest {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2a4a2a, var(--tl-emerald));
  border: 1px solid var(--tl-line);
  background-size: cover;
  background-position: center;
}

.home-league-row.is-throne .crest {
  border-color: rgba(200, 217, 75, 0.5);
}

.home-league-row .info {
  min-width: 0;
}

.home-league-row .rname {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--tl-ink);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.home-league-row.is-throne .rname {
  font-size: 19px;
}

.home-league-row .crown {
  font-size: 13px;
}

.home-league-row .fire {
  font-size: 9px;
  background: rgba(217, 131, 79, 0.12);
  border: 1px solid rgba(217, 131, 79, 0.4);
  color: #e0a06a;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.home-league-row .rmeta {
  font-size: 10.5px;
  color: var(--tl-dim);
  margin-top: 4px;
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
}

.home-league-row .rmeta b {
  color: var(--tl-ink);
  font-weight: 600;
}

.home-league-row .rmeta .hit {
  color: var(--tl-green);
}

.home-league-row .pulse {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 108px;
}

.home-league-row .spark {
  display: block;
}

.home-league-row .spark polyline {
  fill: none;
  stroke: var(--tl-green);
  stroke-width: 1.6;
  opacity: 0.9;
}

.home-league-row .spark .area {
  fill: url(#home-spark-g);
  stroke: none;
  opacity: 0.5;
}

.home-league-row .lastcall {
  font-size: 9.5px;
  color: var(--tl-dimmer);
}

.home-league-row .lastcall b {
  color: var(--tl-green-bright);
  font-weight: 600;
}

/* ── commissioner line ───────────────────────────────────────────── */
.home-commish {
  margin: 18px 0 0;
  padding: 13px 16px;
  background: var(--tl-panel);
  border-left: 2px solid var(--tl-green);
  border-top: 1px solid var(--tl-line);
  border-right: 1px solid var(--tl-line);
  border-bottom: 1px solid var(--tl-line);
  font-size: 12.5px;
  color: var(--tl-ink);
  line-height: 1.55;
}

.home-commish .home-commish-sig {
  color: var(--tl-dim);
  font-size: 10.5px;
  display: block;
  margin-top: 4px;
}

/* ── cooking rows (credential treatment) ─────────────────────────── */
.home-cooking-callers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-cooking-row {
  display: grid;
  grid-template-columns: 36px 44px 1fr auto;
  gap: 0 12px;
  align-items: center;
  background: var(--tl-raised);
  border: 1px solid var(--tl-line);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-cooking-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(158, 227, 74, 0.07);
}

.home-cooking-row.is-rank-1 {
  border-color: rgba(200, 217, 75, 0.55);
  background: linear-gradient(180deg, rgba(200, 217, 75, 0.06), var(--tl-raised) 60%);
  box-shadow: 0 0 40px rgba(200, 217, 75, 0.08), inset 0 1px 0 rgba(200, 217, 75, 0.18);
}

.home-cooking-row--skeleton {
  height: 70px;
  border-color: var(--tl-line);
  opacity: 0.4;
}

.home-cooking-row .rk {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--tl-dimmer);
  color: var(--tl-dim);
}

.home-cooking-row.is-rank-1 .rk {
  border-color: var(--tl-gold);
  color: var(--tl-gold);
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.35);
}

.home-cooking-row.is-rank-2 .rk { border-color: var(--tl-silver); color: var(--tl-silver); }
.home-cooking-row.is-rank-3 .rk { border-color: var(--tl-bronze); color: var(--tl-bronze); }

.home-cooking-row .pav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a4a2a, var(--tl-emerald));
  border: 1px solid var(--tl-line);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.home-cooking-row .pav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-cooking-row.is-rank-1 .pav {
  border-color: var(--tl-gold);
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.25);
}

.home-cooking-row .pinfo {
  min-width: 0;
}

.home-cooking-row .pname {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--tl-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-cooking-row.is-rank-1 .pname {
  font-size: 19px;
}

.home-cooking-row .arch {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--tl-green);
  border: 1px solid rgba(200, 217, 75, 0.4);
  background: rgba(200, 217, 75, 0.07);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-cooking-row .pmeta {
  font-size: 10.5px;
  color: var(--tl-dim);
  margin-top: 4px;
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
}

.home-cooking-row .pmeta b {
  color: var(--tl-ink);
  font-weight: 600;
}

.home-cooking-row .pmeta .hit {
  color: var(--tl-green);
}

.home-cooking-row .pbest {
  text-align: right;
  font-size: 11px;
  color: var(--tl-dim);
}

.home-cooking-row .pbest .ticker {
  color: var(--tl-green);
  font-weight: 600;
}

.home-cooking-row .pbest .mult {
  display: block;
  color: var(--tl-green-bright);
  font-weight: 700;
  font-size: 14px;
}

/* ── section CTA ─────────────────────────────────────────────────── */
.home-section-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  border: 1px solid var(--tl-line);
  background: var(--tl-panel);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tl-green);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.home-section-cta:hover {
  background: rgba(200, 217, 75, 0.06);
  border-color: rgba(200, 217, 75, 0.4);
  color: var(--tl-green-bright);
}

@media (max-width: 560px) {
  .home-league-row {
    grid-template-columns: 30px 36px 1fr;
  }
  .home-league-row .pulse {
    grid-column: 3;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    min-width: 0;
  }
  .home-cooking-row {
    grid-template-columns: 30px 38px 1fr;
  }
  .home-cooking-row .pbest {
    grid-column: 3;
    text-align: left;
    margin-top: 4px;
  }
}
