/* WC3 Replay Lab — orc-themed static clone (no hotlinked assets) */
:root {
  --ground: #21100d;
  --ground-2: #2a1610;
  --panel: #2f1a14;
  --panel-2: #3a2118;
  --border: #5a3528;
  --border-soft: #4a2a20;
  --text: #f3e3d6;
  --muted: #c9a79c;
  --dim: #8f6e62;
  --accent: #ff9a7a;
  --accent-2: #e8b86a;
  --gold: #d4a017;
  --silver: #b8c0cc;
  --link: #ff9a7a;
  --hu: #4a90d9;
  --ne: #3cb371;
  --orc: #d97706;
  --ud: #9b59b6;
  --win: #7dcea0;
  --lose: #e0745f;
  --shadow: rgba(0,0,0,.45);
  --radius: 10px;
  --font-body: "Alegreya Sans", "Noto Sans SC", "PingFang SC", "Segoe UI", sans-serif;
  --font-display: Grenze, "Noto Serif SC", "Palatino Linotype", Georgia, serif;
}


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(120,50,30,.35), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(80,30,20,.4), transparent 45%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.04) 3px, rgba(0,0,0,.04) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0,0,0,.03) 3px, rgba(0,0,0,.03) 4px),
    linear-gradient(180deg, #2a1610 0%, #21100d 40%, #1a0c08 100%);
  background-attachment: fixed;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: #ffc2ad; text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

.container { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(42,22,16,.97), rgba(33,16,13,.92));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 0; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--accent-2); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background:
    linear-gradient(135deg, #8b3a1f, #3d160e 55%, #21100d);
  border: 1px solid var(--accent-2);
  display: grid; place-items: center;
  font: 700 14px/1 var(--font-display);
  color: var(--accent-2);
  box-shadow: inset 0 0 12px rgba(232,184,106,.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font: 700 18px/1.1 var(--font-display); letter-spacing: .02em; }
.brand-text span { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  padding: 7px 12px; border-radius: 999px;
  color: var(--muted); border: 1px solid transparent;
}
.nav a:hover, .nav a.active {
  color: var(--text); background: var(--panel-2);
  border-color: var(--border); text-decoration: none;
}

/* Hero */
.hero {
  padding: 28px 0 10px;
}
.hero h1 {
  margin: 0 0 8px;
  font: 700 clamp(28px, 4vw, 40px)/1.15 var(--font-display);
  color: var(--text);
  text-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.hero p { margin: 0; color: var(--muted); max-width: 52ch; }
.hero .credit {
  margin-top: 8px; font-size: 13px; color: var(--dim);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  padding: 18px 0 48px;
  align-items: start;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

.panel {
  background: linear-gradient(180deg, rgba(47,26,20,.92), rgba(33,16,13,.88));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}

.panel-hd {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel-hd h2 {
  margin: 0; font: 700 18px/1.2 var(--font-display);
}
.panel-bd { padding: 14px 16px; }

/* Filters */
.filters { margin-bottom: 14px; }
.quick-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 12px;
}
.race-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.race-group label { font-size: 13px; color: var(--dim); margin-right: 2px; }
.chip {
  appearance: none; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted);
  padding: 6px 11px; border-radius: 999px; cursor: pointer;
  transition: .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: #4a2418; border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255,154,122,.25); }
.chip.hu.active { border-color: var(--hu); color: #cfe3ff; }
.chip.ne.active { border-color: var(--ne); color: #c8f0d8; }
.chip.orc.active { border-color: var(--orc); color: #ffe0b5; }
.chip.ud.active { border-color: var(--ud); color: #e8d0f5; }

.field {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 120px;
}
.field label { font-size: 12px; color: var(--dim); }
.field input, .field select, .search input {
  background: #1a0c08;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}
.field input:focus, .field select:focus, .search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,154,122,.15);
}
.search { flex: 1; min-width: 180px; }
.search input { width: 100%; }

.btn {
  appearance: none; border: 1px solid var(--border);
  background: linear-gradient(180deg, #4a2a1e, #321810);
  color: var(--text); padding: 8px 14px; border-radius: 8px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: linear-gradient(180deg, #7a3d28, #4e2416);
  border-color: #a85a3c; color: #fff4ec;
}
.btn-ghost { background: transparent; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed;
}

.advanced {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
  margin-top: 8px;
}
.advanced.open { display: grid; }

.meta-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin: 8px 0 12px;
  color: var(--muted); font-size: 13px;
}

/* Table */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-soft); }
table.replays {
  width: 100%; border-collapse: collapse; min-width: 720px;
  background: rgba(26,12,8,.35);
}
table.replays th, table.replays td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.replays th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--dim); background: rgba(0,0,0,.25); position: sticky; top: 0;
}
table.replays tbody tr { cursor: pointer; transition: background .12s; }
table.replays tbody tr:hover { background: rgba(255,154,122,.07); }
table.replays td.players { min-width: 220px; }
.vs { color: var(--dim); margin: 0 6px; font-size: 12px; }
.player {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.race {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; box-shadow: 0 0 0 1px rgba(0,0,0,.4);
}
.race.HU { background: var(--hu); }
.race.NE { background: var(--ne); }
.race.ORC { background: var(--orc); }
.race.UD { background: var(--ud); }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 7px;
  border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); background: rgba(0,0,0,.2);
}
.badge.gold { color: #21100d; background: linear-gradient(180deg,#f0d078,#d4a017); border-color: #b8860b; font-weight: 700; }
.badge.silver { color: #21100d; background: linear-gradient(180deg,#e8eef5,#b8c0cc); border-color: #8a939e; font-weight: 700; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* Pagination */
.pager {
  display: flex; gap: 6px; justify-content: center; align-items: center;
  padding: 14px 0 4px; flex-wrap: wrap;
}
.pager button {
  min-width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); cursor: pointer;
}
.pager button.active, .pager button:hover:not(:disabled) {
  color: var(--text); border-color: var(--accent); background: #4a2418;
}
.pager button:disabled { opacity: .4; cursor: default; }

/* Sidebar highlights */
.hl-list { display: flex; flex-direction: column; gap: 10px; }
.hl-card {
  display: block; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(58,33,24,.9), rgba(33,16,13,.95));
  color: inherit; text-decoration: none;
  position: relative; overflow: hidden;
}
.hl-card:hover { border-color: var(--accent); text-decoration: none; color: inherit; }
.hl-card.gold { border-color: #b8860b; box-shadow: inset 0 0 0 1px rgba(212,160,23,.35); }
.hl-card.silver { border-color: #8a939e; box-shadow: inset 0 0 0 1px rgba(184,192,204,.3); }
.hl-tag {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase;
}
.hl-card.gold .hl-tag { background: var(--gold); color: #21100d; }
.hl-card.silver .hl-tag { background: var(--silver); color: #21100d; }
.hl-names { font-weight: 700; margin: 4px 0 6px; padding-right: 70px; }
.hl-meta { font-size: 12px; color: var(--muted); }

/* Detail */
.detail-grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px;
  padding: 18px 0 48px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.teams {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch;
}
.team-card {
  background: rgba(0,0,0,.2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 14px;
}
.team-card.winner { border-color: rgba(125,206,160,.5); box-shadow: inset 0 0 0 1px rgba(125,206,160,.2); }
.team-card h3 { margin: 0 0 10px; font: 700 16px var(--font-display); }
.vs-big {
  display: grid; place-items: center; font: 700 20px var(--font-display); color: var(--dim);
}
.player-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(90,53,40,.35);
}
.player-row:last-child { border-bottom: 0; }
.stat-bars { display: flex; flex-direction: column; gap: 10px; }
.stat-row label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.bar {
  height: 10px; border-radius: 999px; background: #1a0c08; overflow: hidden;
  border: 1px solid var(--border-soft);
}
.bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #7a3d28, var(--accent-2));
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hero-chip {
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
  background: #1a0c08; border: 1px solid var(--border); color: var(--muted);
}
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 14px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.note {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: rgba(232,184,106,.08); border: 1px solid rgba(232,184,106,.25);
  color: var(--muted); font-size: 13px;
}

/* Packs / About */
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th, .simple-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border-soft); text-align: left;
}
.simple-table th { color: var(--dim); font-size: 12px; text-transform: uppercase; }
.page-pad { padding: 18px 0 56px; }
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 22px 0 36px; color: var(--dim); font-size: 13px;
}
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.empty {
  padding: 36px 16px; text-align: center; color: var(--muted);
}

/* Admin / upload */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  background: rgba(0,0,0,.2);
  color: var(--muted);
  cursor: pointer;
  transition: .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(255,154,122,.08);
  color: var(--text);
}
.dropzone strong { color: var(--accent-2); display:block; margin-bottom:6px; font-size:18px; }
.admin-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.preview-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
  background: #1a0c08; border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 10px 12px; color: var(--muted);
}
.token-row { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
.token-row .field { flex: 1; min-width: 180px; }
.status-ok { color: var(--win); }
.status-err { color: var(--lose); }
.btn-danger {
  background: linear-gradient(180deg, #7a2828, #4e1616);
  border-color: #a83c3c; color: #fff4ec;
}
.admin-list { display:flex; flex-direction:column; gap:8px; }
.admin-item {
  display:flex; justify-content:space-between; gap:10px; align-items:center;
  padding:10px 12px; border:1px solid var(--border-soft); border-radius:8px;
  background: rgba(0,0,0,.2);
}
.admin-item .meta { font-size:12px; color:var(--dim); }
