:root {
  color-scheme: dark;
  --background: #090a0c;
  --surface: #111317;
  --surface-hover: #16191e;
  --surface-soft: #0d0f12;
  --border: #25282e;
  --border-strong: #343840;
  --text: #f3f4f5;
  --muted: #8d929b;
  --muted-strong: #b6bac1;
  --accent: #e43d42;
  --accent-bright: #ff5055;
  --accent-soft: rgba(228, 61, 66, 0.11);
  --online: #64c89a;
  --danger: #ee6c70;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 10, 12, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 390px) 1fr;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(228, 61, 66, 0.48);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 17px;
  font-weight: 850;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  letter-spacing: 0;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 5px;
  height: 1.5px;
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-form input {
  width: 100%;
  height: 42px;
  padding: 0 105px 0 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.search-form input::placeholder {
  color: #686d76;
}

.search-form input:focus {
  border-color: rgba(228, 61, 66, 0.72);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(228, 61, 66, 0.1);
}

.search-submit {
  position: absolute;
  right: 5px;
  height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 0 13px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 750;
  transition: background 180ms ease, transform 180ms ease;
}

.search-submit:hover {
  background: var(--accent-bright);
}

.search-submit:active {
  transform: scale(0.97);
}

.clear-search {
  position: absolute;
  right: 68px;
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.clear-search.is-visible {
  display: grid;
}

.clear-search:hover {
  color: var(--text);
}

.service-status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b58a46;
  box-shadow: 0 0 0 4px rgba(181, 138, 70, 0.09);
}

.service-status.is-online .status-dot {
  background: var(--online);
  box-shadow: 0 0 0 4px rgba(100, 200, 154, 0.1);
}

.service-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(238, 108, 112, 0.1);
}

.page-shell {
  width: min(1040px, calc(100% - 40px));
  flex: 1;
  margin: 0 auto;
  padding: 42px 0 72px;
}

.breadcrumbs {
  min-height: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--muted);
  transition: color 160ms ease;
}

.breadcrumbs button:hover {
  color: var(--text);
}

.breadcrumbs span[aria-current="page"] {
  color: var(--muted-strong);
}

.crumb-separator {
  color: #42464e;
}

.view-heading {
  min-height: 132px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: 0;
  outline: none;
}

.view-description {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.archive-total {
  min-width: 104px;
  padding: 0 0 4px;
  text-align: right;
}

.archive-total strong,
.archive-total span {
  display: block;
}

.archive-total strong {
  color: var(--text);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.archive-total span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0;
}

.search-state {
  min-height: 18px;
  margin: 13px 0 -5px;
  color: var(--danger);
  font-size: 12px;
}

.archive-view {
  padding-top: 30px;
}

.archive-view.is-entering {
  animation: view-enter 360ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.server-grid {
  grid-template-columns: minmax(280px, 440px);
}

.nav-card {
  position: relative;
  min-width: 0;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  opacity: 0;
  animation: card-enter 420ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 45ms);
  transition: border-color 190ms ease, background 190ms ease, transform 190ms ease, box-shadow 190ms ease;
}

.nav-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 28px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 220ms ease, width 220ms ease;
}

.nav-card:hover,
.nav-card:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  outline: none;
}

.nav-card:hover::before,
.nav-card:focus-visible::before {
  width: 58px;
  transform: scaleX(1);
}

.nav-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-kicker {
  margin-bottom: 15px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  overflow: hidden;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-arrow {
  flex: 0 0 auto;
  color: #656a73;
  font-size: 20px;
  transition: color 190ms ease, transform 190ms ease;
}

.nav-card:hover .card-arrow,
.nav-card:focus-visible .card-arrow {
  color: var(--accent-bright);
  transform: translateX(5px);
}

.server-card {
  min-height: 172px;
}

.server-card strong {
  font-size: 32px;
}

.day-card strong {
  font-size: 21px;
}

.replay-list {
  display: grid;
  gap: 10px;
}

.replay-card {
  min-width: 0;
  min-height: 148px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--surface);
  opacity: 0;
  animation: card-enter 420ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 42ms);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.replay-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateX(3px);
}

