:root {
  --page: #e7e4de;
  --bg: #ffffff;
  --bg-2: #f5f3ef;
  --bg-3: #ece9e3;
  --line: #e2ded6;
  --text: #16181b;
  --muted: #6c7178;
  --ink: #16181b;
  --ink-hover: #2a2d32;
  --accent: #e8620c;
  --accent-ink: #1a0d02;
  --t: #c98a12;
  --ct: #2f7fc4;
  --danger: #d9352c;
  --radius: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--page); padding: 0 16px 24px; }
/* Boxed layout: one white card hanging from the top of the window, rounded at the bottom. */
body {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 1px 2px rgb(22 24 27 / .04), 0 12px 40px -12px rgb(22 24 27 / .12);
  overflow: hidden;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 22px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
}
.logo::before { content: ''; width: 12px; height: 12px; background: var(--accent); border-radius: 2px; }
.nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--text); }

.site-header .wrap { gap: 24px; }
.site-header .nav { margin-left: auto; }
.auth { display: flex; align-items: center; gap: 14px; }
.steam-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  font: 600 14px var(--body); text-decoration: none; white-space: nowrap;
}
.steam-btn:hover { background: var(--ink-hover); }
.me-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 14px; }
.me-link img { border-radius: 8px; }
.link-btn { background: none; border: 0; color: var(--muted); font: 500 14px var(--body); cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--text); }

/* Account page */
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 40px; }
.panel h2 { font: 700 30px/1 var(--display); text-transform: uppercase; margin: 0 0 8px; }
.panel > p { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.fields { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 10px; align-items: end; }
.fields label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fields input {
  height: 50px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: 500 15px var(--body); min-width: 0;
}
.fields input:focus { outline: none; border-color: var(--accent); }
.fields .btn { height: 50px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: #3ecf8e; box-shadow: 0 0 0 4px rgb(62 207 142 / .15); }
.dot.err { background: var(--danger); }
.match-list { display: grid; gap: 8px; margin-bottom: 56px; }
.match-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.match-row:hover { border-color: var(--muted); }
.match-row span { color: var(--muted); font-size: 14px; }
.profile { display: flex; align-items: center; gap: 18px; padding: 48px 0 28px; }
.profile img { border-radius: 14px; }
.profile h1 { font: 700 clamp(36px, 6vw, 60px)/1 var(--display); text-transform: uppercase; margin: 0; }

@media (max-width: 860px) {
  .fields { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .steam-btn span, .me-link span { display: none; }
}

main { flex: 1; }

/* Hero */
.hero { padding: 88px 0 64px; }
.eyebrow { font: 600 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 {
  font: 700 clamp(48px, 9vw, 112px)/.9 var(--display);
  text-transform: uppercase; letter-spacing: -.01em; margin: 0; max-width: 11ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 54ch; margin: 22px 0 36px; }

.submit { display: flex; gap: 10px; max-width: 720px; }
.submit input {
  flex: 1; min-width: 0; height: 58px; padding: 0 18px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: 500 16px var(--body);
}
.submit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(255 122 26 / .15); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 58px; padding: 0 26px; border: 0; border-radius: var(--radius);
  background: var(--ink); color: #fff;
  font: 700 18px var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: transform .15s, filter .15s;
}
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.small { height: 42px; padding: 0 18px; font-size: 16px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 22px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hint code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* Steps */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px 0 80px; }
.how div { background: var(--bg); padding: 26px; }
.how b { display: block; font: 700 40px/1 var(--display); color: var(--accent); margin-bottom: 10px; }
.how h3 { margin: 0 0 6px; font-size: 17px; }
.how p { margin: 0; color: var(--muted); font-size: 15px; }

/* Sections */
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.section-head h2 { font: 700 40px/1 var(--display); text-transform: uppercase; margin: 0; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 10px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 7px; font: 600 14px var(--body); cursor: pointer; }
.tabs button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgb(22 24 27 / .08); }

/* Clip grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; margin-bottom: 80px; }
.card { text-decoration: none; display: block; }
.card .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.card .thumb img, .card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.card .thumb video { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
.card:hover .thumb video.playing { opacity: 1; }
.badge {
  position: absolute; left: 10px; top: 10px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 15px/1 var(--display); letter-spacing: .05em; text-transform: uppercase;
  padding: 6px 8px; border-radius: 6px;
}
.duration { position: absolute; right: 10px; bottom: 10px; background: rgb(0 0 0 / .7); font-size: 12px; padding: 3px 7px; border-radius: 6px; }
.card .meta { padding: 12px 2px 0; }
.card .meta strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta span { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; grid-column: 1 / -1; }

/* Match page */
.match-head { padding: 48px 0 28px; display: flex; flex-wrap: wrap; gap: 24px; align-items: end; justify-content: space-between; }
.match-head h1 { font: 700 clamp(40px, 7vw, 72px)/.95 var(--display); text-transform: uppercase; margin: 0; }
.match-head .sub { color: var(--muted); margin-top: 8px; }
.scoreline { font: 700 64px/1 var(--display); letter-spacing: .02em; }
.scoreline .dash { color: var(--muted); margin: 0 10px; }

.progress { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 40px; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.steps div { height: 6px; border-radius: 3px; background: var(--line); }
.steps div.done { background: var(--accent); }
.steps div.now { background: linear-gradient(90deg, var(--accent), var(--line)); background-size: 200% 100%; animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.progress h2 { margin: 0; font: 700 28px/1.1 var(--display); text-transform: uppercase; }
.progress p { margin: 6px 0 0; color: var(--muted); }
.progress.failed { border-color: rgb(255 93 85 / .4); }
.progress.failed h2 { color: var(--danger); }

.highlights { display: grid; gap: 28px; margin-bottom: 56px; }
.highlight { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.highlight video, .highlight .pending { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.highlight .pending { display: grid; place-items: center; color: var(--muted); background: var(--bg-3); }
.highlight h3 { margin: 4px 0 2px; font: 700 40px/1 var(--display); text-transform: uppercase; }
.highlight .who { color: var(--accent); font-weight: 700; font-size: 18px; }
.highlight .round { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.feed { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.feed li { display: flex; gap: 10px; align-items: center; background: var(--bg-3); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.feed .weapon { color: var(--muted); width: 92px; flex: none; font-size: 13px; text-transform: uppercase; }
.feed .victim { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .tags { color: var(--accent); font: 700 12px var(--body); letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

table.board { width: 100%; border-collapse: collapse; margin-bottom: 80px; font-size: 15px; }
.board th { text-align: right; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.board th:first-child, .board td:first-child { text-align: left; }
.board td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board tr.team-b td:first-child { box-shadow: inset 3px 0 0 var(--ct); }
.board tr.team-a td:first-child { box-shadow: inset 3px 0 0 var(--t); }
.board-wrap { overflow-x: auto; }

/* Clip page */
.clip-page { padding: 36px 0 80px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
.clip-page video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); }
.clip-page h1 { font: 700 56px/.95 var(--display); text-transform: uppercase; margin: 0 0 6px; }
.clip-page .who { color: var(--accent); font-weight: 700; font-size: 20px; }
.clip-page .round { color: var(--muted); margin: 4px 0 20px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer .wrap { padding: 26px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .highlight, .clip-page { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  html { padding: 0 8px 8px; }
  body { border-radius: 0 0 16px 16px; min-height: calc(100vh - 8px); }
  .hero { padding: 56px 0 40px; }
  .submit { flex-direction: column; }
  .nav { display: none; }
  .steps { gap: 4px; }
  .scoreline { font-size: 48px; }
}
