/* ShowRing Explore — reuses the webapp design tokens for visual consistency. */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
  --step--1: clamp(0.78rem, 0.74rem + 0.20vw, 0.89rem);
  --step-0: clamp(0.94rem, 0.88rem + 0.31vw, 1.13rem);
  --step-1: clamp(1.13rem, 1.04rem + 0.45vw, 1.41rem);
  --step-2: clamp(1.35rem, 1.22rem + 0.65vw, 1.76rem);
  --step-3: clamp(1.62rem, 1.43rem + 0.93vw, 2.20rem);
  --step-4: clamp(1.94rem, 1.66rem + 1.32vw, 2.75rem);
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #f9f9fb;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --accent: #1b4d72;
  --accent-hover: #164060;
  --unofficial: #b06a00;
  --unofficial-soft: rgba(245, 159, 0, 0.14);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 980px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.07);
  --ribbon-1: #007aff; --ribbon-2: #ff3b30; --ribbon-3: #ffd60a; --ribbon-4: #c7c7cc;
  --ribbon-5: #ff4fa3; --ribbon-6: #34c759; --ribbon-7: #af52de; --ribbon-8: #a2845e;
  --ribbon-default: #d1d1d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg-secondary: #1c1c1e; --surface: #1c1c1e; --surface-hover: #2c2c2e;
    --text: #f5f5f7; --text-secondary: #aeaeb2; --text-tertiary: #8e8e93;
    --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #4a9fd4; --accent-hover: #6fb4e0; --unofficial-soft: rgba(245, 159, 0, 0.2);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg-secondary);
  font-size: var(--step-0); line-height: 1.5; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

.ex-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border);
}
.ex-brand { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.ex-brand-sep { color: var(--text-tertiary); }
.ex-brand-explore { color: var(--accent); font-weight: 600; }
.ex-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 24px 20px 48px; }
.ex-footer { border-top: 1px solid var(--border); padding: 20px; text-align: center; }
.ex-footer p { color: var(--text-tertiary); font-size: var(--step--1); max-width: 640px; margin: 0 auto; }

/* Search */
.ex-hero { text-align: center; padding: 24px 0 8px; }
.ex-hero h1 { font-family: var(--font-display); font-size: var(--step-4); letter-spacing: -0.02em; }
.ex-hero p { color: var(--text-secondary); margin-top: 8px; }
.ex-searchwrap { position: relative; margin: 24px auto; max-width: 560px; }
.ex-search {
  width: 100%; font-size: var(--step-1); padding: 16px 20px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); outline: none;
}
.ex-search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--unofficial-soft); }
.ex-hint { text-align: center; color: var(--text-tertiary); font-size: var(--step--1); }

.ex-section-label {
  font-size: var(--step--1); font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 24px 0 8px;
}
.ex-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.ex-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.ex-row:last-child { border-bottom: none; }
.ex-row:hover { background: var(--surface-hover); }
.ex-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full); flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--accent);
  font-size: var(--step--1);
}
.ex-avatar.horse { background: #8a6d3b; }
.ex-avatar.barn { background: #475569; border-radius: var(--radius-sm); }
.ex-row-main { flex: 1; min-width: 0; }
.ex-row-title { font-weight: 600; }
.ex-row-sub { color: var(--text-secondary); font-size: var(--step--1); }
.ex-row-meta { color: var(--text-tertiary); font-size: var(--step--1); white-space: nowrap; }
.ex-chev { color: var(--text-tertiary); }
.ex-empty { text-align: center; color: var(--text-tertiary); padding: 40px 0; }

/* Entity page */
.ex-back { display: inline-block; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.ex-entity-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.ex-entity-hero .ex-avatar { width: 64px; height: 64px; font-size: var(--step-1); }
.ex-entity-name { font-family: var(--font-display); font-size: var(--step-3); letter-spacing: -0.01em; }
.ex-entity-sub { color: var(--text-secondary); }
.ex-aliases { color: var(--text-tertiary); font-size: var(--step--1); margin-top: 2px; }
.ex-redirect {
  background: var(--unofficial-soft); color: var(--unofficial); padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: var(--step--1); margin: 12px 0;
}

.ex-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.ex-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.ex-stat-role { font-size: var(--step--1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.ex-stat-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; }
.ex-stat { display: flex; flex-direction: column; }
.ex-stat b { font-size: var(--step-1); font-family: var(--font-display); }
.ex-stat span { font-size: var(--step--1); color: var(--text-secondary); }

.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.ex-chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 6px 12px; font-size: var(--step--1); cursor: pointer;
}
.ex-chip:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.ex-chip .ct { color: var(--text-tertiary); }

/* Timeline */
.ex-show { margin-top: 16px; }
.ex-show-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 6px; }
.ex-show-name { font-weight: 700; }
.ex-show-date { color: var(--text-tertiary); font-size: var(--step--1); white-space: nowrap; }
.ex-appear { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ex-appear:last-child { border-bottom: none; }
.ex-place {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: var(--step--1); color: #fff; background: var(--ribbon-default);
}
.ex-place.np { background: transparent; color: var(--text-tertiary); border: 1px dashed var(--border-strong); }
.ex-appear-main { flex: 1; min-width: 0; }
.ex-appear-class { font-weight: 600; }
.ex-appear-meta { color: var(--text-secondary); font-size: var(--step--1); }
.ex-class-link { color: inherit; text-decoration: none; }
.ex-class-link:hover { color: var(--accent); }
.ex-class-link:hover .ex-class-chev { color: var(--accent); }
.ex-class-chev { color: var(--text-tertiary); font-weight: 400; }
.ex-roles { display: flex; flex-wrap: wrap; gap: 4px; flex: none; }
.ex-role-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: var(--radius-full); background: var(--bg-secondary); color: var(--text-secondary);
}
.ex-link { color: var(--accent); cursor: pointer; }
.ex-link:hover { text-decoration: underline; }
.ex-champ { color: var(--unofficial); font-weight: 700; }
.ex-loading { text-align: center; color: var(--text-tertiary); padding: 48px 0; }
