/* ════════════════════════════════════════
   TOURNAMENT DETAIL PAGE
   fragster.gg — Challenger Edition
════════════════════════════════════════ */

.tr-page { background:var(--bg); min-height:calc(100vh - var(--hh)); }

/* ── TOP NAV BAR ── */
.tr-nav-bar {
  background:var(--bg2);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 24px; gap:16px; flex-wrap:wrap; min-height:48px;
  position:sticky; top:var(--hh); z-index:40;
}
.tr-tabs { display:flex; gap:0; overflow-x:auto; }
.tr-tabs::-webkit-scrollbar { height:0; }
.tr-tab {
  padding:0 18px; height:48px; min-height:48px;
  background:none; border:none; border-bottom:2px solid transparent;
  color:var(--t2); font-size:13px; font-weight:600;
  cursor:pointer; font-family:var(--font); white-space:nowrap;
  transition:color .12s, border-color .12s;
}
.tr-tab:hover { color:var(--t1); }
.tr-tab.active { color:var(--t1); border-bottom-color:var(--lime); }
.tr-tab-count {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 5px;
  background:rgba(255,255,255,.12); border-radius:9px;
  font-size:11px; font-weight:800; margin-left:6px; color:var(--t1);
}
.tr-top-action { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.tr-join-btn {
  padding:8px 20px; border-radius:7px;
  background:var(--lime); color:#000; font-weight:900;
  font-size:13px; border:none; cursor:pointer; font-family:var(--font);
  text-decoration:none; display:inline-block; transition:opacity .15s;
}
.tr-join-btn:hover { opacity:.88; }
.tr-admin-status-btn {
  padding:5px 12px; border-radius:6px; border:1px solid var(--border);
  background:transparent; color:var(--t2); font-size:11.5px; font-weight:700;
  cursor:pointer; font-family:var(--font); transition:all .12s;
}
.tr-admin-status-btn:hover { color:var(--t1); border-color:rgba(255,255,255,.2); }
.tr-admin-status-btn.active { background:var(--lime); color:#000; border-color:var(--lime); }

/* ── PANELS ── */
.tr-panel { display:none; padding:20px 24px 40px; }
.tr-panel.active { display:block; }

/* ── CARDS ── */
.tr-card {
  background:var(--bg2); border:1px solid var(--border);
  border-radius:10px; padding:20px 22px; margin-bottom:0;
}
.tr-card-title {
  font-size:14px; font-weight:800; color:var(--t1);
  margin-bottom:16px;
}
.tr-card-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px;
}
.tr-view-all {
  font-size:11.5px; color:var(--lime); font-weight:700;
  background:none; border:none; cursor:pointer; font-family:var(--font);
}
.tr-btn-ghost {
  padding:7px 14px; border-radius:7px;
  background:transparent; border:1px solid var(--border);
  color:var(--t2); font-size:12px; font-weight:700;
  cursor:pointer; font-family:var(--font); transition:all .12s;
}
.tr-btn-ghost:hover { color:var(--t1); border-color:rgba(255,255,255,.2); }

/* ── OVERVIEW GRID ── */
.tr-overview-grid {
  display:grid; grid-template-columns:1fr 300px; gap:16px; align-items:start;
}

/* ── DETAILS ── */
.tr-detail-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 0; border-bottom:1px solid var(--border);
  font-size:13.5px;
}
.tr-detail-row:last-child { border-bottom:none; }
.tr-detail-key { color:var(--t3); font-size:12.5px; }
.tr-detail-val { color:var(--t1); font-weight:600; text-align:right; }

/* ── SCHEDULE ── */
.tr-schedule-row {
  display:flex; gap:12px; align-items:center;
  padding:8px 0; border-bottom:1px solid var(--border);
  font-size:13px;
}
.tr-schedule-row:last-child { border-bottom:none; }
.tr-schedule-label { color:var(--t3); min-width:140px; font-size:12px; }
.tr-schedule-val { color:var(--t1); font-weight:600; }

/* ── INFO CONTENT ── */
.tr-info-content {
  font-size:13.5px; color:var(--t2); line-height:1.8;
}
.tr-info-content h1,.tr-info-content h2,.tr-info-content h3 { color:var(--t1); margin:12px 0 6px; }
.tr-info-content strong { color:var(--lime); }
.tr-info-content a { color:var(--lime); }

