:root {
  color-scheme: dark;
  --background: #070806;
  --background-deep: #030403;
  --surface: #151712;
  --surface-raised: #20231d;
  --surface-input: #252920;
  --surface-muted: #2b3026;
  --acid: #cfdf13;
  --shield: #58a82e;
  --warning: #fad614;
  --zombie: #c71c18;
  --bone: #eceee6;
  --muted: #bdc1b3;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(207, 223, 19, 0.35);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --sidebar-width: 286px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(207, 223, 19, 0.12), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(199, 28, 24, 0.1), transparent 28rem),
    linear-gradient(180deg, #0b0e08, var(--background-deep));
  color: var(--bone);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(380px, 480px);
  width: min(100%, 1080px);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 11, 8, 0.96);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.52);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: 46px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(6, 7, 5, 0.2)),
    linear-gradient(145deg, rgba(207, 223, 19, 0.1), transparent 48%),
    #0d100b;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: auto;
  border: 1px solid rgba(207, 223, 19, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(207, 223, 19, 0.95), rgba(88, 168, 46, 0.9));
  color: #050604;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  font-size: 1.8rem;
  font-weight: 950;
  letter-spacing: 0;
}

.auth-intro h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--bone);
  font-size: clamp(3.4rem, 6vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.auth-intro > p:not(.eyebrow) {
  max-width: 27rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-screen.is-compact .auth-card {
  max-width: 520px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 24, 21, 0.96);
  box-shadow: var(--shadow);
}

.auth-card {
  align-self: center;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card img {
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
}

.auth-mark.small {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.auth-card h1,
.auth-card h2 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0;
}

.auth-card-header {
  margin-bottom: 24px;
}

.auth-card > p,
.auth-card-header p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.auth-card > .auth-form {
  margin-top: 22px;
}

.auth-card-header + .auth-form {
  margin-top: 0;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.auth-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(37, 41, 32, 0.86);
  font-size: 1rem;
}

.auth-form input:focus {
  border-color: var(--line-strong);
  outline: 3px solid rgba(207, 223, 19, 0.14);
}

.auth-form .primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
}

.auth-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  min-height: 34px;
  margin-top: 12px;
}

.auth-secondary-actions.spread {
  justify-content: space-between;
}

.text-button {
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--acid);
  font-size: 0.9rem;
  font-weight: 850;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--bone);
  outline: none;
}

.auth-message {
  min-height: 24px;
  margin-top: 14px;
  color: #ff8a82;
  font-weight: 800;
  line-height: 1.4;
}

.app-shell {
  display: none;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

body:not(.is-admin-authenticated) .app-shell,
.auth-state .app-shell {
  display: none !important;
}

body.is-admin-authenticated .auth-screen {
  display: none !important;
}

body.is-admin-authenticated .app-shell {
  display: grid;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 7, 0.96);
  box-shadow: 14px 0 42px rgba(0, 0, 0, 0.2);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid rgba(207, 223, 19, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(207, 223, 19, 0.96), rgba(88, 168, 46, 0.88));
  color: #050604;
  font-size: 0.95rem;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.25rem;
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
}

.nav-item:hover,
.nav-item:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--bone);
  outline: none;
}

.nav-item.is-active {
  border-color: var(--line-strong);
  background: rgba(207, 223, 19, 0.12);
  color: var(--acid);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--acid);
  font-size: 0.78rem;
}

.access-card,
.panel,
.metric-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 24, 21, 0.94);
  box-shadow: var(--shadow);
}

.access-card {
  margin-top: auto;
  padding: 16px;
}

.access-card h2 {
  margin: 4px 0 8px;
  font-size: 1rem;
}

.access-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.main-panel {
  min-width: 0;
  padding: 32px 34px;
}

.topbar,
.section-heading,
.panel-header,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.section-heading h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.5rem, 2vw, 2.25rem);
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 1.55rem;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--acid);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-select {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.game-select span {
  font-size: 0.82rem;
}

select,
input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-input);
  color: var(--bone);
}

