* { box-sizing: border-box; }
:root {
  --bg: #121614;
  --bg-soft: #171d1a;
  --card: rgba(22, 28, 25, 0.92);
  --card-2: rgba(27, 35, 31, 0.96);
  --border: rgba(191, 165, 94, 0.22);
  --text: #f3f1e8;
  --muted: #a8b0a8;
  --green: #2ebf6b;
  --green-2: #1f8f50;
  --gold: #d9b15f;
  --danger: #c2473d;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
}
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(217,177,95,.12), transparent 30%),
    radial-gradient(circle at top left, rgba(46,191,107,.10), transparent 28%),
    linear-gradient(180deg, #101412 0%, #151b18 100%);
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px; }
.wrap.narrow { max-width: 480px; }
h1,h2 { margin: 0 0 12px; }
h1 { letter-spacing: .01em; }
.muted { color: var(--muted); margin-bottom: 20px; }
.small { font-size: 12px; }
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
label span { display:block; font-size:14px; color: var(--muted); margin-bottom:6px; }
.full-row { grid-column: 1 / -1; }
.user-row { display:flex; justify-content:space-between; align-items:center; gap:12px; }
input, select, button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(217,177,95,.25);
  border-radius: 12px;
  font-size: 16px;
  background: rgba(9, 12, 11, .55);
  color: var(--text);
}
input::placeholder { color: #7f8b82; }
button {
  background: linear-gradient(180deg, var(--green), var(--green-2));
  color:#08110c;
  border:none;
  cursor:pointer;
  margin-top: 14px;
  font-weight: 700;
}
button.secondary { background: linear-gradient(180deg, #2a332e, #202823); color: var(--text); }
button.danger { background: linear-gradient(180deg, #d1574c, #a5332b); color:#fff; }
.topline, .teams-line, .actions, .top-actions { display:flex; align-items:center; gap:12px; }
.topline { justify-content:space-between; margin-bottom:20px; }
.top-actions { flex-wrap: wrap; }
.layout { display:grid; grid-template-columns: 1.35fr .95fr; gap:20px; }
.matches { display:flex; flex-direction:column; gap:12px; }
.match-row {
  border:1px solid rgba(217,177,95,.18);
  border-radius:14px;
  padding:14px;
  background: rgba(10, 13, 12, .35);
}
.match-row.played { background: rgba(26, 45, 32, .24); }
.meta { font-size:13px; color: var(--muted); margin-bottom:10px; }
.teams-line input { width:72px; text-align:center; }
.teams-line { justify-content:space-between; }
.done { font-weight:600; color: #78d89f; }
.table-scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th, td { padding:10px; border-bottom:1px solid rgba(217,177,95,.12); text-align:left; }
th { color: var(--gold); }
.alert {
  background: rgba(217,177,95,.12);
  border:1px solid rgba(217,177,95,.35);
  padding:10px 12px;
  border-radius:12px;
  margin-bottom:14px;
  color: var(--text);
}
.link-button {
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 14px; border-radius:12px;
  background: linear-gradient(180deg, var(--green), var(--green-2));
  color:#08110c; text-decoration:none; border:none; font-weight:700;
}
.secondary-link { background: linear-gradient(180deg, #2a332e, #202823); color: var(--text); }
.tournament-list, .history-list { display:grid; gap:10px; }
.tournament-item, .history-item {
  display:block; border:1px solid rgba(217,177,95,.16); border-radius:14px; padding:14px;
  color: var(--text); text-decoration:none; background: rgba(11,15,13,.42);
}
.tournament-item span { display:block; color: var(--muted); margin-top:4px; }
.playoff-card, .playoff-editor-card, .history-card { margin-top: 20px; }
.bracket-board, .editor-board { display:grid; grid-template-columns: 1fr 1fr 1fr; gap:24px; align-items:start; }
.board-col, .editor-col { display:grid; gap:16px; align-content:start; position:relative; }
.board-title { font-weight:800; font-size:18px; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.series-view, .series-card {
  position:relative;
  border:1px solid rgba(217,177,95,.18);
  border-radius:16px;
  padding:14px;
  background: rgba(10,14,12,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.series-label, .series-head { font-weight:700; font-size:14px; margin-bottom:8px; color: var(--gold); }
.series-rule { color: var(--muted); font-size:13px; margin-bottom:10px; }
.team-chip {
  background: rgba(22,28,25,.95);
  border:1px solid rgba(217,177,95,.12);
  border-radius:10px;
  padding:10px 12px;
  font-weight:600;
  margin-bottom:8px;
}
.team-chip.winner {
  border-color: rgba(46,191,107,.45);
  background: linear-gradient(180deg, rgba(46,191,107,.18), rgba(18,28,22,.95));
}
.aggregate { color: var(--muted); font-size:13px; }
.small-note { color: var(--gold); }
.middle-col::before, .final-col-board::before {
  content:''; position:absolute; left:-14px; top:34px; bottom:18px; width:2px; background: rgba(217,177,95,.20);
}
.middle-col .series-view::before, .final-col-board .series-view::before {
  content:''; position:absolute; left:-18px; top:50%; width:18px; height:2px; background: rgba(217,177,95,.20);
}
.champion-box {
  margin-top: 10px;
  border:2px dashed rgba(217,177,95,.45);
  background: linear-gradient(180deg, rgba(217,177,95,.08), rgba(22,18,10,.28));
  border-radius:16px;
  padding:16px;
  text-align:center;
}
.champion-title { font-size:14px; color: var(--gold); margin-bottom:6px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.champion-name { font-size:18px; font-weight:800; }
.champion-name.pending { color: var(--muted); }
.mini-match {
  display:grid; gap:8px;
  border:1px solid rgba(217,177,95,.12);
  border-radius:10px;
  padding:10px;
  background: rgba(17,22,20,.88);
  margin-bottom:10px;
}
.team-line { font-size:14px; }
.score-inline { display:flex; align-items:center; gap:8px; }
.score-inline input { width:64px; text-align:center; }
.winner-chip {
  display:inline-block; background: rgba(46,191,107,.18); color: #8eeab4; padding:6px 10px;
  border-radius:999px; font-size:13px; font-weight:600;
}
.champion-chip { background: rgba(217,177,95,.18); color: #f2d18e; }
@media (max-width: 900px) {
  .layout, .grid.two, .bracket-board, .editor-board { grid-template-columns: 1fr; }
  .topline { flex-direction:column; align-items:flex-start; }
  .teams-line { flex-wrap:wrap; justify-content:flex-start; }
  .middle-col::before, .final-col-board::before, .middle-col .series-view::before, .final-col-board .series-view::before { display:none; }
}
