:root {
  --bg: #0a0b0f;
  --panel: #12141b;
  --panel-2: #171a23;
  --line: #242835;
  --text: #e9ebf0;
  --muted: #8b93a7;
  --accent: #00e5cc;
  --accent-dim: #0d3d38;
  --red: #ff4d5e;
  --blue: #4d9dff;
  --live: #ff3b3b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand h1 {
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.top-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
}

.pill.link {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.pill.live {
  color: #fff;
  background: var(--live);
  border-color: var(--live);
}

.pill.ok {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ---------- key panel ---------- */

.key-panel {
  margin: 22px 0 30px;
}

.key-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

input[type="password"],
input[type="text"] {
  flex: 1 1 320px;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--mono);
}

input:focus {
  outline: none;
  border-color: var(--accent-dim);
}

button {
  background: var(--accent);
  color: #05221f;
  border: none;
  border-radius: 9px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 620;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- sections ---------- */

section.block {
  margin-bottom: 34px;
}

.block-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 500;
  margin-bottom: 13px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.block-title .sub {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.75;
}

.event-head {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.event-head h2 {
  font-size: 23px;
  font-weight: 640;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}

.event-head .meta {
  color: var(--muted);
  font-size: 13.5px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- bouts ---------- */

.bout {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 7px;
}

.bout.is-live {
  border-color: var(--live);
  background: linear-gradient(90deg, rgba(255, 59, 59, 0.09), transparent);
}

.bout .fighter {
  font-size: 14px;
  font-weight: 540;
}

.bout .fighter.right {
  text-align: right;
}

.bout .mid {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}

.tag.title {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(0, 229, 204, 0.07);
}

.tag.final {
  color: var(--text);
}

/* ---------- rankings ---------- */

.rank-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
}

.rank-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-row .rank {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
}

.rank-row .rank.champ {
  color: var(--accent);
  font-weight: 700;
}

.rank-row .country {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- live ---------- */

.live-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
}

.corner-name {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.corner.blue {
  text-align: right;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.corner.blue .stat-line {
  flex-direction: row-reverse;
}

.stat-line:last-child {
  border-bottom: none;
}

.stat-line .label {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-line .value {
  font-family: var(--mono);
  font-weight: 600;
}

.corner.red .value {
  color: var(--red);
}
.corner.blue .value {
  color: var(--blue);
}

.clock {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
}

.live-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- states ---------- */

.empty,
.err {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.err {
  border-color: #4a1f24;
  background: rgba(255, 77, 94, 0.05);
  color: #ffb3ba;
}

.empty strong,
.err strong {
  color: var(--text);
  display: block;
  margin-bottom: 7px;
}

.skeleton {
  height: 44px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ---------- coverage ---------- */

.coverage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.cov {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cov-n {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
}

.cov-l {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- footer ---------- */

footer {
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

footer .dim {
  opacity: 0.65;
}

@media (max-width: 640px) {
  .bout {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .bout .fighter.right {
    text-align: left;
  }
  .live-grid {
    grid-template-columns: 1fr;
  }
  .corner.blue {
    text-align: left;
  }
  .corner.blue .stat-line {
    flex-direction: row;
  }
  .event-head h2 {
    font-size: 20px;
  }
}
