/* The Vault Web companion — same palette as the macOS app and the
 * marketing landing site. */

:root {
  --bg: #0c0a14;
  --bg-deep: #06040a;
  --card: #14111e;
  --card-raised: #1a1626;
  --border: #28233a;
  --border-strong: #3a3450;
  --accent: #ff6b1a;
  --accent-hi: #ffa05c;
  --gold: #d4af37;
  --text: #f4eddc;
  --text-2: #b6abc4;
  --text-3: #6c647a;
  --win: #6dd97c;
  --loss: #ff5f6d;
  --silent: #9b83ff;
  --max-w: 980px;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; height: auto; display: block; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input[type="text"], input[type="email"] {
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
input[type="text"]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.18); }

.bg-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 18% -10%, rgba(255,107,26,0.15), transparent 60%),
    radial-gradient(700px 500px at 95% 20%, rgba(212,175,55,0.10), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ─── Top bar ─────────────────────────────────────────────────── */
.topbar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(212,175,55,0.4);
}
.brand-mark {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, var(--accent-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
.link-muted { color: var(--text-2); }
.link-muted:hover { color: var(--text); }
.auth-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  background: rgba(109,217,124,0.14);
  border: 1px solid rgba(109,217,124,0.4);
  color: var(--win);
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 28px 64px;
}
@media (max-width: 600px) {
  main { padding: 20px 16px 40px; }
  .topbar { padding: 14px 16px; }
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 0.06s ease, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  color: white;
  background: linear-gradient(120deg, var(--accent), var(--gold));
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 6px 20px -6px rgba(255,107,26,0.55);
}
.btn-primary:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(255,107,26,0.7);
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  color: var(--text-2);
  background: var(--card);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--card-raised);
  border-color: rgba(212,175,55,0.4);
}

/*
 * Quick visual confirmation for the Refresh button. The click handler is
 * debounced server-side; the .is-flash animation just makes panic-clicking
 * still *feel* responsive, so users don't think the button is broken.
 */
@keyframes refreshFlash {
  0%   { background: rgba(212,175,55,0.30); border-color: rgba(212,175,55,0.7); }
  100% { background: var(--card);            border-color: var(--border); }
}
.btn-ghost.is-flash { animation: refreshFlash 380ms ease-out; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0 26px; }
@media (max-width: 480px) {
  .cta-row { gap: 10px; margin: 14px 0 20px; }
  /* On a phone, the primary CTA wants to span the column so the
     touch target is unambiguous, while the secondary stays inline. */
  .cta-row .btn-primary {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 15px;
  }
  .cta-row .btn-ghost {
    flex: 0 0 auto;
    min-height: 44px;
  }
}

/* ─── Common bits ─────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 3px 8px;
  background: rgba(212,175,55,0.10);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 999px;
}
.grad {
  background: linear-gradient(120deg, var(--accent-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted  { color: var(--text-2); }
.small  { font-size: 12px; }
.footnote { margin-top: 14px; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--win);
  vertical-align: middle;
}
.dot-pulse {
  box-shadow: 0 0 0 0 rgba(109, 217, 124, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(109, 217, 124, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(109, 217, 124, 0); }
  100% { box-shadow: 0 0 0 0 rgba(109, 217, 124, 0); }
}

.trust-line {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inapp-warn {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1, #f4eddc);
  background: rgba(255, 107, 26, 0.12);
  border: 1px solid rgba(255, 107, 26, 0.42);
  max-width: 640px;
}
.inapp-warn strong { color: #ffa05c; }
.inapp-warn em { font-style: normal; font-weight: 700; color: #ffd28a; }

/* ─── Signed-out hero ─────────────────────────────────────────── */
.signed-out h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.08;
  font-weight: 900;
  margin: 12px 0 14px;
  letter-spacing: -0.01em;
}
.signed-out .lede {
  color: var(--text-2);
  font-size: 16px;
  margin: 0 0 8px;
  max-width: 56ch;
}
.signin-explainer {
  margin-top: 32px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 60ch;
}
.signin-explainer h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-transform: uppercase;
}
.signin-explainer ul { padding: 0 0 0 18px; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.7; }

/* ─── Signed-in shell ─────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 3.5vw, 32px);
  line-height: 1.05;
  margin: 8px 0 4px;
  font-weight: 900;
}
.page-head p { margin: 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Your status card ────────────────────────────────────────── */
.me-card {
  background: linear-gradient(180deg, var(--card-raised), var(--card));
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 12px 36px -22px rgba(255,107,26,0.5);
}
@media (max-width: 600px) {
  .me-card { padding: 14px; margin-bottom: 18px; }
  .me-row { gap: 10px; margin-bottom: 12px; }
  .me-row .me-id strong { font-size: 14px; }
  .avatar { width: 32px; height: 32px; }
  .avatar.lg { width: 40px; height: 40px; }
  .status-pills { gap: 6px; margin-bottom: 12px; }
  .status-pills .pill {
    padding: 8px 12px;
    font-size: 11.5px;
    /* Apple HIG and Material both call out 44 px as the minimum touch
       target. Pills below this are visually fine but easy to mis-tap. */
    min-height: 36px;
  }
}
.me-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.me-row .me-id { display: flex; flex-direction: column; }
.me-row .me-id strong { font-weight: 800; font-size: 15px; }
.me-status-spacer { flex: 1; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-deep);
  object-fit: cover;
}
.avatar.lg { width: 48px; height: 48px; }

