:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1120;
  color: #e8eef8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #17243a, #0b1120 55%);
}

.hero, main, footer {
  width: min(1100px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 38px 0 30px;
}

.brand { display: flex; align-items: center; gap: 15px; }

.brand-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
}

h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.hero p { margin: 5px 0 0; color: #94a3b8; }

.live {
  color: #86efac;
  border: 1px solid #28533f;
  background: #10291f;
  padding: 9px 12px;
  border-radius: 30px;
  font-size: .85rem;
  white-space: nowrap;
}

.live span, .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 7px;
}

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

.stats article, .toolbar, .server-card {
  border: 1px solid #263449;
  background: rgba(19, 30, 48, .92);
  border-radius: 15px;
}

.stats article { padding: 18px; }
.stats span { display: block; color: #94a3b8; font-size: .85rem; }
.stats strong { display: block; font-size: 1.8rem; margin-top: 6px; }

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1.2fr;
  gap: 10px;
  padding: 14px;
  margin-top: 22px;
}

input, select {
  width: 100%;
  min-width: 0;
  color: #e8eef8;
  background: #0c1525;
  border: 1px solid #34435b;
  border-radius: 9px;
  padding: 12px;
  font: inherit;
}

select {
  padding-right: 38px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 23px 2px 13px;
  color: #94a3b8;
  font-size: .85rem;
}

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

.server-card { padding: 18px; min-width: 0; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.game-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #252a35;
}

.game-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.game-fallback {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}
.server-title { display: flex; gap: 12px; min-width: 0; }
.server-title h2 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.server-title p { margin: 5px 0 0; color: #94a3b8; font-size: .85rem; }

.status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  font-size: .78rem;
  font-weight: 400;
  padding: 6px 9px;
  border-radius: 30px;
}

.status.running {
  color: #86efac;
  background: #123426;
}

.status.idle {
  color: #facc15;
  background: #3b3218;
}

.status.stopped {
  color: #fca5a5;
  background: #451f25;
}

.status.running .status-dot {
  background: #4ade80;
}

.status.idle .status-dot {
  background: #facc15;
}

.status.stopped .status-dot {
  background: #f87171;
}

.connection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #263449;
}

.address { min-width: 0; }
.address small { display: block; color: #94a3b8; margin-bottom: 5px; }
.address code { overflow-wrap: anywhere; color: #bfdbfe; font-size: .9rem; }

button {
  flex-shrink: 0;
  border: 1px solid #405473;
  background: #22344e;
  color: white;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
}

button:hover { background: #304a6c; }
button:disabled { opacity: .45; cursor: not-allowed; }

.protocol { color: #94a3b8; font-size: .8rem; margin-top: 10px; }
.message { color: #94a3b8; padding: 24px 0; }
.error { color: #fca5a5; margin-top: 16px; }
footer { color: #64748b; text-align: center; padding: 32px 0; font-size: .85rem; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: #1e3a2c;
  border: 1px solid #397653;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.toast.visible { opacity: 1; }

@media (max-width: 760px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .server-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .stats { gap: 8px; }
  .stats article { padding: 12px; }
  .stats strong { font-size: 1.5rem; }
  .toolbar { grid-template-columns: 1fr; }
  .results-bar { flex-direction: column; }
  .card-top { flex-direction: column; }
}
.connection-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.steam-connect {
  background: #2563eb;
  border-color: #3b82f6;
}

.steam-connect:hover {
  background: #1d4ed8;
}
.status-filter-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
  color: #e8eef8;
  background: #0c1525;
  border: 1px solid #34435b;
  border-radius: 9px;
  font: inherit;
}

.status-filter-dropdown summary {
  position: relative;
  padding: 12px 38px 12px 12px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.status-filter-dropdown summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}

.status-filter-dropdown[open] summary::after {
  transform: translateY(-25%) rotate(225deg);
}

.status-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 100%;
  min-width: 170px;
  padding: 8px;
  background: #111c2e;
  border: 1px solid #34435b;
  border-radius: 9px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.status-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
}

.status-options label:hover {
  background: #22344e;
}

.status-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  accent-color: #60a5fa;
  cursor: pointer;
}