.stagger-0 { --stagger: 0; }
.stagger-1 { --stagger: 1; }
.stagger-2 { --stagger: 2; }
.stagger-3 { --stagger: 3; }
.stagger-4 { --stagger: 4; }
.stagger-5 { --stagger: 5; }
.stagger-6 { --stagger: 6; }
.stagger-7 { --stagger: 7; }
.stagger-8 { --stagger: 8; }
.stagger-9 { --stagger: 9; }
.stagger-10 { --stagger: 10; }
.stagger-11 { --stagger: 11; }
.stagger-12 { --stagger: 12; }

.replay-round span,
.replay-round strong {
  display: block;
}

.replay-round span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.replay-round strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.replay-details {
  min-width: 0;
}

.replay-primary {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.replay-primary time {
  color: var(--muted-strong);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.replay-primary span {
  color: var(--muted);
  font-size: 11px;
}

.replay-context {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.replay-context span {
  max-width: 240px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 7px;
  color: var(--muted-strong);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-context .context-server {
  border-color: rgba(228, 61, 66, 0.35);
  color: #ff7377;
}

.replay-name {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: #777c85;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.replay-facts span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.replay-facts small {
  color: #656a73;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.round-end-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 0;
  color: #777c85;
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.round-log {
  margin-top: 15px;
  border-top: 1px solid var(--border);
}

.round-log summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 3px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
}

.round-log summary::-webkit-details-marker {
  display: none;
}

.round-log summary::before {
  content: "+";
  width: 18px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.round-log[open] summary::before {
  content: "−";
}

.round-log summary span {
  flex: 1;
}

.round-log summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.player-log-scroll {
  overflow-x: auto;
  padding-top: 8px;
}

.player-log-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted-strong);
  font-size: 11px;
  text-align: left;
}

.player-log-table th,
.player-log-table td {
  border-bottom: 1px solid rgba(52, 56, 64, 0.55);
  padding: 9px 10px 9px 0;
  vertical-align: top;
}

.player-log-table thead th {
  color: #656a73;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.player-log-table tbody th {
  min-width: 130px;
  color: var(--text);
  font-weight: 650;
}

.player-character {
  display: grid;
  gap: 3px;
}

.player-character + .player-character {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(52, 56, 64, 0.42);
}

.player-character strong {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
}

.player-character span,
.player-empty {
  color: var(--muted);
  font-size: 10px;
}

.download-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(228, 61, 66, 0.42);
  border-radius: 6px;
  background: var(--accent-soft);
  color: #ff7377;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.download-link:hover,
.download-link:focus-visible {
  border-color: var(--accent-bright);
  background: var(--accent);
  color: white;
  outline: none;
  transform: translateY(-1px);
}

.empty-state,
.error-state {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 34px;
  background: var(--surface-soft);
}

.empty-state strong,
.error-state strong {
  font-size: 20px;
}

.empty-state span,
.error-state span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state button {
  margin-top: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 12px;
}

.error-state strong {
  color: var(--danger);
}

.loading-state {
  display: grid;
  gap: 12px;
}

.loading-line {
  height: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  animation: loading-pulse 1.4s ease-in-out infinite;
}

.loading-line:nth-child(2) {
  animation-delay: 120ms;
}

.loading-line:nth-child(3) {
  animation-delay: 240ms;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 22px 0 30px;
  border-top: 1px solid var(--border);
  color: #555a63;
  font-size: 10px;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 0.48;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: auto minmax(240px, 1fr);
  }

  .service-status {
    display: none;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .header-inner {
    width: min(100% - 28px, 1040px);
    min-height: 124px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 0;
  }

  .brand-copy small {
    display: none;
  }

  .search-form {
    width: 100%;
  }

  .page-shell {
    width: calc(100% - 28px);
    padding: 28px 0 50px;
  }

  .breadcrumbs {
    margin-bottom: 20px;
  }

  .view-heading {
    min-height: 118px;
    align-items: flex-start;
    padding-bottom: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .archive-total {
    min-width: 70px;
  }

  .archive-total strong {
    font-size: 22px;
  }

  .card-grid,
  .server-grid {
    grid-template-columns: 1fr;
  }

  .nav-card {
    min-height: 126px;
    padding: 21px;
  }

  .server-card {
    min-height: 142px;
  }

  .replay-card {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 17px;
  }

  .replay-round {
    grid-column: 1;
  }

  .replay-details {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .download-link {
    grid-column: 2;
    grid-row: 1;
    min-width: 46px;
    padding: 0 14px;
  }

  .download-link span:first-child {
    display: none;
  }

  .site-footer {
    width: calc(100% - 28px);
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