/* ── MINI PLAYER ── */
.tr-mini-player {
  display:flex; align-items:center; gap:10px;
  padding:8px 0; border-bottom:1px solid var(--border);
}
.tr-mini-player:last-child { border-bottom:none; }
.tr-mini-av {
  width:30px; height:30px; border-radius:7px; flex-shrink:0;
  background:linear-gradient(135deg,#1a2550,#2a1060);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; color:var(--lime); font-weight:700; overflow:hidden;
}
.tr-mini-av img { width:100%; height:100%; object-fit:cover; }

/* ── PRIZES ── */
.tr-prize-row {
  display:flex; align-items:center; gap:12px;
  padding:10px 0; border-bottom:1px solid var(--border);
}
.tr-prize-row:last-child { border-bottom:none; }
.tr-prize-medal { font-size:20px; min-width:28px; }
.tr-prize-place { font-size:13px; color:var(--t2); flex:1; text-transform:uppercase; letter-spacing:.3px; font-size:12px; }
.tr-prize-amount { font-family:var(--mono); font-size:14px; font-weight:800; color:var(--lime); }

/* ── BRACKET ── */
.tr-bracket-scroll { overflow-x:auto; padding-bottom:12px; }
.tr-bracket { display:flex; gap:0; align-items:flex-start; min-width:max-content; }
.tr-bracket-round { display:flex; flex-direction:column; min-width:230px; padding:0 16px; }
.tr-bracket-round-name {
  font-size:11.5px; font-weight:800; color:var(--t2);
  text-align:center; padding:8px 0 16px; letter-spacing:.3px;
}
.tr-bracket-round-name em { color:var(--lime); font-style:normal; }
.tr-bracket-matches { display:flex; flex-direction:column; gap:14px; }
.tr-bracket-match {
  background:var(--bg3); border:1px solid var(--border);
  border-radius:8px; overflow:hidden; transition:border-color .12s;
}
.tr-bracket-match:hover { border-color:rgba(255,255,255,.15); }
.tr-bm-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:5px 10px; background:rgba(255,255,255,.03);
  border-bottom:1px solid var(--border);
}
.tr-bm-status {
  font-size:10px; font-weight:700; text-transform:lowercase;
  padding:2px 8px; border-radius:3px;
}
.tr-bm-status.completed { background:rgba(170,255,0,.1); color:var(--lime); }
.tr-bm-status.scheduled { background:rgba(255,255,255,.06); color:var(--t3); }
.tr-bm-status.in-progress { background:rgba(255,60,90,.12); color:var(--red); }
.tr-bm-player {
  display:flex; align-items:center; gap:8px; padding:9px 10px;
  border-bottom:1px solid var(--border); transition:background .12s;
}
.tr-bm-player:last-of-type { border-bottom:none; }
.tr-bm-player.winner { background:rgba(170,255,0,.05); }
.tr-bm-player.loser { opacity:.4; }
.tr-bm-av {
  width:22px; height:22px; border-radius:5px; flex-shrink:0;
  background:linear-gradient(135deg,#1a2550,#2a1060);
  display:flex; align-items:center; justify-content:center;
  font-size:8px; color:var(--lime); overflow:hidden;
}
.tr-bm-av.tbd { background:rgba(255,255,255,.06); color:var(--t3); }
.tr-bm-av img { width:100%; height:100%; object-fit:cover; }
.tr-bm-name { flex:1; font-size:12.5px; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tr-bm-name.tbd { color:var(--t3); }
.tr-bm-score {
  font-family:var(--mono); font-size:14px; font-weight:800;
  color:var(--t3); min-width:20px; text-align:right;
}
.tr-bm-score.win { color:var(--lime); }
.tr-bm-report-btn {
  display:block; width:100%; padding:6px; text-align:center;
  background:none; border:none; border-top:1px solid var(--border);
  color:var(--lime); font-size:11px; font-weight:700;
  cursor:pointer; font-family:var(--font); transition:background .12s;
}
.tr-bm-report-btn:hover { background:rgba(170,255,0,.06); }

/* ── PARTICIPANTS ── */
.tr-participants-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
}
.tr-participant-card {
  display:flex; align-items:center; gap:12px;
  background:var(--bg3); border:1px solid var(--border);
  border-radius:8px; padding:12px 14px;
  text-decoration:none; transition:border-color .12s;
}
.tr-participant-card:hover { border-color:rgba(255,255,255,.15); }
.tr-part-av {
  width:36px; height:36px; border-radius:8px; flex-shrink:0;
  background:linear-gradient(135deg,#1a2550,#2a1060);
  display:flex; align-items:center; justify-content:center;
  font-size:12px; color:var(--lime); font-weight:700; overflow:hidden;
}
.tr-part-av img { width:100%; height:100%; object-fit:cover; }
.tr-part-name { font-size:13.5px; font-weight:700; color:var(--t1); margin-bottom:2px; }
.tr-part-record { font-size:11px; color:var(--t3); }
.tr-part-checkin { margin-left:auto; font-size:11px; color:var(--lime); font-weight:800; flex-shrink:0; }

/* ── MATCHES ── */
.tr-match-row {
  padding:14px 0; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.tr-match-row:last-child { border-bottom:none; }
.tr-match-badges { display:flex; gap:5px; flex-wrap:wrap; align-items:center; min-width:200px; }
.tr-match-status-badge,.tr-match-round-badge,.tr-match-bo-badge {
  padding:2px 8px; border-radius:4px; font-size:10.5px; font-weight:700;
}
.tr-match-status-badge.completed   { background:rgba(170,255,0,.1); color:var(--lime); }
.tr-match-status-badge.scheduled   { background:rgba(255,255,255,.06); color:var(--t3); }
.tr-match-status-badge.in-progress { background:rgba(139,92,246,.2); color:var(--purple); }
.tr-match-round-badge { background:rgba(255,255,255,.06); color:var(--t3); }
.tr-match-bo-badge    { background:rgba(255,255,255,.06); color:var(--t3); }
.tr-match-players { display:flex; align-items:center; gap:12px; flex:1; min-width:200px; }
.tr-match-player { display:flex; align-items:center; gap:8px; }
.tr-match-player.winner .tr-match-pname { color:var(--lime); font-weight:800; }
.tr-match-av {
  width:26px; height:26px; border-radius:6px; flex-shrink:0;
  background:linear-gradient(135deg,#1a2550,#2a1060);
  display:flex; align-items:center; justify-content:center;
  font-size:9px; color:var(--lime); overflow:hidden;
}
.tr-match-av img { width:100%; height:100%; object-fit:cover; }
.tr-match-pname { font-size:13px; font-weight:600; color:var(--t1); }
.tr-match-vs { font-size:11.5px; color:var(--t3); padding:0 4px; }
.tr-match-right { display:flex; flex-direction:column; align-items:flex-end; gap:3px; min-width:120px; }
.tr-match-score { font-family:var(--mono); font-size:14px; font-weight:800; color:var(--t1); }
.tr-match-date { font-size:11px; color:var(--t3); }
.tr-view-btn {
  padding:4px 12px; border-radius:5px; border:1px solid var(--border);
  background:transparent; color:var(--t2); font-size:11.5px; font-weight:700;
  cursor:pointer; font-family:var(--font); transition:all .12s;
}
.tr-view-btn:hover { color:var(--lime); border-color:rgba(170,255,0,.3); }

/* ── STANDINGS ── */
.tr-standings-row {
  display:flex; align-items:center; gap:12px;
  padding:12px 0; border-bottom:1px solid var(--border);
  transition:background .12s;
}
.tr-standings-row:last-child { border-bottom:none; }
.tr-standings-row.top-1 .tr-standings-name { color:var(--lime); }
.tr-standings-rank { font-size:18px; min-width:32px; text-align:center; flex-shrink:0; }
.tr-standings-av {
  width:36px; height:36px; border-radius:8px; flex-shrink:0;
  background:linear-gradient(135deg,#1a2550,#2a1060);
  display:flex; align-items:center; justify-content:center;
  font-size:12px; color:var(--lime); font-weight:700; overflow:hidden;
}
.tr-standings-av img { width:100%; height:100%; object-fit:cover; }
.tr-standings-name { font-size:14px; font-weight:700; color:var(--t1); margin-bottom:2px; }
.tr-standings-record { font-size:11px; color:var(--t3); }
.tr-standings-pts { font-size:13.5px; font-weight:800; color:var(--t2); margin-left:auto; flex-shrink:0; }

/* ── RULES ── */
.tr-rules-content {
  font-size:13.5px; color:var(--t2); line-height:2;
}
.tr-rules-content strong, .tr-rules-content b { color:var(--lime); display:block; margin-top:12px; font-size:14px; }

/* ── EMPTY STATE ── */
.tr-empty-state {
  text-align:center; padding:40px 20px;
  font-size:13.5px; color:var(--t2); line-height:1.7;
}

/* ── RESULT MODAL ── */
.tr-score-input {
  width:100%; background:var(--bg3); border:1px solid var(--border);
  border-radius:8px; padding:12px; color:var(--t1);
  font-size:22px; font-weight:800; text-align:center;
  font-family:var(--mono); outline:none;
}
.tr-winner-btn {
  padding:10px; border-radius:8px;
  background:rgba(255,255,255,.06); border:1px solid var(--border);
  color:var(--t2); font-size:13px; font-weight:700;
  cursor:pointer; font-family:var(--font); transition:all .15s;
}
.tr-winner-btn.active { background:rgba(170,255,0,.12); border-color:var(--lime); color:var(--lime); }
.tr-submit-result-btn {
  width:100%; padding:11px; border-radius:8px;
  background:var(--lime); color:#000; font-weight:900;
  font-size:14px; border:none; cursor:pointer; font-family:var(--font);
  transition:opacity .15s;
}
.tr-submit-result-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ── RESPONSIVE ── */
@media(max-width:900px){
  .tr-overview-grid { grid-template-columns:1fr; }
  .tr-participants-grid { grid-template-columns:1fr 1fr; }
}
@media(max-width:600px){
  .tr-nav-bar { padding:0 12px; }
  .tr-panel { padding:14px 14px 32px; }
  .tr-tab { padding:0 12px; font-size:12.5px; }
  .tr-participants-grid { grid-template-columns:1fr; }
  .tr-match-badges { min-width:auto; }
  .tr-top-action { display:none; }
}

/* Light mode */
[data-theme="light"] .tr-card { background:var(--bg2); }
[data-theme="light"] .tr-nav-bar { background:var(--bg2); }
[data-theme="light"] .tr-bracket-match { background:var(--bg3); }
