@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #090909;
  --surface: #111;
  --surface2: #161616;
  --border: rgba(255, 255, 255, 0.07);
  --text: #f2f2f2;
  --muted: #777;
  --accent: #e8e8e8;
  --ok: #5ecf9a;
  --warn: #e0b060;
  --bad: #e07070;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: drift 22s linear infinite;
}

.grid-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, transparent 25%, var(--bg) 75%);
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(36px, 36px); }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  font-size: 15px;
}

.nav-admin {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s;
}

.nav-admin:hover {
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--surface2);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero-copy p { color: var(--muted); font-size: 14px; max-width: 44ch; margin-bottom: 22px; }
.hero-copy code { font-size: 12px; color: #aaa; }

.launcher-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #090909;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  width: fit-content;
  max-width: 100%;
}

.launcher-titlebar {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #090909;
  border-bottom: 1px solid var(--border);
}

.launcher-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #f2f2f2;
}

.launcher-winbtns {
  display: flex;
  gap: 10px;
}

.launcher-winbtns i {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.launcher-frame {
  display: block;
  border: none;
  width: 560px;
  height: 420px;
  max-width: 100%;
  background: #090909;
}

@media (max-width: 960px) {
  .launcher-frame {
    width: min(560px, 100vw - 48px);
    height: calc(min(560px, 100vw - 48px) * 0.75);
  }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero p { color: var(--muted); font-size: 14px; max-width: 44ch; margin-bottom: 22px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

a.btn { text-decoration: none; }
.btn:hover { border-color: rgba(255,255,255,.18); background: var(--surface2); }
.btn.primary { background: #f2f2f2; color: #0a0a0a; border-color: transparent; font-weight: 600; }

.btn.disabled {
  color: #555;
  background: #111;
  border-color: rgba(255, 255, 255, 0.04);
  cursor: not-allowed;
  opacity: 0.85;
  pointer-events: none;
}

.preview {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(165deg, #121212, #0c0c0c);
  padding: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.preview-chrome {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #333; }
.dot:nth-child(1) { background: #5a3; }
.dot:nth-child(2) { background: #a83; }
.dot:nth-child(3) { background: #a55; }

.mock-ui {
  border-radius: 10px;
  background: #090909;
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 280px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

.mock-sidebar { display: flex; flex-direction: column; gap: 6px; }
.mock-tab {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.mock-tab.active {
  color: var(--text);
  background: #151515;
  border-color: var(--border);
}

.mock-panel h3 { font-size: 12px; margin-bottom: 10px; font-weight: 500; }
.mock-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.mock-row span:last-child { color: #bbb; }

.features {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 800px) { .features { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255,255,255,.02);
}

.card h4 { font-size: 13px; margin-bottom: 6px; }
.card p { font-size: 12px; color: var(--muted); }

/* admin */
.admin-app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 720px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 20px;
}

.admin-nav-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.admin-nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.admin-nav-btn.active {
  color: var(--text);
  background: #151515;
  border-color: var(--border);
}

.admin-pages {
  min-width: 0;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
  animation: admin-fade 0.2s ease;
}

@keyframes admin-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-bd-tall {
  max-height: min(70vh, 640px);
}

.panel-bd-pad {
  padding: 12px;
}

.toolbar-input {
  flex: 1;
  min-width: 100px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.toolbar-input-narrow {
  flex: 0 0 72px;
  min-width: 72px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.panel-hd {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.panel-bd { padding: 0; max-height: 420px; overflow: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: top; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
tr:hover td { background: rgba(255,255,255,.02); }

.tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 10px; border: 1px solid var(--border); color: #bbb; }
.tag.ok { color: var(--ok); border-color: rgba(94,207,154,.35); }
.tag.bad { color: var(--bad); border-color: rgba(224,112,112,.35); }

.admin-login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.admin-login-card {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.admin-login-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--text);
  margin-bottom: 6px;
}

.admin-login-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #555;
  margin-bottom: 32px;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.admin-login-form input {
  width: 100%;
  padding: 11px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-login-form input::placeholder {
  color: #666;
  text-transform: lowercase;
}

.admin-login-form input:focus {
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

.admin-login-submit {
  margin-top: 22px;
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #888;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.admin-login-submit:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.admin-login-err {
  min-height: 16px;
  margin-top: 16px;
  font-size: 11px;
  text-align: center;
  color: var(--bad);
  letter-spacing: 0.02em;
}

.admin-login-err:empty {
  display: none;
}

.login-box {
  max-width: 360px;
  margin: 12vh auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 22px;
}

.login-box h2 { font-size: 16px; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar .btn { padding: 7px 11px; font-size: 12px; }

.log-line { font-family: ui-monospace, Consolas, monospace; font-size: 11px; white-space: pre-wrap; }
.log-warn { color: var(--warn); }
.log-error { color: var(--bad); }

.hidden { display: none !important; }
