:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #101113;
  --surface-raised: #17181a;
  --surface-soft: #1d1d1c;
  --border: #2d2c28;
  --border-strong: #454137;
  --text: #f4f1e8;
  --text-soft: #cfccc3;
  --muted: #96958f;
  --muted-strong: #b2afa6;
  --gold: #c6a75b;
  --gold-strong: #e0c576;
  --gold-dark: #6e5a2f;
  --green: #54cd94;
  --green-soft: #17392b;
  --red: #ff7b77;
  --red-soft: #40201f;
  --blue: #76a9ff;
  --blue-soft: #182840;
  --warning: #efc35d;
  --radius: 8px;
  --nav-height: 68px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #050607;
  color: var(--text);
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

.list-load-more { margin: 12px 16px 88px; width: calc(100% - 32px); }

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-strong);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  color: #08090a;
  background: var(--gold-strong);
  border-radius: 4px;
}

.skip-link:focus {
  top: 8px;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}

.screen {
  min-height: 100dvh;
  background: var(--bg);
}

.screen.with-nav {
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 8px 16px;
  background: rgba(8, 9, 10, 0.96);
  border-bottom: 1px solid var(--border);
}

.app-bar-title {
  flex: 1;
  min-width: 0;
}

.app-bar-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  line-height: 1.3;
}

.app-bar-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.icon-button:hover,
.icon-button:active {
  color: var(--gold-strong);
  background: var(--surface-raised);
}

.icon-button svg,
.nav-item svg,
.inline-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 430px);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 7px 8px env(safe-area-inset-bottom);
  grid-template-columns: repeat(5, 1fr);
  background: #0d0e0f;
  border-top: 1px solid var(--border);
  transform: translateX(-50%);
}

.nav-item {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
}

.nav-item.active {
  color: var(--gold-strong);
  background: #18160f;
}

.content {
  padding: 14px 16px 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
}

.section-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.section-title span,
.section-title button {
  color: var(--muted);
  font-size: 11px;
}

.section-title button {
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  border: 0;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 650;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-button {
  color: #100e08;
  background: var(--gold-strong);
  border: 1px solid var(--gold-strong);
}

.primary-button:hover,
.primary-button:active {
  background: #ecd58f;
}

.secondary-button {
  color: var(--text-soft);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
}

.full-button {
  width: 100%;
}

.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--gold-strong);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--muted);
  border-radius: 50%;
}

.status-dot.good {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(84, 205, 148, 0.1);
}

.status-dot.warn {
  background: var(--warning);
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: var(--muted-strong);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.tag.good {
  color: #9ce8bf;
  background: var(--green-soft);
  border-color: #285f47;
}

.tag.warn {
  color: #f0d58c;
  background: #382e19;
  border-color: #655226;
}

.tag.red {
  color: #ffaaa7;
  background: var(--red-soft);
  border-color: #683331;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

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

.team-display {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.team-flag {
  flex: 0 0 auto;
  width: 1.25em;
  font-size: 0.92em;
  line-height: 1;
  text-align: center;
}

.team-versus {
  color: var(--text-muted);
  font-size: 0.86em;
}

.team-unmapped {
  color: var(--warning, #e7c86d);
}

@media (min-width: 520px) {
  .app-shell {
    min-height: 844px;
    margin: 24px auto;
    border: 1px solid var(--border-strong);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  }

  .screen {
    min-height: 844px;
  }
}

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