:root {
  --bg: #000000;
  --panel: #050505;
  --panel-border: #161616;
  --panel-soft: #0b0b0b;
  --text: #ffffff;
  --muted: #8f8f8f;
  --line: #101010;
  --accent: #18c99c;
  --accent-dim: rgba(24, 201, 156, 0.15);
  --danger: #ef4444;
  --warn: #f0a500;
  --ok: #16d6a7;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-shell, .console-page {
  min-height: 100vh;
  background: var(--bg);
}

.topbar, .console-topbar {
  height: 78px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 10px;
}

.brand, .console-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(24, 201, 156, 0.12);
  border: 1px solid rgba(24, 201, 156, 0.2);
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px;
}

.brand-icon span {
  display: block;
  width: 100%;
  height: 7px;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
}

.brand h1, .console-title-wrap h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.brand p {
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: #d8d8d8;
  background: #070707;
}

.logout-link {
  color: var(--muted);
}

.dashboard-main {
  padding: 14px 10px 0;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 110px;
}

.server-card {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: #020202;
  padding: 14px 14px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.server-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #1d1d1d;
  background: #111111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.server-endpoint {
  color: #a4a4a4;
  font-size: 15px;
}

.icon-delete {
  background: transparent;
  border: 0;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
}

.connect-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 9px;
  border: 1px solid rgba(24, 201, 156, 0.18);
  background: linear-gradient(90deg, rgba(10, 45, 36, 0.9), rgba(6, 40, 31, 0.98));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
}

.bottom-cta-wrap {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottom-cta {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  background: var(--accent);
  color: #00170f;
  font-weight: 700;
  cursor: pointer;
}

.footer-note {
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: grid;
  place-items: center;
  padding: 20px;
}

.hidden { display: none; }

.modal-card {
  width: min(100%, 430px);
  border-radius: 18px;
  background: #020202;
  border: 1px solid #202020;
  padding: 26px 28px 30px;
  position: relative;
}

.modal-card h2 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 34px;
  line-height: 1;
  background: transparent;
  color: #cbcbcb;
  border: 0;
  cursor: pointer;
}

.server-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.server-form label {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-form span {
  font-size: 18px;
  font-weight: 700;
}

.server-form input, .server-form select, .command-bar input {
  width: 100%;
  height: 56px;
  background: #030303;
  color: var(--text);
  border: 1px solid #242424;
  border-radius: 10px;
  padding: 0 16px;
  outline: none;
}

.server-form input:focus, .server-form select:focus, .command-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(24, 201, 156, 0.18);
}

.save-btn {
  margin-top: 10px;
  height: 58px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #00170f;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.form-message {
  margin: 0;
  color: #ff8b8b;
  min-height: 20px;
}

.empty-state {
  min-height: 180px;
  border: 1px dashed #1f1f1f;
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 520px);
}

.auth-card {
  border: 1px solid var(--panel-border);
  background: #020202;
  border-radius: 22px;
  padding: 28px;
}

.brand-center {
  justify-content: center;
  margin-bottom: 30px;
}

.auth-copy h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.auth-copy p, .auth-hint {
  color: var(--muted);
  line-height: 1.5;
}

.steam-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 24px 0 14px;
  border-radius: 12px;
  background: var(--accent);
  color: #00170f;
  font-weight: 800;
}

.console-page {
  display: grid;
  grid-template-rows: 78px 1fr 62px;
}

.back-link {
  font-size: 34px;
  color: #d3d3d3;
  margin-right: 4px;
}

.console-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #777;
}

.status-dot.connected {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(24, 201, 156, 0.6);
}

.console-output {
  padding: 10px 12px 18px;
  overflow: auto;
  font-family: Consolas, Monaco, Menlo, monospace;
  font-size: 16px;
  line-height: 1.55;
  border-bottom: 1px solid var(--panel-border);
}

.console-line { white-space: pre-wrap; }
.console-line.warn { color: var(--warn); font-style: italic; }
.console-line.ok { color: var(--ok); }
.console-line.error { color: #ff6b6b; }
.console-line.cmd { color: #9ae6b4; }
.console-line.muted { color: #7a7a7a; }

.command-bar {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  padding: 8px 10px;
}

.command-bar button {
  border: 0;
  border-radius: 8px;
  background: #0e7e62;
  color: #041b15;
  font-size: 21px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .topbar, .console-topbar {
    height: auto;
    min-height: 72px;
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .modal-card {
    padding: 22px;
  }
}
