/* RollReport — design system from Claude Design "RollReport Pages" handoff.
   Single source of truth for the dark / Space-Grotesk / amber aesthetic
   shared across homepage, athletes, events, gyms, rankings, etc. */

:root {
  --rr-bg: #0b0d10;
  --rr-bg-2: #0f1217;
  --rr-panel: #12161c;
  --rr-panel-2: #171c24;
  --rr-line: rgba(255, 255, 255, 0.06);
  --rr-line-2: rgba(255, 255, 255, 0.1);
  --rr-line-3: rgba(255, 255, 255, 0.16);
  --rr-ink: #e8ecef;
  --rr-ink-2: #a8b0ba;
  --rr-ink-3: #6b7380;
  --rr-ink-4: #4a525e;
  --rr-amber: #ff9a3c;
  --rr-amber-2: #ffb566;
  --rr-amber-dim: rgba(255, 154, 60, 0.12);
  --rr-win: #3ddc97;
  --rr-loss: #ff5a5a;
  --rr-draw: #c9a24a;
  --rr-gold: #ffcf6b;
  --rr-silver: #c9cdd4;
  --rr-bronze: #d48a4a;
  --rr-blue: #5b9ad9;
  --rr-purple: #a07cd9;
  --rr-font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --rr-font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Pages opt in via class="rr-page" on <body> */
body.rr-page {
  margin: 0;
  background: var(--rr-bg);
  color: var(--rr-ink);
  font-family: var(--rr-font-display);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02", "cv11";
}
body.rr-page * {
  box-sizing: border-box;
}

.rr-mono {
  font-family: var(--rr-font-mono);
}
.rr-amb {
  color: var(--rr-amber);
}
.rr-amb--up {
  color: var(--rr-win);
}
.rr-amb--down {
  color: var(--rr-loss);
}
.rr-dim {
  color: var(--rr-ink-3);
}

/* ── Ambient bg grid ─────────────────────────────────────────────── */
.rr-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1200px 700px at 70% 15%, rgba(255, 154, 60, 0.06), transparent 60%),
    radial-gradient(900px 600px at 15% 85%, rgba(60, 120, 200, 0.05), transparent 60%), var(--rr-bg);
}
.rr-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 80%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 80%);
}

.rr-shell {
  position: relative;
  z-index: 1;
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--rr-ink);
}

/* ── Top brand bar ───────────────────────────────────────────────── */
.rr-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--rr-panel);
  border: 1px solid var(--rr-line);
  border-radius: 14px;
}
@media (min-width: 800px) {
  .rr-topbar {
    grid-template-columns: auto 1fr auto;
  }
}

.rr-crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--rr-ink-3);
  font-size: 12px;
  flex-wrap: wrap;
}
.rr-crumbs a {
  color: var(--rr-ink-3);
  text-decoration: none;
  transition: color .15s;
}
.rr-crumbs a:hover {
  color: var(--rr-ink-2);
}
.rr-crumbs em {
  color: var(--rr-ink-2);
  font-style: normal;
}
.rr-crumbs .sep {
  color: var(--rr-ink-3);
}

/* Right-side context chip */
.rr-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rr-chip__pill {
  font-family: var(--rr-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #10131a;
  border: 1px solid var(--rr-line-2);
  padding: 3px 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff, #d7dae0);
}
.rr-chip__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a313b, #171c24);
  border: 1px solid var(--rr-line-2);
  display: grid;
  place-items: center;
  color: var(--rr-ink-2);
  font-weight: 700;
  font-size: 13px;
  position: relative;
  overflow: hidden;
}
.rr-chip__avatar::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 154, 60, 0.35);
}
.rr-chip__avatar--sq {
  border-radius: 8px;
}
.rr-chip__avatar--sq::after {
  border-radius: 8px;
}
.rr-chip__meta h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--rr-ink);
}
.rr-chip__meta h1 i {
  font-style: normal;
  color: var(--rr-amber);
}
.rr-chip__meta .sub {
  color: var(--rr-ink-3);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Section heads ───────────────────────────────────────────────── */
.rr-sechead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 0;
}
.rr-sechead .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rr-amber);
  box-shadow: 0 0 10px var(--rr-amber);
}
.rr-sechead h2 {
  font-family: var(--rr-font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  margin: 0;
  font-weight: 600;
  color: var(--rr-ink);
}
.rr-sechead .badge {
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--rr-ink-3);
  text-transform: uppercase;
}
.rr-sechead .spacer {
  flex: 1;
}

