:root {
  color-scheme: dark;
  --bg: #090d17;
  --panel: rgba(20, 28, 45, 0.82);
  --panel-strong: #151d2e;
  --line: rgba(151, 166, 196, 0.16);
  --text: #f5f7fb;
  --muted: #929db2;
  --red: #ef4b5d;
  --blue: #54a6ff;
  --green: #42d392;
  --amber: #f6bd60;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% -20%, rgba(84, 166, 255, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.glow {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.11;
  pointer-events: none;
}

.glow-one { top: 18rem; left: -11rem; background: var(--red); }
.glow-two { right: -10rem; bottom: 4rem; background: var(--blue); }

main {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(38px, 7vw, 72px); line-height: 0.98; letter-spacing: -0.055em; }
h1 span { color: var(--red); }
h2 { margin-bottom: 0; font-size: 29px; letter-spacing: -0.03em; }
h3 { margin-bottom: 2px; font-size: 20px; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin-bottom: 0; font-size: 16px; }
.subtitle strong { color: var(--text); }

.update-form {
  width: min(100%, 360px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.update-form label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.update-controls { display: flex; gap: 8px; }
input, button { min-height: 44px; border-radius: 11px; font: inherit; }
input {
  min-width: 0;
  flex: 1;
  padding: 0 13px;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(6, 10, 18, 0.72);
  color: var(--text);
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(84, 166, 255, 0.13); }
button {
  padding: 0 16px;
  border: 0;
  background: var(--red);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { cursor: progress; filter: grayscale(0.5); opacity: 0.65; }
.form-message { min-height: 18px; margin: 8px 0 -4px; color: var(--muted); font-size: 12px; }
.form-message.error { color: #ff8290; }

.status-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 21, 34, 0.74);
}
.status-card p { margin: 0; }
#status-title { font-weight: 800; }
#status-details { color: var(--muted); font-size: 13px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 99px; background: var(--muted); box-shadow: 0 0 0 5px rgba(146, 157, 178, 0.09); }
.status-dot.success { background: var(--green); box-shadow: 0 0 0 5px rgba(66, 211, 146, 0.1); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 5px rgba(239, 75, 93, 0.1); }
.status-dot.running { background: var(--amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 58px;
}
.summary-card {
  min-height: 126px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(24, 33, 52, 0.88), rgba(15, 21, 34, 0.72));
}
.summary-card strong { display: block; margin-bottom: 4px; font-size: 34px; line-height: 1.1; letter-spacing: -0.04em; }
.summary-card span { color: var(--muted); }

section + section { margin-top: 58px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading .eyebrow { margin-bottom: 4px; }

.players-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.player-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.player-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--red), #802c5c);
}
.avatar-placeholder { display: grid; place-items: center; font-size: 20px; font-weight: 900; }
.player-id { margin: 0; color: var(--muted); font-size: 12px; }
.metric-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.metric { padding: 11px; border-radius: 11px; background: rgba(5, 9, 16, 0.4); }
.metric strong { display: block; font-size: 18px; }
.metric span { color: var(--muted); font-size: 11px; }
.heroes { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.heroes-title { margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.hero-line { display: flex; justify-content: space-between; gap: 14px; margin: 5px 0; font-size: 13px; }
.hero-line span:last-child { color: var(--muted); white-space: nowrap; }

.player-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.player-detail-header .heroes-title { margin: 0; }
.coverage { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; margin: 13px 0; overflow-x: auto; }
.tab-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 9, 16, 0.45);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.tab-button:hover, .tab-button.active {
  border-color: rgba(239, 75, 93, 0.48);
  background: rgba(239, 75, 93, 0.11);
  color: var(--text);
  filter: none;
}
.tab-panel[hidden] { display: none; }
.detail-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151d2e;
}
.detail-table th, .detail-table td { padding: 11px 12px; }
.numeric { font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative { color: #ff8290; }
.match-items { min-width: 142px; }
.item-icon {
  width: 31px;
  height: 23px;
  margin: 1px 2px;
  border-radius: 4px;
  object-fit: cover;
  background: #0a0e17;
  vertical-align: middle;
}
.item-fallback { display: inline-block; margin-right: 5px; color: var(--muted); font-size: 11px; }
.item-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item-stat {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 9, 16, 0.35);
}
.item-stat-icon {
  width: 48px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: #0a0e17;
}
.item-stat div { min-width: 0; }
.item-stat strong, .item-stat span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-stat strong { font-size: 13px; }
.item-stat span { color: var(--muted); font-size: 11px; }
.player-link { color: var(--text); text-decoration: none; font-weight: 700; }
.player-link:hover { color: var(--blue); }
.teammate-table small { display: block; color: var(--muted); font-size: 10px; }
.compact-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(84, 166, 255, 0.035); }
.result { display: inline-flex; min-width: 82px; justify-content: center; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.result.win { color: #7de9b5; background: rgba(66, 211, 146, 0.11); }
.result.loss { color: #ff8290; background: rgba(239, 75, 93, 0.11); }
.empty { grid-column: 1 / -1; margin: 0; padding: 30px; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .hero { align-items: stretch; flex-direction: column; }
  .update-form { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-row { grid-template-columns: repeat(3, 1fr); }
  .item-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  main { width: min(100% - 22px, 1180px); padding-top: 32px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { min-height: 104px; padding: 16px; }
  .summary-card strong { font-size: 27px; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .item-stats-grid { grid-template-columns: 1fr; }
  .player-detail-header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}
