:root {
  --bg: #10090b;
  --bg-2: #1a1013;
  --panel: #221418;
  --line: #3a242a;
  --text: #f4e8e4;
  --muted: #b89aa0;
  --red: #e23b3b;
  --red-2: #ff6b6b;
  --green: #3ecf7a;
  --amber: #f0b429;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(226, 59, 59, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 1px solid var(--line);
  background: #2b181d;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

button:hover,
.upload:hover {
  border-color: var(--red);
}

button.primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

button.danger {
  background: #5a1518;
  border-color: #8a2328;
}

button.ghost {
  width: 100%;
  margin-top: auto;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  background: #140c0e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

textarea {
  min-height: 280px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}

label {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card,
.panel,
.sidebar,
.status-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem;
  border-radius: 20px;
}

.eyebrow,
.muted,
.sidebar small {
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.heart {
  color: var(--red);
  font-size: 1.8rem;
}

.sidebar nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar nav button {
  text-align: left;
}

.sidebar nav button.active {
  background: var(--red);
  border-color: var(--red);
}

main {
  padding: 1.4rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.status-pill {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.status-pill.running {
  color: var(--green);
}
.status-pill.starting,
.status-pill.stopping {
  color: var(--amber);
}
.status-pill.stopped {
  color: var(--red-2);
}

.power-row,
.button-grid,
.file-actions,
.row-between,
.player-row,
.file-row {
  display: flex;
  gap: 0.7rem;
}

.power-row,
.button-grid {
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.card,
.panel {
  padding: 1rem;
  border-radius: 16px;
}

.card span,
.card small {
  color: var(--muted);
}

.card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.15rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.row-between {
  justify-content: space-between;
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

.join-list,
.plain-list {
  padding-left: 1.1rem;
}

.console-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 170px);
}

#console-log {
  flex: 1;
  margin: 0 0 0.8rem;
  overflow: auto;
  background: #0d0708;
  border-radius: 12px;
  padding: 1rem;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
}

.console-form {
  display: flex;
  gap: 0.6rem;
}

.player-list,
.file-list {
  display: grid;
  gap: 0.55rem;
}

.player-row,
.file-row {
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.8rem;
  background: #140c0e;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.file-row {
  cursor: pointer;
}

.crumbs {
  color: var(--muted);
}

.upload {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #2b181d;
  cursor: pointer;
}

.upload input {
  display: none;
}

.spaced {
  margin-top: 1.4rem;
}

.error {
  color: var(--red-2);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  /* extra small-screen polish */
  main {
    padding: 1rem;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .status-pill {
    align-self: flex-start;
  }

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

  .sidebar nav button {
    text-align: center;
    padding: 0.6rem 0.4rem;
    font-size: 0.9rem;
  }

  .console-form {
    flex-wrap: wrap;
  }

  .console-form button {
    flex: 1;
  }

  .power-row button {
    flex: 1;
  }

  .file-actions {
    flex-wrap: wrap;
  }
}
