/* ============================================================
 * Haramball — team & league detail page styles
 * Layered on top of styles.css; reuses the same CSS variables.
 * ============================================================ */

.detail-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Reserve a little space only for the single-line rank text while it loads.
   We deliberately do NOT reserve big heights on #t-reasons / #t-comments:
   most pages have little/no data, so a large min-height would leave an ugly
   empty gap. The small shift there is preferable to a gap on every page. */
.t-rank-line { min-height: 22px; }

/* ---------- Breadcrumb ---------- */
.crumbs {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .sep { color: var(--text-dim); }

/* ---------- Team / league header ---------- */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}
.detail-badge {
  width: 68px; height: 68px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 24px; color: #fff;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-lg);
}
.detail-hero h1 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}
.detail-hero h1 .accent { color: var(--accent); }
.detail-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 2px 0 0;
}
.detail-lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 18px 0 28px;
}
.detail-lede strong { color: var(--text); }

/* ---------- Live stat cards ---------- */
.t-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}
.t-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
}
.t-stat .num { font-size: 26px; font-weight: 800; color: var(--text); }
.t-stat .lbl { font-size: 12px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.t-rank-line {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px;
  text-align: center;
}

/* ---------- CTA ---------- */
.detail-cta {
  background: var(--accent-bg);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 28px 0;
}
.detail-cta h2 { font-size: 20px; margin: 0 0 6px; }
.detail-cta p { color: var(--text-muted); margin: 0 0 16px; font-size: 15px; }
.btn-vote {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 13px 30px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 15px;
}
.btn-vote:hover { background: var(--accent-hover); color: #fff; }

/* ---------- Sections ---------- */
.detail-section { margin: 36px 0; }
.detail-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
}
.t-empty { color: var(--text-dim); font-size: 15px; }

/* ---------- Reason bars ---------- */
.t-reason-row { margin-bottom: 14px; }
.t-reason-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.t-reason-label { color: var(--text); }
.t-reason-count { color: var(--text-muted); }
.t-reason-bar { height: 8px; background: var(--bg-active); border-radius: 100px; overflow: hidden; }
.t-reason-bar span { display: block; height: 100%; background: var(--accent); border-radius: 100px; transition: width 0.5s ease; }

/* ---------- Comment form + list (fan verdicts) ---------- */
.cmt-form { margin: 0 0 18px; }
.cmt-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px; line-height: 1.5;
  resize: vertical; min-height: 70px;
  font-family: inherit;
}
.cmt-input:focus { outline: none; border-color: var(--accent); }
.cmt-input::placeholder { color: var(--text-dim); }
.cmt-form-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 12px; }
.cmt-count { font-size: 12px; color: var(--text-dim); }
.cmt-submit {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 22px; border-radius: 100px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
}
.cmt-submit:hover { background: var(--accent-hover); }
.cmt-submit:disabled { opacity: 0.55; cursor: default; }
.cmt-error { color: var(--accent); font-size: 13px; margin-top: 8px; }
#cmt-list { display: flex; flex-direction: column; gap: 10px; }
.cmt-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.cmt-item-body { margin: 0 0 6px; color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.cmt-item-time { color: var(--text-dim); font-size: 12px; }

/* ---------- Comments ---------- */
.t-comment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.t-comment-text { margin: 0 0 8px; color: var(--text); font-size: 15px; line-height: 1.5; }
.t-comment-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.t-comment-reason { color: var(--accent); font-weight: 600; }
.t-comment-time { color: var(--text-dim); }

/* ---------- League page: team grid ---------- */
.lg-board-section { margin: 32px 0; }
.lg-board { display: flex; flex-direction: column; gap: 8px; }
.lg-board-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: background 0.15s, border-color 0.15s;
}
.lg-board-row:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.lg-rank { width: 26px; text-align: center; font-weight: 800; color: var(--text-muted); }
.lg-rank.gold { color: var(--gold); }
.lg-rank.silver { color: var(--silver); }
.lg-rank.bronze { color: var(--bronze); }
.lg-badge { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.lg-name { flex: 1; font-weight: 600; }
.lg-votes { color: var(--text-muted); font-weight: 700; }
.lg-votes small { color: var(--text-dim); font-weight: 400; }

.team-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.team-index a {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s;
}
.team-index a:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.team-index .ti-badge { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.team-index .ti-name { font-size: 14px; font-weight: 600; }

/* ---------- "Browse by league" block (shared, used on home too) ---------- */
.league-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.league-index a {
  display: block;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.league-index a:hover { color: var(--text); }
.league-index .li-country { color: var(--text-dim); }

@media (max-width: 560px) {
  .detail-page { padding: 24px 16px 64px; }
  .t-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .t-stat { padding: 12px 8px; }
  .t-stat .num { font-size: 19px; }
  .t-stat .lbl { font-size: 10px; }
  .detail-badge { width: 52px; height: 52px; font-size: 19px; border-radius: 13px; }
  .detail-hero { gap: 14px; }
  .detail-cta { padding: 20px 16px; }
  .btn-vote { display: block; min-height: 50px; padding: 15px 24px; }
  .team-index { grid-template-columns: 1fr 1fr; }
  .lg-board-row { padding: 10px 12px; gap: 10px; }
}

@media (max-width: 380px) {
  .team-index { grid-template-columns: 1fr; }
}