.status-pills {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-pills label { cursor: pointer; }
.status-pills input { position: absolute; opacity: 0; pointer-events: none; }
.status-pills .pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.status-pills label:hover .pill { color: var(--text); }
.status-pills input:checked + .pill.ok    { color: var(--win);    border-color: rgba(109,217,124,0.6); background: rgba(109,217,124,0.12); }
.status-pills input:checked + .pill.gold  { color: var(--gold);   border-color: rgba(212,175,55,0.6); background: rgba(212,175,55,0.10); }
.status-pills input:checked + .pill.ember { color: var(--accent-hi); border-color: rgba(255,107,26,0.6); background: rgba(255,107,26,0.10); }
.status-pills input:checked + .pill.mute  { color: var(--text-2); border-color: var(--border-strong); background: var(--card-raised); }

.me-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 600px) { .me-grid { grid-template-columns: 1fr; } }

/*
 * Replaces the old "Note (preset)" dropdown with a tiny explainer that lives
 * exactly where the dropdown used to. The dropdown was a passive broadcast
 * surface that nobody's mental model expected, so we kill it AND use the
 * vacated space to make the actual flow ("click Invite to play on someone
 * below") obvious to first-time visitors.
 */
.me-howto {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--card-raised);
}
.me-howto-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}
.me-howto-text strong { color: var(--gold); font-weight: 700; }

/* Subtle hint below each row in the player feed, replacing the stale broadcast-note slot. */
.row-hint {
  margin: 4px 0 0;
  font-size: 12px;
  font-style: italic;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

/* ─── Feed ─────────────────────────────────────────────────────── */
.feed-heading {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 900;
  margin: 16px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.count-pill {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(255,107,26,0.18);
  border: 1px solid rgba(255,107,26,0.5);
  color: var(--accent-hi);
  padding: 3px 10px;
  border-radius: 999px;
}

.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  color: var(--text-3);
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.row:hover { border-color: rgba(212,175,55,0.35); }
.row.looking  { border-left: 3px solid var(--win); }
.row.inRun    { border-left: 3px solid var(--gold); }
.row.inCoop   { border-left: 3px solid var(--accent); }
.row.afk      { border-left: 3px solid var(--text-3); }

.row .meta { min-width: 0; }
.row .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.row .name { font-weight: 800; font-size: 14px; }
.row .stats {
  font-size: 12px;
  color: var(--text-3);
}
.row .note {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(0,0,0,0.25);
}
.tag.ok    { color: var(--win); }
.tag.gold  { color: var(--gold); }
.tag.ember { color: var(--accent-hi); }
.tag.mute  { color: var(--text-3); }
.tag.live  { color: var(--win); background: rgba(109,217,124,0.10); }

/*
 * Freshness badge on each feed row. Sits next to the status tag so the user
 * can see at a glance whether someone is actively heartbeating right now or
 * was active hours ago. Three-tier color: bright green when fresh (<5min),
 * gold when warm (<30min), muted otherwise. The text itself comes from
 * formatRelativeActive() in script.js.
 */
.last-active {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.85;
}
.last-active.is-fresh {
  color: var(--win);
  background: rgba(109,217,124,0.10);
}
.last-active.is-warm {
  color: var(--gold);
  background: rgba(212,175,55,0.10);
}
.last-active.is-stale {
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
}

.row .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.row .actions a, .row .actions button {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--card-raised);
  color: var(--text-2);
  text-align: center;
  min-width: 88px;
}
.row .actions a:hover, .row .actions button:hover {
  color: var(--text);
  border-color: rgba(212,175,55,0.5);
}
.row .actions a.steam  { color: var(--accent-hi); border-color: rgba(255,107,26,0.4); }
.row .actions button.discord { color: var(--silent); border-color: rgba(155,131,255,0.4); }
.row .actions a.friend { color: var(--gold); border-color: rgba(212,175,55,0.4); }

/* ─── Auth callback page ─────────────────────────────────────── */
.auth-callback {
  max-width: 460px;
  margin: 0 auto;
  padding: 80px 28px;
  text-align: center;
}
.auth-emblem {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.45);
}
.auth-callback h1 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  margin: 0 0 8px;
}
.auth-callback .btn-ghost { margin-top: 22px; }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 28px 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner strong { display: block; font-size: 13px; }
.footer-inner p { margin: 2px 0 0; font-size: 11px; color: var(--text-3); }
.footer-links { display: flex; gap: 22px; font-size: 13px; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   APP SHELL — signed-in. Mirrors the macOS sidebar+detail layout.
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: calc(100vh - 80px); /* leave room for footer */
}
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: #0a0812;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}
/* Hide the mobile-only account row on tablet+ (it's a duplicate of
   the desktop sidebar-footer markup). The actual mobile-on rules live
   at the bottom of this file (see "Mobile shell").  */
