/* ===== The Operator Arcade — shared design system ===== */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #232735;
  --border: #2e3344;
  --text: #e8eaf2;
  --muted: #9aa0b4;
  --accent: #f5a623;
  --accent-dark: #d18a0f;
  --green: #3ecf8e;
  --red: #ff5c5c;
  --blue: #4f8cff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: 16px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.5px; }
h2 { font-size: 20px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

a { color: var(--accent); text-decoration: none; }

/* Top bar with back link */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.back:hover { color: var(--text); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--accent);
  color: #14110a;
  transition: transform 0.06s ease, filter 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn.block { width: 100%; }
.btn.sm { font-size: 13px; padding: 8px 14px; border-radius: 10px; }

/* Stat pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pill .v { color: var(--accent); }
.pill.good .v { color: var(--green); }
.pill.bad .v { color: var(--red); }

/* HUD row */
.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 14, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.hidden { display: none !important; }

/* Utility */
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--accent); }

/* Hub tiles */
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.tile .emoji { font-size: 34px; display: block; margin-bottom: 10px; }
.tile h2 { color: var(--text); }
.tile .meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.tile .meta .v { color: var(--accent); }

@media (min-width: 560px) {
  .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* Slider */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}

/* Log feed */
.log {
  font-size: 13px;
  line-height: 1.6;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.log div { padding: 2px 0; border-bottom: 1px dashed var(--border); }
.log div:last-child { border-bottom: none; }