/* ── Panel primitive ─────────────────────────────────────────────── */
.rr-panel {
  background: var(--rr-panel);
  border: 1px solid var(--rr-line);
  border-radius: 14px;
  padding: 18px;
}
.rr-panel h4 {
  margin: 0 0 14px;
  font-family: var(--rr-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--rr-ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}
.rr-panel h4 .n {
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  color: var(--rr-amber);
  background: var(--rr-amber-dim);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.14em;
}

.rr-explainer {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--rr-ink-3);
}
.rr-explainer__k {
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--rr-ink-4);
  margin-right: 6px;
  text-transform: uppercase;
}

/* ── Eyebrow / hero kicker ───────────────────────────────────────── */
.rr-eyebrow {
  font-family: var(--rr-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rr-ink-3);
  margin: 0 0 8px;
}
.rr-eyebrow__sep {
  color: var(--rr-amber);
  margin: 0 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.rr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--rr-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--rr-line-2);
  background: var(--rr-panel-2);
  color: var(--rr-ink);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  font-weight: 500;
}
.rr-btn:hover {
  border-color: var(--rr-line-3);
  background: #1d2530;
}
.rr-btn--primary {
  background: var(--rr-amber);
  border-color: var(--rr-amber);
  color: #0b0d10;
  font-weight: 600;
}
.rr-btn--primary:hover {
  background: var(--rr-amber-2);
  border-color: var(--rr-amber-2);
}
.rr-btn--ghost {
  background: transparent;
}

/* ── Tag / chip ──────────────────────────────────────────────────── */
.rr-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--rr-panel-2);
  border: 1px solid var(--rr-line-2);
  color: var(--rr-ink-2);
  text-decoration: none;
  transition: all .15s;
}
a.rr-tag:hover {
  border-color: var(--rr-line-3);
  color: var(--rr-ink);
}
.rr-tag--amb {
  color: var(--rr-amber);
  border-color: rgba(255, 154, 60, 0.35);
  background: var(--rr-amber-dim);
}
.rr-tag--win {
  color: var(--rr-win);
  border-color: rgba(61, 220, 151, 0.3);
  background: rgba(61, 220, 151, 0.08);
}
.rr-tag--loss {
  color: var(--rr-loss);
  border-color: rgba(255, 90, 90, 0.3);
  background: rgba(255, 90, 90, 0.08);
}

/* ── Data tables ─────────────────────────────────────────────────── */
.rr-dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rr-dtable th {
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--rr-ink-3);
  text-align: left;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rr-line-2);
  font-weight: 500;
}
.rr-dtable td {
  padding: 12px;
  border-bottom: 1px solid var(--rr-line);
  color: var(--rr-ink-2);
  vertical-align: middle;
}
.rr-dtable tbody tr {
  transition: background .15s;
}
.rr-dtable tbody tr:hover {
  background: rgba(255, 154, 60, 0.04);
}
.rr-dtable td.mono {
  font-family: var(--rr-font-mono);
  color: var(--rr-ink);
}
.rr-dtable td.dim {
  color: var(--rr-ink-3);
}
.rr-dtable td a {
  color: var(--rr-ink);
  border-bottom: 1px dotted var(--rr-line-3);
  text-decoration: none;
}
.rr-dtable td a:hover {
  color: var(--rr-amber);
  border-color: var(--rr-amber);
}

/* res cell */
.rr-res {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-family: var(--rr-font-mono);
  font-size: 11px;
  font-weight: 700;
}
.rr-res--w {
  background: rgba(61, 220, 151, 0.12);
  color: var(--rr-win);
}
.rr-res--l {
  background: rgba(255, 90, 90, 0.12);
  color: var(--rr-loss);
}
.rr-res--d {
  background: rgba(168, 176, 186, 0.1);
  color: var(--rr-ink-3);
}