@media (min-width: 881px) {
  .mobile-account-row { display: none; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 18px 14px;
}
.sidebar-brand img {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.45);
  box-shadow: 0 2px 14px rgba(255, 107, 26, 0.22);
}
.sidebar-brand > div { display: flex; flex-direction: column; gap: 2px; }
.sidebar-wordmark {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.16em;
  background: linear-gradient(120deg, var(--accent-hi), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sidebar-sub {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 18px;
  opacity: 0.6;
}

.sidebar-nav { padding: 14px; }
.nav-group { margin-bottom: 22px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-group-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-3);
  padding: 0 14px 8px;
  text-transform: uppercase;
}
.nav-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav-row:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-row.is-active {
  background: rgba(255, 107, 26, 0.12);
  color: var(--text);
  font-weight: 800;
  position: relative;
}
.nav-row.is-active::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-row.is-active .nav-icon { color: var(--accent); }
.nav-icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,107,26,0.18);
  border: 1px solid rgba(255,107,26,0.5);
  color: var(--accent-hi);
}
.nav-badge.is-urgent {
  background: rgba(109,217,124,0.18);
  border-color: rgba(109,217,124,0.55);
  color: var(--win);
  animation: pulse 2s infinite;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px;
}
.me-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.me-pill-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.me-pill-meta { display: flex; flex-direction: column; min-width: 0; }
.me-pill-meta strong {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me-pill-meta span {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 0;
  font-size: 11px;
  color: var(--text-2);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.status-dot[data-state="online"]    { background: var(--win); box-shadow: 0 0 8px rgba(109,217,124,0.5); }
.status-dot[data-state="connecting"]{ background: var(--gold); animation: pulse 2s infinite; }
.status-dot[data-state="trouble"]   { background: var(--loss); }

.status-signout {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}
.status-signout:hover { color: var(--text); text-decoration: underline; }

/* ─── Content area ────────────────────────────────────────── */
.content {
  padding: 0;
  min-width: 0;       /* let children shrink instead of overflowing the grid */
  background: var(--bg);
}
.tab-panel { padding: 0; }

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(12, 10, 20, 0.85);
  backdrop-filter: blur(8px);
}
.panel-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 900;
  margin: 0 0 4px;
}
.panel-sub { margin: 0; color: var(--text-2); font-size: 13px; }
.panel-actions { display: flex; gap: 8px; }
.panel-body { padding: 24px 32px 60px; }

/* Tighten panel chrome on mobile. The desktop padding (24/32 px) eats
   too much horizontal real estate on a 375 px iPhone SE; the page
   header h1 size also halves to keep the panel-head from dominating
   the viewport on initial load. */
@media (max-width: 880px) {
  .panel-head {
    padding: 14px 16px 12px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    /* Defeat sticky header chaining: with the sidebar already sticky
       at the top, a second sticky element behind it stacks the colors
       and looks like a UI seam. */
    position: relative;
    background: transparent;
    backdrop-filter: none;
  }
  .panel-head h1 {
    font-size: 20px;
    line-height: 1.2;
    margin: 0 0 2px;
  }
  .panel-sub {
    font-size: 12px;
    line-height: 1.4;
  }
  .panel-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .panel-body {
    padding: 14px 14px 40px;
  }
}

@media (max-width: 480px) {
  .panel-head { padding: 12px 12px 10px; }
  .panel-body { padding: 12px 12px 32px; }
  .panel-head h1 { font-size: 18px; }
}

/* ─── Buttons (small variants) ──────────────────────────── */
.btn-primary.sm, .btn-ghost.sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 7px;
  font-weight: 700;
}
.action-link {
  display: inline-block;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--card-raised);
  color: var(--text-2);
  text-align: center;
  min-width: 78px;
  cursor: pointer;
}
.action-link:hover {
  color: var(--text);
  border-color: rgba(212,175,55,0.5);
}

/* The signed-in feed rows now have an Invite-to-play primary button.
   Keep the actions column tight on small screens. */
.row .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 140px;
}
.row .actions .btn-primary.sm { width: 100%; justify-content: center; }
@media (max-width: 600px) {
  .row {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 12px 14px;
  }
  .row .actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }
  /* Primary "Invite to play" gets the full row on its own — it's the
     star action of the feed, and at <=375px width sharing a flex line
     with two other buttons left it cramped. The two secondary actions
     (Profile, Steam) split the second row. */
  .row .actions .btn-primary.sm {
    flex: 1 1 100%;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
    min-height: 42px;
    justify-content: center;
  }
  .row .actions .action-link {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
    min-height: 40px;
  }
}

/* ─── Empty state (stat tabs without data) ────────────── */
.empty-state {
  text-align: center;
  padding: 60px 30px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: 14px;
}
.empty-state h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin: 0 0 8px;
}
.empty-state p {
  color: var(--text-2);
  margin: 0 0 20px;
}
.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 18px;
}
.empty-state-tip {
  color: var(--text-3);
  font-size: 12px;
  margin: 0 0 6px;
}
.empty-state-tip.muted {
  color: var(--text-3);
  opacity: 0.85;
}
.empty-state-tip code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/*
 * Default-path callout box. Surfaces ~/Library/Application Support/... so
 * users on macOS know exactly where to navigate, with a Copy button right
 * there. The whole row collapses gracefully on narrow screens.
 */
.empty-state-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 4px auto 14px;
  max-width: 720px;
}
.empty-state-path .path-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.empty-state-path .path-value {
  font-size: 12px;
  color: var(--text-2);
  background: transparent;
  padding: 0;
  border: 0;
  user-select: all;
  word-break: break-all;
}
.empty-state-path .btn-sm {
  font-size: 11px;
  padding: 4px 10px;
}
.empty-state-hints kbd {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text);
}
.empty-state-hints {
  margin-top: 26px;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state-hints summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.empty-state-hints summary::-webkit-details-marker { display: none; }
.empty-state-hints summary::before {
  content: "▸ ";
  color: var(--text-3);
  margin-right: 4px;
}
.empty-state-hints[open] summary::before { content: "▾ "; }
.empty-state-hints ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.empty-state-hints code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
}

