/* Layout: profile rail on the left (stacks on top on phones), builds grid on the right.
   Single dark look on purpose: "Toxic Teal" — deep teal ground, one mint accent for codes and actions. */
:root {
  --bg: #06171a;
  --surface: #0d2226;
  --surface-2: #122b30;
  --stripe: #0f262a;
  --line: #1d3a3f;
  --fg: #e3f7f5;
  --soft: #bcd6d3;
  --muted: #8fb3b0;
  --accent: #2ee6c5;
  --accent-hover: #6ff0d8;
  --accent-ink: #032420;
  --accent-soft: rgba(46, 230, 197, 0.12);
  --done: #e3f7f5;
  --done-ink: #06171a;
  --live: #e5484d;
  --overlay: rgba(2, 10, 12, 0.8);

  --font-display: "Chakra Petch", "Rajdhani", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
mark { background: rgba(46, 230, 197, 0.22); color: var(--accent); border-radius: 3px; padding: 0 2px; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}

/* ── shell ──────────────────────────────────────────────── */
.shell { display: flex; flex-wrap: wrap; min-height: 100%; }

.rail {
  flex: 1 1 300px;
  max-width: 360px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding-block: 32px;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: 28px;
}
.rail-inner { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 900px) {
  .rail-inner { position: sticky; top: 32px; }
}

.main {
  flex: 999 1 560px;
  min-width: 0;
  padding-block: 32px 48px;
  padding-left: 32px;
  padding-right: max(32px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}

/* ── profile rail ───────────────────────────────────────── */
.avatar {
  width: 96px; height: 96px; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font: 700 38px var(--font-display);
  object-fit: cover;
}
.who h1 { font: 700 32px/1.05 var(--font-display); }
.who p { color: var(--muted); margin-top: 4px; }

.status {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--fg); text-decoration: none;
}
.status:hover { color: var(--fg); background: var(--surface-2); }
.status span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.status small { font-size: 13px; color: var(--muted); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.status.is-live { background: var(--live); border-color: var(--live); color: #fff; animation: glow 1.8s ease-in-out infinite; }
.status.is-live:hover { background: #f05a5f; }
.status.is-live small { color: rgba(255, 255, 255, 0.9); }
.status.is-live .dot { background: #fff; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(229, 72, 77, 0.5); }
  50% { box-shadow: 0 0 18px 4px rgba(229, 72, 77, 0.7); }
}

.tagline { color: var(--soft); }

.rail-nav, .socials { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rail-nav button {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  height: 44px; padding: 0 14px; border-radius: 8px;
  border: 0; background: transparent; color: var(--soft); text-align: left;
}
.rail-nav button:hover { background: var(--surface-2); }
.rail-nav button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail-nav .n { font-variant-numeric: tabular-nums; }
.socials a {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-size: 14px;
}
.socials a:hover { background: var(--surface-2); color: var(--fg); }
.socials a span { color: var(--muted); }

.promo {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px; border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--fg); text-decoration: none;
}
.promo:hover { color: var(--fg); background: var(--surface-2); }
.promo-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.promo-copy { display: flex; flex-direction: column; min-width: 0; }
.promo-big { font: 700 44px/1 var(--font-display); color: var(--accent); }
.promo-label { font: 700 18px var(--font-display); }
.promo-text { font-size: 13px; color: var(--muted); margin-top: 4px; }
.promo-coins { width: 84px; height: 80px; flex: none; }
.promo-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}

/* ── toolbar ────────────────────────────────────────────── */
.notice { padding: 10px 14px; border-radius: 8px; border: 1px dashed var(--accent); color: var(--soft); font-size: 14px; }
.notice code { font-family: var(--font-mono); font-size: 13px; color: var(--fg); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.search {
  flex: 1 1 320px; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 8px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search > svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 500 12px var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; }
@media (hover: none) { .search kbd { display: none; } }
.clear-btn { width: 32px; height: 32px; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 38px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--soft); font-size: 14px; font-weight: 500;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.count { color: var(--muted); font-size: 14px; }
.count strong { color: var(--fg); }

/* ── cards ──────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  transition: border-color 0.15s;
}
.card:hover { border-color: #2a4f55; }
.card.is-copied { border-color: var(--done); box-shadow: 0 0 0 3px rgba(227, 247, 245, 0.12); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font: 700 22px/1.1 var(--font-display); }
.card-title button { all: unset; cursor: pointer; }
.card-title button:hover { color: var(--accent); }
.card-title button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cat { color: var(--muted); font-size: 13px; }

.star {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.star:hover { color: var(--fg); }
.star[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.star[aria-pressed="true"] svg { fill: currentColor; }

.shot {
  display: block; width: 100%; aspect-ratio: 16 / 9; max-width: 100%;
  border: 0; padding: 0; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--stripe) 10px 20px);
  color: var(--muted); font: 500 12px var(--font-mono);
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.shot:hover img { transform: scale(1.03); }
.shot img { transition: transform 0.25s; }
.shot-empty { display: grid; place-items: center; }

.code-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); min-width: 0; }
.code { flex: 1; min-width: 0; padding: 10px 12px; font: 500 12px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 14px; padding: 0 16px; min-height: 42px;
}
.copy-btn:hover { background: var(--accent-hover); }
.copy-btn.copied { background: var(--done); color: var(--done-ink); }
.code-row.copied-row { border-color: var(--done); }

.card-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--soft);
  font-size: 13px; font-weight: 500; padding: 6px 0; min-height: 36px;
}
.text-btn:hover { color: var(--accent); }

/* ── empty ──────────────────────────────────────────────── */
.empty {
  margin-top: 12px; padding: 56px 24px;
  border: 1px dashed var(--line); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.empty > svg { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.5; }
.empty h2 { font: 700 26px var(--font-display); }
.empty p { color: var(--muted); max-width: 44ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--fg); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); color: var(--accent-ink); }

.foot-note { color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }

/* ── build viewer ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.modal-panel {
  position: relative; width: min(1040px, 100%); max-height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  display: flex; flex-direction: column;
}
.modal-panel:focus { outline: none; }
.modal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 28px/1.1 var(--font-display); }
.modal-head p { color: var(--muted); font-size: 13px; }
.modal-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--soft); font-size: 14px; font-weight: 500;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--fg); }
.icon-btn:hover { background: var(--surface-2); }

.picture { background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--stripe) 14px 28px); display: grid; place-items: center; min-height: 240px; }
.picture img { width: 100%; max-height: 62vh; object-fit: contain; display: block; background: #000; }
.picture-empty { color: var(--muted); font: 500 13px var(--font-mono); padding: 40px 16px; text-align: center; }
.full-link { display: block; text-align: right; font-size: 13px; padding: 6px 20px 0; }

.modal-code { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 20px; }
.modal-code .code-row { flex: 1 1 380px; }
.modal-code .code { font-size: 13px; padding: 12px 14px; }
.modal-code .copy-btn { padding: 0 20px; }
.nav-btns { display: flex; gap: 8px; }
.how-to { padding: 0 20px 14px; color: var(--muted); font-size: 13px; }

.note-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; background: var(--bg); border-top: 1px solid var(--line); }
.note-strip .mini-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 13px var(--font-display); flex: none; object-fit: cover; }
.note-strip p { flex: 1 1 260px; color: var(--soft); font-size: 14px; }

/* ── toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 50;
  left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  width: min(520px, calc(100% - 32px));
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--done);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--done); color: var(--done-ink); display: grid; place-items: center; flex: none; }
.toast-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toast-body strong { font: 600 16px var(--font-display); }
.toast-body span { color: var(--soft); font-size: 14px; }

/* ── phone ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .rail {
    max-width: none; border-right: 0; border-bottom: 1px solid var(--line);
    padding-block: 20px 18px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .rail-inner { gap: 14px; }
  .tagline { display: none; }
  .promo { padding: 14px; gap: 8px; }
  .promo-big { font-size: 32px; }
  .promo-text { display: none; }
  .promo-coins { width: 60px; height: 56px; }
  .rail-top { display: flex; gap: 14px; align-items: center; }
  .avatar { width: 68px; height: 68px; border-radius: 16px; font-size: 28px; }
  .who h1 { font-size: 24px; }
  .socials { flex-direction: row; flex-wrap: wrap; }
  .socials li { flex: 1 1 0; }
  .socials a { justify-content: center; }
  .socials a span { display: none; }
  .rail-nav { flex-direction: row; }
  .rail-nav li { flex: 1; }
  .main {
    padding-block: 18px 32px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .modal { padding: 0; place-items: stretch; }
  .modal-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal-tools .tab { flex: 1; justify-content: center; }
  .modal-tools { width: 100%; }
  .modal-code .copy-btn { min-height: 48px; }
}
@media (min-width: 721px) { .rail-top { display: contents; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
