/* ResinCraft Console: the launcher's look (near-black, purple to click, cyan for data, green for play). */
:root {
  --bg: #0a0912;
  --bg-side: #0d0b16;
  --surface: #13111d;
  --surface-2: #1a1727;
  --surface-3: #231f33;
  --border: #262238;
  --border-strong: #372f4f;
  --text: #eeecf6;
  --dim: #a8a3bd;
  --faint: #7a7492;
  --accent: #b26bff;
  --accent-hover: #c48bff;
  --accent-soft: rgba(178, 107, 255, 0.13);
  --accent-fg: #0b0616;
  --data: #22d3ee;
  --ok: #39ff88;
  --ok-soft: rgba(57, 255, 136, 0.12);
  --warn: #f5c542;
  --bad: #ff5c6a;
  --bad-soft: rgba(255, 92, 106, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --head: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
}
h1,
h2,
h3 {
  font-family: var(--head);
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 19px;
}
.boot {
  padding: 40px;
  color: var(--dim);
}
.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.data {
  color: var(--data);
}
.dim {
  color: var(--dim);
}
.small {
  font-size: 13px;
}
.ok {
  color: var(--ok);
}
.bad {
  color: var(--bad);
}

/* Layout */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--top-bg, rgba(10, 9, 18, 0.88));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--head);
  font-weight: 700;
  font-size: 17px;
}
.brand img {
  width: 26px;
  height: 26px;
}
.top .grow {
  flex: 1;
}
.device {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot.on {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.center {
  max-width: 480px;
  margin: 10vh auto 0;
  text-align: center;
}
.center .card {
  padding: 28px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.end {
  justify-content: flex-end;
}
.spread {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.stack > * + * {
  margin-top: 14px;
}

/* Controls */
button,
.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover,
.btn:hover {
  border-color: var(--accent);
}
button.primary,
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
button.primary:hover {
  background: var(--accent-hover);
}
button.play {
  background: #39ff88;
  border-color: #39ff88;
  color: #04140a;
}
button.danger {
  border-color: rgba(255, 92, 106, 0.5);
  color: var(--bad);
}
button.ghost {
  background: transparent;
}
button.sm {
  padding: 5px 10px;
  font-size: 13px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
input,
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
label.field span em {
  font-weight: 400;
  color: var(--dim);
  font-style: normal;
}
label.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 400;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--dim);
}
.badge.running {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.starting,
.badge.stopping {
  background: rgba(245, 197, 66, 0.12);
  color: var(--warn);
}
.badge.crashed,
.badge.error {
  background: var(--bad-soft);
  color: var(--bad);
}

/* Servers */
.server h3 {
  margin: 8px 0 2px;
}
.server .addr {
  margin: 0 0 12px;
  word-break: break-all;
}
.server .meta {
  color: var(--dim);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 16px;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--dim);
  padding: 10px 14px;
  white-space: nowrap;
}
.tabs button.on {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Console */
.log {
  background: var(--log-bg, #07060d);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 56vh;
  overflow: auto;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.log .warn {
  color: var(--warn);
}
.log .error {
  color: var(--bad);
}
.cmd {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cmd input {
  flex: 1;
  font-family: var(--mono);
}

/* Lists */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.list li:last-child {
  border-bottom: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--faint);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress */
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--data));
  transition: width 0.3s;
}
.choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choices button.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.hits button {
  width: 100%;
  justify-content: space-between;
  text-align: left;
}
.hits button.on {
  border-color: var(--accent);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 16px;
  display: none;
  max-width: calc(100vw - 32px);
  z-index: 10;
}
#toast.show {
  display: block;
}
#toast.bad {
  border-color: var(--bad);
  color: var(--bad);
}

@media (max-width: 640px) {
  .top {
    padding: 10px 14px;
  }
  main {
    padding: 18px 14px 50px;
  }
  .log {
    height: 50vh;
  }
}

/* Theme editor */
.theme-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 90px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.swatch {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  font-size: 12px;
}
.swatch .chips {
  display: flex;
  gap: 4px;
}
.swatch .chips i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(127, 127, 127, 0.4);
}
.swatch.on {
  border-color: var(--accent);
}
.colors {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  font-size: 14px;
}
.colors input[type='color'] {
  width: 46px;
  height: 32px;
  padding: 2px;
  cursor: pointer;
}