/* ─── Stats: hero overview (matches macOS app Overview) ──
 * Three-column grid that fills the panel: ring | run history | side stats.
 * The third column carries Highest Ascension, recent form, and average
 * ascension so we don't leave a sad empty band on the right of widescreens. */
.hero-overview {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(220px, 320px);
  gap: 32px;
  align-items: center;
  padding: 26px 30px;
  background: linear-gradient(180deg, #1a1626 0%, #14111e 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 28px;
}
@media (max-width: 1100px) {
  .hero-overview {
    grid-template-columns: 200px 1fr;
  }
  .hero-side { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 6px; }
}
@media (max-width: 720px) {
  .hero-overview {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 22px 20px;
  }
  .hero-side { text-align: left; }
}

/* Side panel: three small stat tiles stacked vertically. */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-side-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.hero-side-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.hero-side-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold);
}
.hero-side-icon svg { width: 16px; height: 16px; }
.hero-side-tile.tone-win .hero-side-icon { background: rgba(109, 217, 124, 0.14); color: var(--win); }
.hero-side-tile.tone-loss .hero-side-icon { background: rgba(255, 95, 109, 0.14); color: var(--loss); }
.hero-side-tile.tone-accent .hero-side-icon { background: rgba(255, 107, 26, 0.14); color: var(--accent-hi); }
.hero-side-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-side-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.hero-side-value {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.hero-side-sub { font-size: 11px; color: var(--text-3); }
.hero-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  justify-self: center;
}
.hero-ring { width: 180px; height: 180px; display: block; }
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 14;
}
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  filter: drop-shadow(0 0 10px rgba(255, 107, 26, 0.45));
  transition: stroke-dasharray 0.6s ease;
}
.hero-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ring-pct {
  font-family: 'Inter', sans-serif;
  font-size: 38px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ring-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 6px;
}
.hero-numbers-head {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
  text-transform: none;
  margin-bottom: 14px;
}
.hero-numbers-row {
  display: flex;
  gap: 36px;
  align-items: flex-end;
  margin-bottom: 14px;
}
@media (max-width: 720px) {
  .hero-numbers-row { justify-content: center; gap: 24px; }
}
.hero-num {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
@media (max-width: 720px) {
  .hero-num { align-items: center; }
}
.hero-num .num {
  font-family: 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.num-neutral { color: var(--text); }
.num-win     { color: var(--win); }
.num-loss    { color: var(--loss); }
.hero-num .num-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-3);
  text-transform: uppercase;
}
.hero-best {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
@media (max-width: 720px) { .hero-best { justify-content: center; } }
.hero-best-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.char-icon { width: 100%; height: 100%; }
.hero-best-text strong { font-weight: 800; }

/* ─── Per-character grid (matches macOS app "Per character" cards) ── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.char-card {
  position: relative;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.char-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--char-color) 50%, transparent);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--char-color) 40%, transparent);
}
.char-card:focus-visible {
  outline: 2px solid var(--char-color);
  outline-offset: 2px;
}
.char-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--char-color) 14%, transparent) 0%, transparent 60%);
  pointer-events: none;
}
.char-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
}
.char-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--char-color) 18%, transparent);
  color: var(--char-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.char-card-icon .char-icon { width: 22px; height: 22px; }
.char-card-icon .char-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.char-card-runs {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.char-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  position: relative;
  letter-spacing: -0.01em;
}
.char-card-record {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
  position: relative;
}
.char-card-wr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  position: relative;
}
.char-card-pct {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--char-color);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.char-card-pct-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-3);
  text-transform: uppercase;
}
.char-card-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.char-card-bar > span {
  display: block;
  height: 100%;
  background: var(--char-color);
  border-radius: 4px;
  box-shadow: 0 0 8px color-mix(in srgb, var(--char-color) 50%, transparent);
}

/* ─── Pills (matches desktop app's Pill component) ────── */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.pill-muted {
  color: var(--text-2);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}
.pill-small-sample {
  border-style: dashed;
  cursor: help;
  opacity: 0.85;
}
.pill-win {
  color: var(--win);
  background: rgba(109, 217, 124, 0.14);
  border-color: rgba(109, 217, 124, 0.32);
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 800;
}
.pill-gold {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.38);
  text-transform: none;
  letter-spacing: 0.05em;
  font-weight: 800;
}

/* ─── Cards tab: icon-list panels (matches CardsView in DetailView.swift) ── */
.card-list-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 12px;
}
.card-row + .card-row { border-top: 1px solid rgba(40, 35, 58, 0.5); }
.card-row-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-row-icon svg { width: 12px; height: 12px; }
.card-row-icon-picked  { color: var(--accent);  background: rgba(255, 107, 26, 0.18); }
.card-row-icon-skipped { color: var(--loss);    background: rgba(255, 95, 109, 0.18); }

/* When real card art is available, swap the small icon dot for a
   thumbnail-sized strip that mimics a card peek. Aspect-ratio mirrors
   the source PNGs (roughly 5:6). */
