/* Server-rendered data pages: champion, matchup and patch reports. */

body.detail-page {
  --d-panel: #0d141f;
  --d-line: #243247;
  --d-soft: rgba(139, 155, 178, 0.12);
}

.detail-shell {
  position: relative;
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ----------------------------------------------------------- hero + stats */
.d-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border: 1px solid var(--line, #243247);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(70, 167, 255, 0.16), transparent 55%),
    linear-gradient(150deg, #0d1624, #070b12 70%);
}

.d-hero-copy { min-width: 280px; flex: 1 1 460px; }

.d-hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.d-avatar-hero { display: inline-flex; }

.d-en {
  font-size: 0.5em;
  font-weight: 600;
  color: var(--muted, #8b9bb2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.d-vs {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--gold, #ffbf5b);
  letter-spacing: 0.12em;
}

.d-lede {
  margin: 0 0 14px;
  max-width: 68ch;
  color: var(--muted, #8b9bb2);
  line-height: 1.7;
}

.d-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.d-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid rgba(70, 167, 255, 0.35);
  border-radius: 999px;
  background: rgba(70, 167, 255, 0.08);
  color: #cfe6ff;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.d-chip-soft {
  border-color: var(--d-line);
  background: var(--d-soft);
  color: var(--muted, #8b9bb2);
}

.d-chip-role { padding: 3px 7px; }
.d-chip-role .role-glyph { width: 17px; height: 17px; }
.d-table .role-cell .role-glyph { width: 20px; height: 20px; }

.d-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
  flex: 0 1 320px;
}

.d-stat {
  padding: 12px 14px;
  border: 1px solid var(--d-line);
  border-radius: 14px;
  background: rgba(13, 20, 31, 0.72);
}

.d-stat strong {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--text, #e9f0fa);
}
.d-stat strong .role-glyph { width: 22px; height: 22px; vertical-align: -4px; }

.d-stat span { font-size: 12px; color: var(--muted, #8b9bb2); }

/* ------------------------------------------------------------------ cards */
.d-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.d-grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.d-card {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--d-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 20, 31, 0.95), rgba(9, 14, 22, 0.95));
}

.d-grid .d-card { margin-top: 0; }

.d-card h2 {
  margin: 0 0 14px;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.d-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--muted, #8b9bb2);
  font-weight: 600;
}

.d-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.d-card-head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.d-card-head h2 .role-glyph { width: 20px; height: 20px; }

.d-sub { font-size: 12px; color: var(--muted, #8b9bb2); }

.d-note,
.d-empty,
.d-footnote {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted, #8b9bb2);
}

.d-card .d-empty { margin: 4px 0 0; }

.d-footnote { margin-top: 26px; }
.d-footnote a { color: var(--blue, #46a7ff); }

/* ------------------------------------------------------------------ tables */
.d-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.d-table th {
  padding: 8px 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #8b9bb2);
  border-bottom: 1px solid var(--d-line);
  white-space: nowrap;
}

.d-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(36, 50, 71, 0.55);
  vertical-align: middle;
}

.d-table tbody tr:last-child td { border-bottom: 0; }
.d-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-table .bar-cell { width: 132px; }

/* --------------------------------------------------------------- champions */
.d-champ {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.d-champ:hover .d-champ-name strong { color: var(--blue, #46a7ff); }

.d-champ-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.d-champ-name strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-champ-name small { font-size: 11px; color: var(--muted, #8b9bb2); }

.d-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--d-line);
  object-fit: cover;
  background: #0a1018;
  flex: none;
}

.d-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--blue, #46a7ff);
}

.d-avatar-hero .d-avatar { width: 56px; height: 56px; border-radius: 14px; }

/* bars */
.d-bar {
  display: inline-block;
  width: 120px;
  max-width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(70, 167, 255, 0.14);
  overflow: hidden;
  vertical-align: middle;
}

.d-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #46a7ff, #48d7a0);
}

/* lists */
.d-list { margin: 0; padding: 0; list-style: none; }

.d-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(36, 50, 71, 0.5);
}

.d-row:last-child { border-bottom: 0; }
.d-row > .d-champ { flex: 1; min-width: 0; }
.d-row-meta { font-size: 12px; color: var(--muted, #8b9bb2); white-space: nowrap; }
.d-row-rate { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

.d-delta { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; min-width: 62px; text-align: right; }
.d-delta.up { color: var(--green, #48d7a0); }
.d-delta.down { color: var(--red, #ff5570); }

/* matchup columns */
.d-matchups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }

/* items and runes */
.d-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.d-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--d-line);
  border-radius: 12px;
  background: rgba(10, 16, 24, 0.72);
  font-size: 13px;
}

.d-item img { border-radius: 8px; flex: none; }
.d-item small { color: var(--muted, #8b9bb2); font-size: 11px; }

.d-item-icon { vertical-align: middle; border-radius: 6px; }

.d-sub img { vertical-align: middle; }

/* side cards */
.d-champcards { display: grid; gap: 16px; }

.d-side { display: flex; flex-direction: column; gap: 12px; }
.d-side > .d-champ { font-size: 15px; }
.d-side .d-avatar { width: 44px; height: 44px; }

.d-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #8b9bb2);
}

.d-dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.d-dl div { padding: 8px 10px; border: 1px solid var(--d-line); border-radius: 10px; }
.d-dl dt { font-size: 11px; color: var(--muted, #8b9bb2); }
.d-dl dd { margin: 2px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.d-dl dd .role-glyph { width: 20px; height: 20px; vertical-align: -4px; }

.d-link { color: var(--blue, #46a7ff); text-decoration: none; font-size: 13px; }
.d-link:hover { text-decoration: underline; }

.d-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 14px 4px;
}

/* ------------------------------------------------------------------ footer */
.ch-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 2px 28px;
  color: var(--muted, #8b9bb2);
  font-size: 11px;
}

@media (max-width: 720px) {
  .ch-foot { width: calc(100% - 24px); }
}

/* ----------------------------------------------------------------- mobile */
@media (max-width: 760px) {
  .d-table .bar-cell,
  .d-table thead th:last-child:empty { display: none; }
}

@media (max-width: 720px) {
  .detail-shell { padding: 18px 12px 48px; }
  .d-hero { padding: 20px; border-radius: 16px; }
  .d-stats { grid-template-columns: repeat(2, 1fr); flex-basis: 100%; }
  .d-card { padding: 18px 16px; border-radius: 16px; }
  .d-bar { width: 84px; }
  .d-table { font-size: 13px; }
  .d-table th, .d-table td { padding: 8px 5px; }
  .d-dl { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------- esports BP pages */
.d-filter .d-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}
.d-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted, #8b9bb2);
}
.d-form select,
.d-form input {
  min-width: 170px;
  padding: 9px 12px;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: var(--panel, #0d141f);
  color: var(--text, #e9f0fa);
}
.d-form button {
  padding: 10px 18px;
  border: 1px solid rgba(70, 167, 255, 0.45);
  border-radius: 10px;
  background: rgba(70, 167, 255, 0.14);
  color: var(--text, #e9f0fa);
  cursor: pointer;
}
.d-form button:hover { background: rgba(70, 167, 255, 0.24); }
.d-form .d-link { padding-bottom: 10px; }

.d-draft-match a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.d-draft-match strong { font-weight: 600; }
.d-draft-match .is-winner { color: var(--gold, #ffbf5b); }
.d-draft-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #8b9bb2);
  letter-spacing: 0.08em;
}

.d-draft-bans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.d-draft-side h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 17px;
}
.d-draft-side h3 span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #8b9bb2);
  letter-spacing: 0.08em;
}
.d-draft-side.side-blue h3 { color: var(--blue, #46a7ff); }
.d-draft-side.side-red h3 { color: #ff7b7b; }
.d-draft-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.d-draft-item { min-height: 26px; }
.d-draft-piece {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.d-draft-piece img { border-radius: 7px; }
.d-draft-piece-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.d-draft-piece-text small {
  font-size: 11px;
  color: var(--muted, #8b9bb2);
}
.d-draft-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--d-soft);
  font-size: 12px;
}

.d-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.d-draft-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--d-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.d-draft-step.side-blue { border-left: 3px solid var(--blue, #46a7ff); }
.d-draft-step.side-red { border-left: 3px solid #ff7b7b; }
.d-draft-step-no {
  min-width: 18px;
  font-weight: 700;
  color: var(--muted, #8b9bb2);
}
.d-draft-team { font-size: 12px; color: var(--muted, #8b9bb2); }
.d-draft-lanes td { vertical-align: middle; }
.d-pager-pos { font-size: 12px; color: var(--muted, #8b9bb2); }

@media (max-width: 720px) {
  .d-draft-bans,
  .d-board { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- esports meta report */
.d-chip.is-current {
  border-color: rgba(70, 167, 255, 0.5);
  background: rgba(70, 167, 255, 0.16);
  color: var(--text, #e9f0fa);
}
.d-chips .d-chip small {
  margin-left: 5px;
  font-size: 10px;
  color: var(--muted, #8b9bb2);
}

.d-prostats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.d-prostats-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted, #8b9bb2);
}
.d-diff.is-blue { color: var(--blue, #46a7ff); }
.d-diff.is-red { color: #ff7b7b; }

.d-objectives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.d-objectives li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--d-line);
  border-radius: 999px;
  font-size: 12px;
}
.d-objectives span { color: var(--muted, #8b9bb2); }
.d-objectives .side-blue { color: var(--blue, #46a7ff); }
.d-objectives .side-red { color: #ff7b7b; }

@media (max-width: 720px) {
  .d-prostats { grid-template-columns: 1fr; }
}