select {
  padding: 0 28px 0 10px;
}

input {
  padding: 0 12px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 900;
}

.primary-button {
  border: 0;
  padding: 0 16px;
  background: var(--acid);
  color: #050604;
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--bone);
}

.secondary-button {
  padding: 0 14px;
}

.icon-button {
  width: 42px;
  font-size: 1.1rem;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  color: var(--acid);
  font-size: 2rem;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.wide {
  min-width: 0;
}

.population-bars {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.population-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-raised);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.queue-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.queue-list article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.queue-list strong,
.queue-list span {
  display: block;
}

.queue-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-chip,
.faction-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-chip.live {
  background: var(--acid);
  color: #050604;
}

.faction-pill.human {
  background: rgba(250, 214, 20, 0.18);
  color: var(--warning);
}

.faction-pill.zombie {
  background: rgba(199, 28, 24, 0.18);
  color: #ff8a82;
}

.faction-pill.spectator {
  background: rgba(189, 193, 179, 0.16);
  color: var(--muted);
}

.faction-pill.admin,
.faction-pill.moderator {
  background: rgba(207, 223, 19, 0.16);
  color: var(--acid);
}

.table-toolbar {
  margin-bottom: 14px;
}

.table-toolbar input {
  width: min(360px, 100%);
}

.segmented-control {
  display: flex;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.segmented-control button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-active {
  background: var(--acid);
  color: #050604;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  color: var(--bone);
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--acid);
  font-size: 0.86rem;
  font-weight: 950;
}

.subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-top: 14px;
  border: 1px dashed rgba(207, 223, 19, 0.52);
  border-radius: var(--radius);
  background: rgba(207, 223, 19, 0.07);
  text-align: center;
}

.upload-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-zone strong {
  display: block;
  color: var(--acid);
  font-size: 1.05rem;
}

.upload-zone span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.import-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--muted);
  line-height: 1.5;
}

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

.objective-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.objective-card h3,
.report-card strong {
  margin: 0;
  font-size: 1.05rem;
}

.objective-card p,
.report-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.objective-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.report-card {
  width: 100%;
  min-height: 126px;
  padding: 18px;
  color: var(--bone);
  text-align: left;
}

.report-card:hover,
.report-card:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.report-card.pending {
  opacity: 0.62;
}

.settings-panel {
  display: grid;
  gap: 14px;
  max-width: 680px;
}

.settings-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 850;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.toggle-row input {
  min-height: auto;
  width: 20px;
  height: 20px;
  accent-color: var(--acid);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #10110e;
  color: var(--bone);
  box-shadow: var(--shadow);
  font-weight: 850;
}

@media (max-width: 1100px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-intro {
    min-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(6, 7, 5, 0.2)),
      linear-gradient(145deg, rgba(207, 223, 19, 0.1), transparent 48%),
      #0d100b;
  }

  .auth-intro h1 {
    max-width: none;
    font-size: 3.5rem;
  }

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

  .dashboard-grid,
  .objective-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    padding: 18px;
  }

  .auth-intro,
  .auth-card {
    padding: 26px;
  }

  .auth-secondary-actions,
  .auth-secondary-actions.spread {
    justify-content: flex-start;
  }

  .auth-intro {
    min-height: 260px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(6, 7, 5, 0.22)),
      linear-gradient(145deg, rgba(207, 223, 19, 0.1), transparent 48%),
      #0d100b;
  }

  .auth-intro h1,
  .auth-card h1,
  .auth-card h2 {
    font-size: 2.35rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .nav-icon,
  .access-card {
    display: none;
  }

  .main-panel {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .table-toolbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .game-select,
  .primary-button,
  .secondary-button {
    justify-content: center;
    width: 100%;
  }

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

  .segmented-control {
    overflow-x: auto;
  }

  .segmented-control button {
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  .nav-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }
}
