:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10151c;
  color: #e9eef5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 10% -20%, rgb(77 120 160 / 19%), transparent 42rem),
    #10151c;
}

.page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 32px;
}

.topbar,
.control-row,
.speech-controls,
.world-heading,
.boss-row,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 24px;
  padding-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8ab9e4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 43px);
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 10px 0 0;
  color: #98a6b5;
}

.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #aab5c2;
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #efb65d;
  box-shadow: 0 0 12px rgb(239 182 93 / 45%);
}

.dot.online {
  background: #62d39b;
  box-shadow: 0 0 12px rgb(98 211 155 / 55%);
}

.dot.offline {
  background: #e16e75;
  box-shadow: 0 0 12px rgb(225 110 117 / 45%);
}

.controls {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.control-row {
  gap: 16px;
}

.search {
  flex: 1;
  max-width: 520px;
}

.search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #2b3542;
  border-radius: 10px;
  outline: none;
  background: #171e27;
  color: #eef4fb;
  font: inherit;
}

.search input:focus {
  border-color: #6da7d7;
  box-shadow: 0 0 0 3px rgb(109 167 215 / 15%);
}

.summary {
  margin: 0;
  color: #8391a1;
  font-size: 13px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #98a6b5;
  font-size: 13px;
}

.sort-control select,
.filter-heading button {
  padding: 10px 12px;
  border: 1px solid #2b3542;
  border-radius: 9px;
  background: #171e27;
  color: #e9eef5;
  font: inherit;
}

.boss-filter {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.boss-filter summary {
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid #2b3542;
  border-radius: 9px;
  color: #b7c4d1;
  cursor: pointer;
  font-size: 13px;
  list-style-position: inside;
}

.filter-panel {
  position: absolute;
  z-index: 2;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid #344354;
  border-radius: 10px;
  background: #1b242e;
  box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #aab8c7;
  font-size: 12px;
}

.filter-heading button {
  padding: 6px 9px;
  cursor: pointer;
  font-size: 11px;
}

.boss-options {
  display: grid;
  gap: 2px;
  max-height: 250px;
  overflow-y: auto;
}

.boss-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 5px;
  border-radius: 6px;
  color: #d5dee7;
  cursor: pointer;
  font-size: 13px;
}

.boss-option:hover {
  background: #273340;
}

.boss-option input {
  accent-color: #78b4e8;
}

.speech-controls {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.speech-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7c4d1;
  cursor: pointer;
  font-size: 13px;
}

.speech-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #78b4e8;
}

.speech-controls select {
  padding: 8px 10px;
}

.test-voice {
  padding: 8px 11px;
  border: 1px solid #344354;
  border-radius: 8px;
  background: #202b37;
  color: #d5dee7;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.speech-controls :disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.speech-status {
  color: #8391a1;
  font-size: 12px;
}

.worlds {
  display: grid;
  gap: 14px;
}

.world-card {
  overflow: hidden;
  border: 1px solid #293440;
  border-radius: 13px;
  background: #171e27;
  box-shadow: 0 7px 24px rgb(0 0 0 / 12%);
}

.world-heading {
  gap: 16px;
  padding: 17px 19px;
  border-bottom: 1px solid #293440;
  background: #1b242e;
}

.world-heading h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.world-meta {
  margin-top: 5px;
  color: #8694a3;
  font-size: 12px;
}

.count {
  flex: none;
  padding: 5px 9px;
  border: 1px solid #344354;
  border-radius: 999px;
  color: #afc9df;
  font-size: 12px;
}

.boss-list {
  padding: 0 19px;
}

.boss-row {
  min-height: 57px;
  gap: 16px;
  border-bottom: 1px solid #252e38;
}

.boss-row:last-child {
  border-bottom: 0;
}

.boss-name {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.boss-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-badge {
  padding: 4px 7px;
  border: 1px solid #344354;
  border-radius: 6px;
  color: #afc9df;
  font-size: 11px;
  white-space: nowrap;
}

.sorted-boss-card {
  padding: 0 19px;
}

.sorted-boss-card .boss-row {
  border-bottom: 0;
}

.boss-details {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: #8997a6;
  font-size: 12px;
  text-align: right;
}

.state {
  min-width: 84px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #2b3541;
  color: #c6d0db;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.state.ready,
.state.spawned {
  background: rgb(58 139 100 / 19%);
  color: #79dda9;
}

.state.spawning {
  background: rgb(180 117 47 / 20%);
  color: #f4bf70;
}

.empty {
  padding: 54px 20px;
  color: #8997a6;
  text-align: center;
}

footer {
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 26px;
  color: #718090;
  font-size: 11px;
}

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

@media (max-width: 620px) {
  .page {
    width: min(100% - 26px, 1100px);
    padding-top: 32px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .control-row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .search {
    width: 100%;
  }

  .world-heading {
    padding: 15px;
  }

  .boss-list {
    padding: 0 15px;
  }

  .boss-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
  }

  .boss-details {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .boss-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .sorted-boss-card {
    padding: 0 15px;
  }
}