.card-row-art {
  width: 32px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-row-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Cards have transparent rounded corners; cropping with object-fit
     gives us a clean rectangle without showing the void around them. */
}
.card-row-art-picked  { box-shadow: inset 0 0 0 1px rgba(255, 107, 26, 0.35); }
.card-row-art-skipped { box-shadow: inset 0 0 0 1px rgba(255, 95, 109, 0.30); filter: saturate(0.7) brightness(0.85); }
.card-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.card-row-count, .card-row-mono {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.card-row-mono { min-width: 80px; text-align: right; }
.card-row-pct {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  width: 60px;
  text-align: right;
  letter-spacing: -0.01em;
}
.card-row-pct-win    { color: var(--win); }
.card-row-pct-gold   { color: var(--gold); }
.card-row-pct-accent { color: var(--accent); }
.card-row-pct-loss   { color: var(--loss); }

/* ─── Recent Runs: row-cards (matches RunRow in DetailView.swift) ── */
.run-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.run-row {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.run-row:hover {
  background: var(--card-raised);
  border-color: color-mix(in srgb, var(--char-color) 50%, transparent);
  transform: translateX(1px);
}
.run-stripe {
  width: 4px;
  background: var(--char-color);
  flex-shrink: 0;
}
.run-row-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  flex: 1;
  min-width: 0;
}
.run-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--char-color) 16%, transparent);
  color: var(--char-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.run-icon .char-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.run-icon svg { width: 18px; height: 18px; }
.run-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.run-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.run-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.run-date {
  font-size: 11px;
  color: var(--text-2);
}
.run-spacer { flex: 1; }
.run-duration {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.run-duration strong {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.run-duration span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-3);
  margin-top: 2px;
}
.run-outcome {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid;
  flex-shrink: 0;
}
.run-outcome.is-victory {
  color: #8eef9b;
  background: rgba(109, 217, 124, 0.18);
  border-color: rgba(109, 217, 124, 0.5);
}
.run-outcome.is-defeat {
  color: #ff7c87;
  background: rgba(255, 95, 109, 0.18);
  border-color: rgba(255, 95, 109, 0.5);
}

/* ─── Share button on run rows ────────────────────────────────────
   Sized to sit beside the outcome badge without crowding it. Subtle
   until hover, where it picks up the row's character color. */
.run-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  margin-left: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary, #9aa3b2);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.run-share-btn:hover,
.run-share-btn:focus-visible {
  color: var(--text, #f4f6fa);
  border-color: var(--char-color, var(--accent));
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}
.run-share-btn:active { transform: scale(0.97); }
.run-share-btn svg { flex-shrink: 0; }

/* ─── Share modal (per-run preview + export) ──────────────────────
   Wider than the invite modal so the 880x540 share card preview can
   render at a sensible scale without horizontal scrolling. */
.modal.modal-share { max-width: 720px; width: calc(100% - 48px); }
.share-body { display: flex; flex-direction: column; gap: 16px; }
.share-preview-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0d12;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-preview-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  /* Keep the 880x540 aspect ratio when the modal is narrow. */
  aspect-ratio: 880 / 540;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.share-actions button { font-size: 12px; }
.share-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary, #8a93a3);
  letter-spacing: 0.02em;
}
.share-hint.is-success { color: #8eef9b; }
.share-hint.is-error { color: #ff8e98; }

/* ─── Top Relics: card grid (matches desktop app's RelicCard) ──── */
.relic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.relic-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.relic-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 8px 24px -8px rgba(212, 175, 55, 0.3);
}
.relic-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Relic art tiles: when the manifest knows this slug, we swap the gold
   sparkle for the actual relic PNG. The circle clip keeps STS2's
   transparent corners aligned with the card's circular icon socket. */
.relic-card-icon-art {
  background: radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.20), rgba(212, 175, 55, 0.04));
  overflow: hidden;
  padding: 3px;
}
.relic-card-icon-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.relic-card-icon svg { width: 20px; height: 20px; }
.relic-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.relic-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.relic-card-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.relic-card-pct {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.relic-card-pct strong {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.relic-card-pct span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-3);
  margin-top: 4px;
}
.relic-card-pct-win strong    { color: var(--win); }
.relic-card-pct-gold strong   { color: var(--gold); }
.relic-card-pct-accent strong { color: var(--text-2); }

/* ─── Ascensions: bar chart + detail rows (matches desktop app) ── */
.asc-chart-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 24px;
}
.asc-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 160px;
  padding: 0 2px;
  max-width: 720px;
}
.asc-bar-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: default;
  width: 36px;
}
.asc-bar-stack {
  position: relative;
  width: 36px;
  height: 120px;
  transition: transform 0.15s ease;
}
.asc-bar-col:hover .asc-bar-stack { transform: scaleY(1.04); transform-origin: bottom; }
.asc-bar-col:hover .asc-bar-wins { box-shadow: 0 0 18px rgba(109, 217, 124, 0.55); }
.asc-bar-col:hover .asc-bar-tooltip { opacity: 1; transform: translate(-50%, -8px); }
.asc-bar-tooltip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 4px);
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 5;
  font-variant-numeric: tabular-nums;
}
.asc-bar-tooltip strong { color: var(--win); }
.asc-bar-bg, .asc-bar-total, .asc-bar-wins {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 6px;
}
.asc-bar-bg {
  top: 0;
  background: rgba(255,255,255,0.04);
}
.asc-bar-total {
  background: linear-gradient(180deg, rgba(155, 131, 255, 0.42) 0%, rgba(40, 35, 58, 0.6) 100%);
}
.asc-bar-wins {
  background: linear-gradient(180deg, #8eef9b 0%, var(--win) 100%);
  box-shadow: 0 0 12px rgba(109, 217, 124, 0.28);
}
.asc-bar-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-2);
  letter-spacing: 0.05em;
}

