:root {
  color-scheme: dark;
  --bg: #080d0c;
  --panel: #101816;
  --line: #263a34;
  --text: #eff8f3;
  --muted: #91a69e;
  --gold: #d7a73a;
  --gold-light: #f3cf72;
  --green: #62d699;
  --red: #f07178;
  --orange: #f2ad62;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 0%, rgba(72, 112, 95, 0.18), transparent 28rem),
    radial-gradient(circle at 5% 65%, rgba(215, 167, 58, 0.06), transparent 24rem),
    linear-gradient(145deg, #080d0c 0%, #0b1210 55%, #080c0b 100%);
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
pre:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(243, 207, 114, 0.55);
  outline-offset: 3px;
}

.login-page,
.error-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.login-shell {
  width: min(100%, 29rem);
}

.login-card,
.server-card,
.logs-card,
.propaganda-banner {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(20, 32, 29, 0.98), rgba(13, 21, 19, 0.98));
  box-shadow: var(--shadow);
}

.login-card {
  padding: clamp(1.75rem, 6vw, 3rem);
  border-radius: 1.25rem;
}

.brand-mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.75rem;
  place-items: center;
  border: 1px solid #8a6a26;
  border-radius: 0.65rem 0.65rem 1.2rem 0.65rem;
  color: #111713;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  box-shadow: 0 10px 35px rgba(215, 167, 58, 0.17);
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
}

.brand-mark-small {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  border-radius: 0.5rem 0.5rem 0.9rem 0.5rem;
  font-size: 1.15rem;
}

.eyebrow {
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.login-copy {
  margin-bottom: 1.15rem;
  color: var(--muted);
  line-height: 1.65;
}

.login-copy strong {
  color: #e8cf8d;
}

.propaganda-quote {
  margin: 0 0 1.5rem;
  border-left: 2px solid var(--gold);
  padding: 0.1rem 0 0.1rem 0.85rem;
  color: #c9d9d2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 0.65rem;
}

.login-form label {
  margin-top: 0.55rem;
  color: #c9d9d2;
  font-size: 0.9rem;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #344942;
  border-radius: 0.65rem;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  background: #0a100e;
}

.login-form input:hover,
.login-form input:focus {
  border-color: #6c887e;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.7rem 1rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.button-wide {
  width: 100%;
  margin-top: 1rem;
}

.button-primary {
  color: #16140d;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  box-shadow: 0 8px 30px rgba(215, 167, 58, 0.14);
}

.button-link {
  margin-top: 0.5rem;
}

.button-ghost {
  border-color: #334840;
  color: #c5d8d0;
  background: rgba(255, 255, 255, 0.025);
}

.button-ghost:hover:not(:disabled) {
  border-color: #617b72;
  background: rgba(255, 255, 255, 0.055);
}

.button-start {
  border-color: rgba(98, 214, 153, 0.38);
  color: #9ce8bc;
  background: rgba(54, 157, 103, 0.13);
}

.button-stop {
  border-color: rgba(240, 113, 120, 0.34);
  color: #ffa0a5;
  background: rgba(190, 67, 74, 0.12);
}

.button-restart {
  border-color: rgba(242, 173, 98, 0.34);
  color: #f7c58f;
  background: rgba(189, 117, 40, 0.12);
}

.alert {
  margin-bottom: 1rem;
  border: 1px solid;
  border-radius: 0.65rem;
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.alert-error {
  border-color: rgba(240, 113, 120, 0.4);
  color: #ffc0c3;
  background: rgba(190, 67, 74, 0.12);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(50, 73, 65, 0.65);
  padding: 0 5vw;
  background: rgba(8, 13, 12, 0.75);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
  text-decoration: none;
}

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

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.brand small {
  overflow: hidden;
  max-width: 34rem;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(20rem, 0.8fr) minmax(28rem, 1.35fr);
  gap: 1.25rem;
  width: min(92vw, 86rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) 0 2rem;
}

.propaganda-banner {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 1rem;
  border-color: rgba(215, 167, 58, 0.32);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(100deg, rgba(215, 167, 58, 0.12), rgba(20, 32, 29, 0.94));
}

.propaganda-banner > span {
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 2rem;
}

.propaganda-banner p {
  margin: 0;
  color: #dce9e3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.5;
}

.propaganda-banner strong {
  color: var(--gold-light);
}

.server-card,
.logs-card {
  border-radius: 1.1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.server-card-main,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.server-card h1 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.service-name {
  margin-bottom: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.realm-note {
  margin: 1.25rem 0 0;
  color: #c7a95e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-style: italic;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #3a4b45;
  border-radius: 99rem;
  padding: 0.5rem 0.75rem;
  color: #cad8d3;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: #8ca099;
}

.status-active {
  border-color: rgba(98, 214, 153, 0.36);
  color: #9ce8bc;
  background: rgba(54, 157, 103, 0.1);
}

.status-active .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 0.28rem rgba(98, 214, 153, 0.12);
}

.status-failed {
  border-color: rgba(240, 113, 120, 0.4);
  color: #ffa0a5;
}

.status-failed .status-dot {
  background: var(--red);
}

.status-activating .status-dot,
.status-deactivating .status-dot,
.status-reloading .status-dot {
  background: var(--orange);
  animation: pulse 1.3s infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.server-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}

.server-facts div {
  min-width: 0;
  border-left: 2px solid #314940;
  padding-left: 0.8rem;
}

.server-facts dt {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.server-facts dd {
  overflow: hidden;
  margin: 0;
  color: #dbe8e2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.feedback {
  min-height: 1.4rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.feedback-success {
  color: #9ce8bc;
}

.feedback-error {
  color: #ffa0a5;
}

.section-heading {
  align-items: center;
  margin-bottom: 0.6rem;
}

.section-heading h2 {
  margin-top: 0.35rem;
}

.section-actions,
.logs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.section-actions {
  justify-content: flex-end;
}

.logs-intro {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.logs {
  width: 100%;
  height: 26rem;
  overflow: auto;
  margin: 0;
  border: 1px solid #253a33;
  border-radius: 0.7rem;
  padding: 1rem;
  color: #abc2b9;
  background: #070b0a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.logs-archive-page {
  width: min(92vw, 86rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) 0 2rem;
}

.logs-archive-card {
  min-height: calc(100vh - 11rem);
}

.archive-heading {
  margin-bottom: 1rem;
}

.archive-heading h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.archive-intro strong {
  color: #e8cf8d;
}

.log-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.log-stats strong {
  color: var(--gold-light);
}

.logs-full {
  height: min(62vh, 42rem);
  white-space: pre;
}

.logs-actions {
  margin-top: 1rem;
}

.archive-feedback {
  flex: 1 1 18rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.archive-feedback-error {
  color: #ffa0a5;
}

.footer-propaganda {
  padding: 0 1rem 2rem;
  color: #667b73;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 880px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 1rem;
  }

  .brand small {
    display: none;
  }

  .dashboard {
    width: calc(100% - 1.5rem);
    padding: 1rem 0 2rem;
  }

  .logs-archive-page {
    width: calc(100% - 1.5rem);
    padding: 1rem 0 2rem;
  }

  .server-card-main {
    display: grid;
  }

  .section-heading,
  .archive-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    justify-content: stretch;
  }

  .section-actions .button,
  .archive-heading .button {
    flex: 1 1 auto;
  }

  .server-facts {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .propaganda-banner {
    align-items: flex-start;
  }

  .logs {
    height: 23rem;
  }
}

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