:root {
  --bg: #0b0b0f;
  --panel: #17171d;
  --panel-2: #22222b;
  --text: #f2f2f5;
  --muted: #9a9aa8;
  --accent: #5ee38b;
  --on-accent: #0b0b0f;       /* text on accent; app.js flips it for dark accents */
  --radius: 16px;
  --line: rgba(255, 255, 255, 0.07);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body.no-stars #stars { display: none; }

/* ── Floating pill nav ── */
.nav-wrap { position: sticky; top: 0; z-index: 10; padding: 14px 16px 0; }
.nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 23, 29, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 18px; font-weight: 700; text-decoration: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 4px; flex: none; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.nav-btn:hover { color: var(--text); background: var(--panel-2); }
.nav-btn.active { color: var(--on-accent); background: var(--accent); }
.nav-btn .ico { font-size: 15px; line-height: 1; font-family: "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif; }

/* ── Page ── */
main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 16px 72px; outline: none; }
main > section + section, .hero + section { margin-top: 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.hero {
  padding: 52px 32px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background: rgba(23, 23, 29, 0.72);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%), rgba(23, 23, 29, 0.72);
}
.hero.compact { padding: 40px 28px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 700; overflow-wrap: anywhere; }
.accent { color: var(--accent); }
.lead { max-width: 46ch; margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.section-head, .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
.page-head h1 { font-size: 30px; }

/* ── Cards ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card {
  --c: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45); }
.card-art {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  margin-bottom: 4px;
  border-radius: 12px;
  font-size: 46px;
  background: var(--c);
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 85%, #fff), color-mix(in srgb, var(--c) 40%, var(--bg)));
}
.card h3 { padding: 0 4px; font-size: 17px; }
.card p { margin: 0; padding: 0 4px; color: var(--muted); font-size: 13.5px; }
.empty { padding: 20px 0; }

/* ── Inputs ── */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.search { flex: 1 1 260px; max-width: 360px; }
.search .input {
  padding-left: 40px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa8' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 15px center / 16px;
}

/* ── Play page ── */
.play-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.play-title { flex: 1; min-width: 0; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-actions { display: flex; gap: 8px; }
.frame { position: relative; width: 100%; height: min(72vh, 680px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.frame:fullscreen { height: 100%; border: 0; border-radius: 0; }
.frame.max { position: fixed; inset: 0; z-index: 100; height: auto; border: 0; border-radius: 0; }
.exit-max { display: none; }
.frame.max .exit-max { display: inline-flex; position: absolute; top: 12px; right: 12px; z-index: 2; }
.play-note { margin: 12px 0 0; }

/* ── Videos ── */
.paste { display: flex; gap: 10px; max-width: 640px; }
.paste .input { flex: 1; min-width: 0; }
.form-msg { min-height: 1.5em; margin: 8px 0 0; color: #ff8a8a; font-size: 14px; }.video { position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; margin-top: 6px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fallback { margin: 10px 0 0; }
.fallback a { color: var(--accent); font-weight: 600; }
.video-card { padding: 8px 8px 12px; }
.video-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.video-card .vid { padding: 0 4px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.video-card.current { border-color: var(--accent); }

/* ── Settings dialog ── */
dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(5, 5, 8, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
dialog h2 { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field .input { border-radius: 12px; }
input[type="color"] { width: 52px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.spacer { flex: 1; }

/* ── Phone width ── */
@media (max-width: 600px) {
  .nav { gap: 6px; padding-left: 14px; }
  .nav-btn { padding: 10px 11px; }
  .nav-btn .lbl { display: none; }
  main { padding-top: 24px; }
  .hero { padding: 34px 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-art { font-size: 40px; }
  .page-head h1 { font-size: 26px; }
  .play-actions { width: 100%; }
  .play-actions .btn { flex: 1; }
  .frame { height: 68vh; }
  .paste .btn { padding: 11px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .switch, .switch::after { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}