.asc-detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.asc-detail-row {
  display: grid;
  grid-template-columns: 40px 1fr 60px 90px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}
.asc-detail-row.has-divider { border-bottom: 1px solid rgba(40, 35, 58, 0.5); }
.asc-detail-key {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: var(--gold);
}
.asc-detail-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.asc-detail-bar > span {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.asc-detail-pct {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
}
.asc-detail-record {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  text-align: right;
}

/* ─── Stats: grid + tables ────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-3);
  text-transform: uppercase;
}
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}
.stat-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* Desktop-app-style section header: tiny accented icon, tracked uppercase
 * label, and a short fade-out underline. Mirrors SectionTitle in
 * VaultApp/App/Theme.swift so the two products read as one. */
.sec-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 28px 0 14px;
}
.sec-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sec-title-icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sec-title-icon svg { width: 14px; height: 14px; }
.sec-title-text {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--text-2);
  text-transform: uppercase;
}
.sec-title-rule {
  height: 1.5px;
  width: 80px;
  background: linear-gradient(to right, var(--accent), transparent);
  border-radius: 1px;
}
.sec-title.gold .sec-title-icon { color: var(--gold); }
.sec-title.gold .sec-title-rule { background: linear-gradient(to right, var(--gold), transparent); }
.sec-title.loss .sec-title-icon { color: var(--loss); }
.sec-title.loss .sec-title-rule { background: linear-gradient(to right, var(--loss), transparent); }
.sec-title.win  .sec-title-icon { color: var(--win); }
.sec-title.win  .sec-title-rule { background: linear-gradient(to right, var(--win), transparent); }

/* Backwards-compat for any inline calls still using .section-title */
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 28px 0 14px;
}

.bucket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.bucket-table th {
  text-align: left;
  padding: 11px 14px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bucket-table th.num { text-align: right; }
.bucket-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.bucket-table tr:last-child td { border-bottom: 0; }
.bucket-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.winrate-bar {
  position: relative;
  display: inline-block;
  width: 110px;
  height: 18px;
  background: var(--bg-deep);
  border-radius: 5px;
  overflow: hidden;
  vertical-align: middle;
}
.winrate-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0.65;
}
.winrate-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

.cards-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 880px) {
  .cards-split { grid-template-columns: 1fr; }
}

/* ─── Co-op inbox ─────────────────────────────────────── */
.inbox {
  border: 1px solid rgba(109,217,124,0.4);
  background: linear-gradient(180deg, rgba(109,217,124,0.05), rgba(0,0,0,0));
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
}

/*
 * Played for ~1.6s when a brand-new invite hits the inbox. Gold pulse over
 * the green resting state so it reads as "this just changed, look here"
 * regardless of whether the user is on the Co-op tab or staring at stats.
 */