/* fmt cell */
.rr-fmt {
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.rr-fmt--gi {
  background: rgba(91, 154, 217, 0.12);
  color: var(--rr-blue);
}
.rr-fmt--nogi {
  background: rgba(160, 124, 217, 0.12);
  color: var(--rr-purple);
}
.rr-fmt--both {
  background: rgba(255, 207, 107, 0.1);
  color: var(--rr-gold);
}

/* ── Search bar primitive ────────────────────────────────────────── */
.rr-searchbar {
  display: flex;
  align-items: center;
  background: var(--rr-panel);
  border: 1px solid var(--rr-line-2);
  border-radius: 12px;
  padding: 0 16px;
  height: 56px;
  gap: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.rr-searchbar:focus-within {
  border-color: rgba(255, 154, 60, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 154, 60, 0.08);
}
.rr-searchbar svg {
  color: var(--rr-ink-3);
  flex-shrink: 0;
}
.rr-searchbar input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--rr-ink);
  font-family: var(--rr-font-display);
  font-size: 16px;
}
.rr-searchbar input::placeholder {
  color: var(--rr-ink-3);
}
.rr-searchbar kbd {
  font-family: var(--rr-font-mono);
  font-size: 10px;
  background: var(--rr-panel-2);
  border: 1px solid var(--rr-line-2);
  border-radius: 4px;
  padding: 3px 6px;
  color: var(--rr-ink-3);
}

/* ── Hero panel (used on most pages) ─────────────────────────────── */
.rr-hero {
  position: relative;
  padding: 32px 24px;
  background: var(--rr-panel);
  border: 1px solid var(--rr-line);
  border-radius: 14px;
  overflow: hidden;
}
.rr-hero h1 {
  margin: 6px 0 18px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--rr-ink);
}
.rr-hero h1 i {
  font-style: normal;
  color: var(--rr-amber);
}
.rr-hero h1.lg {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

/* ── Footer ─────────────────────────────────────────────────────── */
.rr-foot {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--rr-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--rr-ink-4);
  text-transform: uppercase;
  border-top: 1px solid var(--rr-line);
  margin-top: 12px;
}

/* ── Pokemon-style fighter card (mini) ───────────────────────────── */
.rr-fcard {
  position: relative;
  width: 220px;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(
      135deg,
      rgba(255, 154, 60, 0.18),
      rgba(91, 154, 217, 0.14) 50%,
      rgba(160, 124, 217, 0.18)
    ), #0a0c0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: inherit;
  display: block;
}
.rr-fcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 207, 107, 0.18), transparent 60%),
    radial-gradient(80% 60% at 50% 100%, rgba(91, 154, 217, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.rr-fcard__head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.rr-fcard__num {
  font-family: var(--rr-font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
}
.rr-fcard__rank {
  font-family: var(--rr-font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--rr-gold);
  border: 1px solid rgba(255, 207, 107, 0.4);
}
.rr-fcard__avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1.05;
  border-radius: 8px;
  background: repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04) 0 4px,
      transparent 4px 8px
    ), linear-gradient(180deg, #1a2030, #0d1117);
  display: grid;
  place-items: center;
  font-family: var(--rr-font-display);
  font-size: 56px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.04em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rr-fcard__name {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}
.rr-fcard__meta {
  position: relative;
  z-index: 1;
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 10px;
}
.rr-fcard__rating {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}
.rr-fcard__rating-k {
  font-family: var(--rr-font-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.5);
}
.rr-fcard__rating-v {
  font-family: var(--rr-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rr-amber);
}
.rr-fcard__stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 10px;
  font-family: var(--rr-font-mono);
  font-size: 9.5px;
}
.rr-fcard__stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  text-align: center;
}
.rr-fcard__stats span:first-child {
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
  letter-spacing: 0.14em;
}
.rr-fcard__stats span:last-child {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--rr-font-display);
}
.rr-fcard__belt {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 2;
  background: linear-gradient(90deg, var(--rr-amber), var(--rr-amber-2));
}

/* Belt color helper */
.rr-belt-WHITE {
  color: #e8e0d0;
  border-color: rgba(232, 224, 208, 0.33) !important;
}
.rr-belt-BLUE {
  color: #5b9ad9;
  border-color: rgba(91, 154, 217, 0.33) !important;
}
.rr-belt-PURPLE {
  color: #a07cd9;
  border-color: rgba(160, 124, 217, 0.33) !important;
}
.rr-belt-BROWN {
  color: #a07452;
  border-color: rgba(160, 116, 82, 0.33) !important;
}
.rr-belt-BLACK {
  color: #9aa1ad;
  border-color: rgba(154, 161, 173, 0.33) !important;
}