@keyframes inboxArrivalFlash {
  0%   { box-shadow: 0 0 0 0 rgba(212,175,55,0.0); border-color: rgba(212,175,55,0.9); transform: scale(1); }
  20%  { box-shadow: 0 0 28px 4px rgba(212,175,55,0.55); transform: scale(1.01); }
  60%  { box-shadow: 0 0 14px 2px rgba(212,175,55,0.30); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.0); border-color: rgba(109,217,124,0.4); transform: scale(1); }
}
.inbox.is-flash { animation: inboxArrivalFlash 1.6s ease-out; }
.inbox-title {
  margin: 0 0 12px;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.inbox-list { display: flex; flex-direction: column; gap: 10px; }
.invite-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.invite-card.invite-accepted { border-color: rgba(109,217,124,0.45); }
.invite-meta { min-width: 0; }
.invite-meta strong { font-size: 14px; font-weight: 800; display: block; }
.invite-msg {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
  font-style: italic;
}
.invite-actions { display: flex; gap: 8px; }
@media (max-width: 600px) {
  .invite-card { grid-template-columns: auto 1fr; }
  .invite-actions { grid-column: 1 / -1; }
}

/* ─── Modal (invite picker) ────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  width: 100%;
  max-width: 480px;
  background: var(--card-raised);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 14px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  overflow: hidden;
}

@media (max-width: 600px) {
  .modal-backdrop {
    padding: 12px;
    /* Stick to the bottom of the screen on phones — easier on the
       thumb than dead-center, and matches native iOS sheet behavior. */
    align-items: flex-end;
  }
  .modal {
    border-radius: 14px 14px 0 0;
    /* Allow tall modals (e.g. share preview) to scroll inside the
       sheet rather than overflow the viewport. */
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-head { padding: 14px 16px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 16px; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 900;
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.modal-body { padding: 20px; }
.modal-sub { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.invite-options { display: flex; flex-direction: column; gap: 8px; }
.invite-option {
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.06s;
}
.invite-option:hover {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.06);
}
.invite-option:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}

/* ─── Drag-drop overlay ────────────────────────────────── */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,6,16,0.85);
  backdrop-filter: blur(10px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.drop-overlay-card {
  border: 2px dashed rgba(212,175,55,0.7);
  border-radius: 18px;
  padding: 60px 80px;
  text-align: center;
  background: rgba(20,17,30,0.85);
}
.drop-overlay-icon {
  font-size: 48px;
  color: var(--gold);
  margin-bottom: 12px;
}
.drop-overlay-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin: 0 0 6px;
}
.drop-overlay-card p { margin: 0; color: var(--text-2); font-size: 13px; }
.drop-overlay-card code {
  background: var(--bg-deep);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ─── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: var(--card-raised);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── select styling (note dropdown) ─────────────────── */
select#me-note {
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
select#me-note:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}
select#me-note option { background: var(--bg-deep); color: var(--text); }

/* ─── Hide topbar in signed-in mode (sidebar replaces it) ─── */
.topbar-public[hidden],
.main-public[hidden] { display: none !important; }

/* The browser's UA `[hidden] { display: none }` rule is beaten by class
 * selectors that set `display: flex` (same specificity, later in source).
 * Force `hidden` to win for our overlays. */
.modal-backdrop[hidden],
.drop-overlay[hidden],
#app-shell[hidden] { display: none !important; }

/* =============================================================
   Mobile shell (≤880px) — sidebar collapses to a sticky horizontal
   tab strip pinned to the top.

   Lives at the END of the file on purpose: CSS resolves equal-
   specificity rules in source order, and we need these mobile
   overrides to beat the desktop sidebar styles defined earlier
   (e.g. .sidebar-brand { display: flex }).

   Why this product needs a real mobile layout: most of our
   inbound traffic is Reddit / X / iMessage shares, all of which
   open in mobile webviews. The original design stacked the
   entire 248px sidebar above the content on mobile, which meant
   users scrolled past 7 nav rows + brand + footer before
   reaching anything actionable. The horizontal tab strip
   pattern matches what Reddit, Discord, and Twitter do
   natively, which is what the user has already opted into.
   ============================================================= */
@media (max-width: 880px) {
  /* Defeat horizontal overflow at the grid level. Without min-width:0
     the sidebar grid track grows to fit its widest descendant — and
     the sidebar-nav (a flex strip with `flex: 0 0 auto` children)
     happily reports its full intrinsic width. That bleeds out past
     the viewport and gives us a horizontally scrollable page. */
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar, .content { min-width: 0; }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 8, 18, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    /* Ensure the strip's overflow:auto stays inside the viewport. */
    width: 100%;
    max-width: 100vw;
  }

  /* Hide the desktop sidebar chrome — the brand block, divider, and
     account footer would gobble too much vertical space on a phone.
     The persona+status info reappears in the mobile-account-row below
     the tab strip. */
  .sidebar-brand,
  .sidebar-divider,
  .sidebar-spacer,
  .sidebar-footer {
    display: none !important;
  }

  /* Nav becomes a horizontal scroll strip. Both groups (Stats / Community)
     are lifted into a single flex line so users can sweep across them in
     one gesture instead of seeing a vertical column of 7 buttons. */
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    gap: 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Critical: the strip itself must not grow past the sidebar's box.
       Without min-width:0 here, flex children expand the strip which
       in turn expands the .sidebar (its grid parent already has
       min-width:0 above). */
    min-width: 0;
    width: 100%;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  .nav-group {
    display: contents;
    margin: 0;
  }
  .nav-group-label { display: none; }

  .nav-row {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    scroll-snap-align: center;
    min-height: 38px;
    white-space: nowrap;
  }
  .nav-row:hover { background: rgba(255, 255, 255, 0.06); }
  .nav-row.is-active {
    background: rgba(255, 107, 26, 0.15);
    border-color: rgba(255, 107, 26, 0.55);
    color: var(--text);
  }
  .nav-row.is-active::after { display: none; }
  .nav-icon { width: 16px; height: 16px; }
  .nav-icon svg { width: 16px; height: 16px; }
  .nav-label { flex: 0 0 auto; }

  /* Mobile-only account row — persona avatar, name, connection status,
     sign out. Lives just under the tab strip. */
  .mobile-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-2);
    flex-wrap: wrap;
  }
  .mobile-account-row .me-pill-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .mobile-account-row .me-pill-mini img {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
  }
  .mobile-account-row .me-pill-mini strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  .mobile-account-row .status-dot {
    width: 7px; height: 7px;
  }
  .mobile-account-row .muted-status {
    color: var(--text-3);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
  }
  .mobile-account-row .status-signout {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
  }
  .mobile-account-row .status-signout:hover {
    color: var(--text);
    text-decoration: none;
  }
}

/* =====================================================================
 * No-auth landing experience
 * ---------------------------------------------------------------------
 * Demo banner above stats, guest co-op tab, sidebar CTA, and full-screen
 * in-app browser overlay. Same visual vocabulary as the rest of the app
 * so the unauthenticated view doesn't feel like a different product.
 * =================================================================== */

/* ── Demo data banner ── */
.demo-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 198, 92, 0.08), rgba(255, 107, 26, 0.05));
  border: 1px solid rgba(255, 198, 92, 0.32);
  border-radius: 12px;
  font-size: 13px;
}
.demo-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.demo-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.demo-banner-text strong {
  color: var(--gold, #ffc65c);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-banner-text span { color: var(--text-2); }
.demo-banner-text code,
.demo-banner-path code,
.demo-banner-hints code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Menlo', Consolas, monospace;
  font-size: 12px;
}
.demo-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-banner-actions .btn-primary,
.demo-banner-actions .btn-ghost {
  padding: 7px 14px;
  font-size: 12px;
}

/* Path callout inside the demo banner */
.demo-banner-path {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex-wrap: wrap;
}
.demo-banner-path .path-label {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.demo-banner-path .path-value {
  flex: 1 1 240px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  color: var(--text-1);
  word-break: break-all;
  overflow-wrap: anywhere;
}
.demo-banner-path .btn-sm {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 5px 10px;
}

/* Collapsible "I can't find my saves" hints inside the banner */
.demo-banner-hints {
  margin: 0;
  font-size: 12px;
}
.demo-banner-hints summary {
  cursor: pointer;
  color: var(--text-2);
  padding: 4px 0;
  font-weight: 600;
  list-style: none;
}
.demo-banner-hints summary::-webkit-details-marker { display: none; }
.demo-banner-hints summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.15s ease;
}
.demo-banner-hints[open] summary::before { transform: rotate(90deg); }
.demo-banner-hints .hints-body {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-banner-hints .hints-warning {
  padding: 10px 12px;
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.3);
  border-radius: 8px;
  color: var(--text-1);
  line-height: 1.5;
}
.demo-banner-hints .hints-warning strong { color: #ff8a8a; }
.demo-banner-hints .hints-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  line-height: 1.5;
}
.demo-banner-hints .hints-list strong { color: var(--text-1); }
.demo-banner-hints .hints-tip {
  margin: 0;
  color: var(--text-2);
  line-height: 1.5;
}

/* Schema-version warning — appears when the user's runs are from an
 * STS2 build we haven't tested. Visually distinct from the demo banner
 * (yellow + lightning) and the in-app browser overlay (red + full
 * screen) so it reads as "informational, not blocking". */
.schema-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 198, 92, 0.06), rgba(255, 167, 38, 0.04));
  border: 1px solid rgba(255, 198, 92, 0.28);
  border-left: 3px solid rgba(255, 198, 92, 0.6);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.schema-warning-icon {
  font-size: 18px;
  line-height: 1;
  padding-top: 1px;
  flex: 0 0 auto;
}
.schema-warning-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.schema-warning-text strong {
  color: var(--gold, #ffc65c);
  font-size: 12px;
  font-weight: 700;
}
.schema-warning-text span { color: var(--text-2); }
.schema-warning-text a {
  color: var(--gold, #ffc65c);
  text-decoration: underline;
  text-decoration-color: rgba(255, 198, 92, 0.4);
}
.schema-warning-text a:hover { text-decoration-color: rgba(255, 198, 92, 0.8); }

/* Empty-state warning (the equivalent of the demo-banner-hints warning,
 * shown above the collapsible details so it's always visible). */
.empty-state-warning {
  margin: 16px auto 0;
  max-width: 540px;
  padding: 12px 14px;
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.3);
  border-radius: 10px;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
.empty-state-warning strong { color: #ff8a8a; display: block; margin-bottom: 4px; }
.empty-state-warning em { color: var(--text-2); font-style: normal; }

@media (max-width: 600px) {
  .demo-banner-row { flex-direction: column; align-items: stretch; }
  .demo-banner-actions { width: 100%; }
  .demo-banner-actions .btn-primary,
  .demo-banner-actions .btn-ghost { flex: 1; justify-content: center; }
  .demo-banner-path { flex-direction: column; align-items: stretch; }
  .demo-banner-path .path-value { width: 100%; box-sizing: border-box; }
}

/* ── Sidebar guest pill (replaces persona pill when no session) ── */
.me-pill-guest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 198, 92, 0.06), rgba(255, 107, 26, 0.04));
  border: 1px solid rgba(255, 198, 92, 0.24);
  border-radius: 12px;
}
.me-pill-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  width: 100%;
}
.me-pill-guest-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}

/* ── Guest co-op tab body ── */
.guest-coop {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
}
.guest-coop-card {
  padding: 28px 28px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.guest-coop-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.guest-coop-card .muted {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 18px;
}
.guest-coop-card .muted strong { color: var(--text-1); }
.guest-coop-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 0 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.guest-coop-count .dot.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}
.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
}
.guest-coop-explainer {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.guest-coop-explainer summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  list-style: none;
}
.guest-coop-explainer summary::-webkit-details-marker { display: none; }
.guest-coop-explainer summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}
.guest-coop-explainer[open] summary::before { transform: rotate(90deg); }
.guest-coop-explainer ul {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}

/* ── Guest read-only roster preview ── */
.guest-coop-roster h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 12px;
}
.guest-coop-roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guest-roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.guest-roster-row .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.guest-roster-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.guest-roster-meta strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guest-roster-meta .small { font-size: 11px; }
.guest-roster-row .pill.ember {
  background: rgba(255, 107, 26, 0.16);
  color: #ffa05c;
  border: 1px solid rgba(255, 107, 26, 0.42);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Full-screen in-app browser overlay ── */
.inapp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 10, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.inapp-overlay-card {
  max-width: 480px;
  width: 100%;
  padding: 28px 26px 22px;
  background: var(--card);
  border: 1px solid rgba(255, 107, 26, 0.42);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.inapp-overlay-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 10px;
  color: #ffa05c;
}
.inapp-overlay-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 14px;
}
.inapp-overlay-card p strong { color: var(--text-1); }
.inapp-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.inapp-overlay-actions .btn-primary {
  width: 100%;
  justify-content: center;
}
.inapp-overlay-actions .btn-ghost {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-size: 13px;
}
.inapp-overlay-dismiss {
  margin-top: 8px;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}
.inapp-overlay-dismiss:hover { color: var(--text-2); text-decoration: underline; }

