/* ==========================================================
   MyTacklebox — dark premium theme
   Deep navy/purple gradient, glass cards, purple accent.
   System font stack for body; self-hosted Bricolage Grotesque (OFL,
   assets/fonts/) for headings, big numbers, and the brand. No CDN.
   ========================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent:       #8b7cf6;
  --accent-soft:  rgba(139, 124, 246, 0.16);
  --accent-line:  rgba(139, 124, 246, 0.45);
  --bg-0:         #0b0a1a;
  --bg-1:         #14112b;
  --glass:        rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --line:         rgba(255, 255, 255, 0.09);
  --line-strong:  rgba(255, 255, 255, 0.16);
  --text:         #eae7f7;
  --text-dim:     #a49ec6;
  --text-faint:   #8a85ad;   /* 5.6:1 on --bg-0 (was #6f6a92, ~3.9:1) */
  --placeholder:  #9a94c2;
  --radius:       16px;
  --danger:       #f472b6;

  /* Typography scale — display / title / section / body / meta / micro */
  --fs-display:   28px;
  --fs-title:     21px;
  --fs-section:   17px;
  --fs-body:      15px;
  --fs-meta:      13px;
  --fs-micro:     11px;
  --lh-tight:     1.2;
  --lh-snug:      1.35;
  --track-caps:   0.09em;

  /* Card depth */
  --shadow-card:  0 1px 0 rgba(255, 255, 255, 0.06) inset,
                  0 10px 28px rgba(4, 3, 14, 0.35),
                  0 2px 6px rgba(4, 3, 14, 0.28);
  --shadow-lift:  0 1px 0 rgba(255, 255, 255, 0.06) inset,
                  0 14px 34px rgba(4, 3, 14, 0.45),
                  0 4px 10px rgba(4, 3, 14, 0.32);

  /* UI overhaul tokens: 3 surface elevations, gold brag accent, display
   * face, radii, spacing scale, easing. Existing tokens above are kept. */
  --surface-0:    #0b0a1a;                 /* page */
  --surface-1:    rgba(255, 255, 255, 0.04);  /* sections */
  --surface-2:    rgba(255, 255, 255, 0.07);  /* cards */
  --surface-3:    rgba(255, 255, 255, 0.11);  /* popovers, sheets */
  --gold:         #fbbf24;                 /* brag accent ONLY: weights, trophies, records */
  --gold-soft:    rgba(251, 191, 36, 0.14);
  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-lg:    22px;
  --radius-sm:    10px;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --ease:         cubic-bezier(.2, .7, .2, 1);
}

/* Motion kill switch: users who ask for reduced motion get none at all. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(139, 124, 246, 0.18), transparent 60%),
    radial-gradient(900px 550px at 90% 0%,  rgba(96, 165, 250, 0.09), transparent 55%),
    radial-gradient(1000px 700px at 60% 110%, rgba(139, 124, 246, 0.11), transparent 60%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 55%, #1a1230 100%);
  background-attachment: fixed;
}

/* Galaxy star speckle: two static repeating SVG dot tiles layered over the
 * nebula gradients. Purely static — no animation, no parallax, no flicker. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20width%3D%27280%27%20height%3D%27280%27%3E%3Ccircle%20cx%3D"91.4"%20cy%3D"43.6"%20r%3D"0.79"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.25"/%3E%3Ccircle%20cx%3D"28.0"%20cy%3D"162.8"%20r%3D"0.95"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.2"/%3E%3Ccircle%20cx%3D"121.7"%20cy%3D"21.3"%20r%3D"0.45"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.28"/%3E%3Ccircle%20cx%3D"36.2"%20cy%3D"63.6"%20r%3D"0.78"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.48"/%3E%3Ccircle%20cx%3D"163.6"%20cy%3D"15.7"%20r%3D"0.53"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.33"/%3E%3Ccircle%20cx%3D"81.9"%20cy%3D"41.8"%20r%3D"0.47"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.24"/%3E%3Ccircle%20cx%3D"51.9"%20cy%3D"162.5"%20r%3D"0.78"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.26"/%3E%3Ccircle%20cx%3D"198.5"%20cy%3D"157.8"%20r%3D"0.77"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.31"/%3E%3Ccircle%20cx%3D"120.0"%20cy%3D"88.7"%20r%3D"0.75"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.29"/%3E%3Ccircle%20cx%3D"70.6"%20cy%3D"51.6"%20r%3D"0.87"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.25"/%3E%3Ccircle%20cx%3D"147.0"%20cy%3D"243.5"%20r%3D"0.84"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.23"/%3E%3Ccircle%20cx%3D"34.6"%20cy%3D"117.4"%20r%3D"0.85"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.28"/%3E%3Ccircle%20cx%3D"118.4"%20cy%3D"267.5"%20r%3D"0.45"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.33"/%3E%3Ccircle%20cx%3D"95.9"%20cy%3D"98.6"%20r%3D"0.7"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.42"/%3E%3Ccircle%20cx%3D"233.8"%20cy%3D"262.7"%20r%3D"0.68"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.37"/%3E%3Ccircle%20cx%3D"203.8"%20cy%3D"87.5"%20r%3D"0.75"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.38"/%3E%3Ccircle%20cx%3D"80.5"%20cy%3D"108.5"%20r%3D"0.8"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.23"/%3E%3Ccircle%20cx%3D"100.1"%20cy%3D"170.6"%20r%3D"0.7"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.2"/%3E%3Ccircle%20cx%3D"37.7"%20cy%3D"70.3"%20r%3D"0.63"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.45"/%3E%3Ccircle%20cx%3D"47.9"%20cy%3D"112.9"%20r%3D"0.57"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.27"/%3E%3Ccircle%20cx%3D"240.5"%20cy%3D"78.8"%20r%3D"0.65"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.26"/%3E%3Ccircle%20cx%3D"266.3"%20cy%3D"43.7"%20r%3D"0.51"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.21"/%3E%3Ccircle%20cx%3D"5.3"%20cy%3D"231.4"%20r%3D"0.51"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.23"/%3E%3Ccircle%20cx%3D"117.6"%20cy%3D"103.9"%20r%3D"0.74"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.48"/%3E%3Ccircle%20cx%3D"239.1"%20cy%3D"264.3"%20r%3D"0.79"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.4"/%3E%3Ccircle%20cx%3D"250.3"%20cy%3D"217.3"%20r%3D"0.92"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.42"/%3E%3Ccircle%20cx%3D"111.9"%20cy%3D"110.8"%20r%3D"0.69"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.27"/%3E%3Ccircle%20cx%3D"20.6"%20cy%3D"59.6"%20r%3D"0.5"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.25"/%3E%3Ccircle%20cx%3D"30.3"%20cy%3D"158.4"%20r%3D"0.72"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.48"/%3E%3Ccircle%20cx%3D"9.0"%20cy%3D"243.3"%20r%3D"0.77"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.28"/%3E%3Ccircle%20cx%3D"265.7"%20cy%3D"168.2"%20r%3D"0.68"%20fill%3D"%23cfc8ff"%20fill-opacity%3D"0.26"/%3E%3Ccircle%20cx%3D"276.1"%20cy%3D"130.6"%20r%3D"0.69"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.25"/%3E%3Ccircle%20cx%3D"208.9"%20cy%3D"206.3"%20r%3D"0.69"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.38"/%3E%3Ccircle%20cx%3D"8.4"%20cy%3D"264.5"%20r%3D"0.72"%20fill%3D"%23e6e2ff"%20fill-opacity%3D"0.28"/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 280px 280px;
  opacity: 1;
}
body::after {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20width%3D%27280%27%20height%3D%27280%27%3E%3Ccircle%20cx%3D"47.5"%20cy%3D"192.4"%20r%3D"1.15"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.39"/%3E%3Ccircle%20cx%3D"61.6"%20cy%3D"220.8"%20r%3D"1.22"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.4"/%3E%3Ccircle%20cx%3D"141.4"%20cy%3D"67.2"%20r%3D"0.9"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.36"/%3E%3Ccircle%20cx%3D"163.6"%20cy%3D"21.1"%20r%3D"1.22"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.32"/%3E%3Ccircle%20cx%3D"66.2"%20cy%3D"13.7"%20r%3D"1.3"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.47"/%3E%3Ccircle%20cx%3D"243.5"%20cy%3D"172.0"%20r%3D"0.91"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.35"/%3E%3Ccircle%20cx%3D"139.3"%20cy%3D"34.0"%20r%3D"1.28"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.36"/%3E%3Ccircle%20cx%3D"44.7"%20cy%3D"227.6"%20r%3D"0.95"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.53"/%3E%3Ccircle%20cx%3D"127.1"%20cy%3D"154.4"%20r%3D"1.04"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.4"/%3E%3Ccircle%20cx%3D"53.6"%20cy%3D"12.3"%20r%3D"1.25"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.32"/%3E%3Ccircle%20cx%3D"217.4"%20cy%3D"59.6"%20r%3D"1.29"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.52"/%3E%3Ccircle%20cx%3D"210.3"%20cy%3D"212.5"%20r%3D"1.13"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.47"/%3E%3Ccircle%20cx%3D"35.8"%20cy%3D"133.5"%20r%3D"1.23"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.31"/%3E%3Ccircle%20cx%3D"256.8"%20cy%3D"247.0"%20r%3D"1.06"%20fill%3D"%23ffffff"%20fill-opacity%3D"0.36"/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 280px 280px;
  opacity: 1;
}

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

::selection { background: rgba(139, 124, 246, 0.35); }

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
textarea:focus-visible { border-radius: 10px; }

img { display: block; }

h1, h2, h3 { line-height: var(--lh-tight); margin: 0 0 6px; letter-spacing: -0.015em; }
h1 { font-size: var(--fs-display); font-weight: 750; }
h2 { font-size: var(--fs-section); font-weight: 700; }
h3 { font-size: var(--fs-body); }

/* ------------------------- layout ------------------------- */

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Cards lift 2px max on hover — shadow deepens, no scale, no zoom. */
.catch-card,
.sp-row,
.stat-tile {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.catch-card:hover,
a.sp-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* ------------------------- buttons ------------------------ */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn.wide { width: 100%; text-align: center; }

.btn-primary {
  background: var(--accent);
  color: #17122e;
}
.btn-primary:hover { background: #9d90f8; color: #17122e; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }

/* ------------------------- forms -------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field > span { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }

.composer-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field.small { max-width: 150px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--line-strong); }
input:focus, textarea:focus { border-color: var(--accent-line); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
textarea { resize: vertical; }

/* Styled file pickers: the raw input stays in place (focusable,
 * required-validation works) but is visually hidden behind a button. */
.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  font-size: 0;
}
.file-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: #c9c0fb;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.file-picker:hover .file-btn { background: rgba(139, 124, 246, 0.28); }
.file-picker:focus-within .file-btn {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.file-name {
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name.has-file { color: var(--text); }

.form-errors {
  margin: 0 0 12px;
  padding: 10px 14px;
  list-style: none;
  border: 1px solid rgba(244, 114, 182, 0.4);
  background: rgba(244, 114, 182, 0.08);
  border-radius: 10px;
  color: #f9a8d4;
  font-size: 13.5px;
}
p.form-errors { padding: 10px 14px; }

/* ------------------------- composer ----------------------- */

.composer { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.composer form { display: flex; flex-direction: column; gap: 12px; }
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Brightened from --text-faint (#6f6a92) — borderline WCAG on dark. */
.points-hint { font-size: 12.5px; color: var(--text-dim); }
.points-hint a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.points-hint a:hover { color: var(--accent); }

/* ------------------------- tabs --------------------------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dim);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); color: #c9c0fb; border: 1px solid var(--accent-line); margin: -1px; }

/* ------------------------- catch cards -------------------- */

.catch-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.card-head { display: flex; gap: 12px; align-items: flex-start; }
.card-head-main { min-width: 0; flex: 1; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }
.avatar.sm { width: 28px; height: 28px; }
.avatar.xl { width: 88px; height: 88px; border-width: 2px; }

.card-titleline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.uname { font-weight: 700; color: var(--text); }
.uname:hover { color: #c9c0fb; }

.card-sub { font-size: 12.5px; color: var(--text-faint); }

.badge-row { display: inline-flex; gap: 5px; flex-wrap: wrap; }

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: #c9c0fb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.badge-icon { flex: none; }

.catch-photo-link { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); transition: border-color 0.15s ease; }
.catch-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.catch-photo-link:hover { border-color: var(--accent-line); }
.catch-photo-link:hover .catch-photo { transform: scale(1.015); }

.catch-stats {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-dim);
}
.catch-stats .species { font-weight: 700; font-size: 16px; color: var(--text); }
.catch-stats strong { color: var(--text); font-weight: 700; }

.story { margin: 0; color: var(--text-dim); }

.card-actions { display: flex; align-items: center; gap: 14px; }

.like-form { display: inline-flex; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.like-btn:hover { color: var(--danger); border-color: rgba(244, 114, 182, 0.5); background: rgba(244, 114, 182, 0.08); }
.like-btn.liked { color: var(--danger); border-color: rgba(244, 114, 182, 0.55); background: rgba(244, 114, 182, 0.12); }
.like-btn svg { transition: fill 0.15s ease; }
.like-btn:hover svg,
.like-btn.liked svg { fill: currentColor; }

.comment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
}

.comments { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment { display: flex; gap: 9px; align-items: flex-start; }
.comment-body { font-size: 13.5px; min-width: 0; }
.comment-text { color: var(--text-dim); margin-left: 6px; overflow-wrap: anywhere; }
.comment-time { display: block; font-size: 11px; color: var(--text-faint); }

.comment-form { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment-form input[type="text"] { flex: 1; }

.empty-state { padding: 28px; text-align: center; color: var(--text-dim); }
.empty-state svg { margin: 0 auto 10px; opacity: 0.45; }
.empty-state h1 { font-size: 20px; }

/* ------------------------- auth --------------------------- */

.auth-card { max-width: 480px; width: 100%; margin: 24px auto 0; padding: 28px; }
.auth-brand { display: block; width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 22px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38); }
.auth-card form { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }
.auth-sub { color: var(--text-dim); margin: 0; }
.auth-alt { margin-top: 16px; font-size: 13.5px; color: var(--text-dim); }
.auth-fee-note { margin: 12px 0 0; font-size: 13px; color: var(--text-dim); text-align: center; }

/* ------------------------- profile ------------------------ */

.profile-hero { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.profile-id { display: flex; gap: 18px; align-items: flex-start; }
.profile-id-main { flex: 1; min-width: 0; }
.profile-meta { margin: 2px 0; color: var(--text-dim); font-size: 13.5px; }
.profile-bio { margin: 10px 0 0; color: var(--text); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}
/* Desktop: fixed 3x2 so six tiles never wrap 5+1. Mobile (≤640px) keeps the
 * auto-fit 3-column behavior, which already fits 390px. */
@media (min-width: 641px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}
.stat-tile .stat-icon { color: var(--accent); opacity: 0.85; margin-bottom: 3px; }
.stat-tile:hover { border-color: var(--accent-line); }
.stat-num { font-size: 19px; font-weight: 700; color: var(--text); }
.stat-num.stat-text { font-size: 14px; }
.stat-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.section-title {
  margin-top: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--track-caps);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.badge-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: #c9c0fb;
}
.badge-tile .badge-name { font-weight: 700; font-size: 13px; }
.badge-tile .badge-desc { font-size: 11px; color: var(--text-dim); }
.badge-tile.locked {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-faint);
  opacity: 0.55;
}

.catch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.catch-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--text);
}
.catch-tile:hover { border-color: var(--accent-line); color: var(--text); }
.catch-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.catch-tile-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(10, 8, 22, 0.88));
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-dim);
}
.catch-tile-overlay .species { font-weight: 700; font-size: 13.5px; color: var(--text); }

/* ------------------------- leaderboard -------------------- */

.lb-hero { text-align: center; padding: 6px 0 2px; }
.lb-tag { color: var(--text-faint); font-size: 13px; margin: 0; }

.lb-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .lb-columns { grid-template-columns: 1fr; }
}

.lb-panel { padding: 20px; }
.lb-sub { color: var(--text-faint); font-size: 12.5px; margin: 0 0 14px; }

.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}
.lb-row:hover { background: var(--glass-strong); }

.lb-row .uname {
  flex: 1;
  min-width: 0;
  max-width: 220px; /* headroom so long names never crowd the Lv tag */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 4px;
}

.lb-rank {
  width: 26px;
  height: 26px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: #8d87b5; /* one shade lighter than --text-faint for legibility */
  font-size: 13px;
}
.lb-rank.top { color: var(--accent); background: var(--accent-soft); }

/* Medal tints for the podium: gold / silver / bronze.
 * Silver is deliberately brighter + cooler with a sheen and a crisp inner
 * border so rank 2 never reads as the default gray of ranks 4-6. */
.lb-top1 .lb-rank { color: #fbbf24; background: rgba(251, 191, 36, 0.16); }
.lb-top2 .lb-rank {
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.38), rgba(148, 163, 184, 0.18) 55%, rgba(226, 232, 240, 0.30));
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.55);
}
.lb-top3 .lb-rank { color: #e0a878; background: rgba(217, 119, 87, 0.16); }
.lb-row + .lb-row { border-top: 1px solid var(--line); }
.lb-row.lb-top2 {
  /* Crisp silver ring as a real border with 1px of padding given back,
   * so the highlighted row's content lines up with every other row
   * (an inset box-shadow ring used to visually inset the content ~1px). */
  border: 1px solid rgba(203, 213, 225, 0.28);
  /* border adds 1px on each side; giving it back keeps the content at the
   * exact same offsets as plain rows (top 10 = 1+9, bottom 9 = 1+8, sides 8 = 1+7). */
  padding: 9px 7px 8px;
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.09), rgba(203, 213, 225, 0.02) 60%, rgba(241, 245, 249, 0.07));
  box-shadow: inset 0 14px 16px -14px rgba(241, 245, 249, 0.35);
}
.lb-top1 { background: rgba(251, 191, 36, 0.045); }
.lb-top3 { background: rgba(217, 119, 87, 0.045); }

.lb-lvl { margin-left: auto; font-size: 12px; color: #b7aede; white-space: nowrap; flex: none; }
.lb-pts { font-weight: 700; font-size: 14px; color: #c9c0fb; min-width: 86px; text-align: right; white-space: nowrap; flex: none; }

/* ------------------------- catch of the week --------------- */

.spotlight {
  padding: 18px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(251, 191, 36, 0.015) 45%, transparent 70%),
    var(--glass);
  margin-bottom: 18px;
}
.spotlight-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.spotlight-trophy {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.spotlight-head h2 { margin: 0; font-size: 17px; letter-spacing: 0.2px; }
.spotlight-sub { font-size: 12.5px; color: var(--text-faint); }
.spotlight-head-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.spotlight-photo-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.28);
  transition: border-color 0.15s ease;
}
.spotlight-photo-link:hover { border-color: rgba(251, 191, 36, 0.5); }
.spotlight-photo { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }

.spotlight-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}
.spotlight-catch { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.spotlight-species { font-weight: 700; font-size: 15.5px; }
.spotlight-weight { font-size: 13px; color: var(--text-dim); }
.spotlight-weight strong { color: #fbbf24; font-size: 15px; }
.spotlight-angler {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}
.spotlight-angler:hover { border-color: var(--accent-line); background: rgba(255, 255, 255, 0.06); }

.spotlight-none { margin: 4px 0 2px; color: var(--text-dim); font-size: 14px; }
.spotlight-none a { color: var(--accent); }

/* ------------------------- owner card actions -------------- */

.btn-sm { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 12.5px; }

.card-owner-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
}
.card-owner-actions .inline-delete {
  border-top: none;
  padding-top: 0;
  display: inline-flex;
}
.detail-owner-actions { border-top: none; padding-top: 0; margin-top: 12px; }

/* Subtle zoom cue on the detail photo: quiet glass chip in the corner,
 * fades in on hover only. No animation beyond a short opacity ease. */
.detail-photo-link { position: relative; display: block; }
.photo-zoom-cue {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text);
  background: rgba(10, 8, 22, 0.72);
  border: 1px solid var(--line-strong);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.detail-photo-link:hover .photo-zoom-cue,
.detail-photo-link:focus-visible .photo-zoom-cue { opacity: 1; }

/* ------------------------- misc --------------------------- */

.site-footer {
  text-align: center;
  padding: 26px 16px 34px;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* ------------------------- responsive (≤640px) -------------------------
 * Desktop layout above is untouched; these rules only apply on small
 * viewports (390x844 iPhone-class tested).
 * ---------------------------------------------------------------------- */
@media (max-width: 640px) {
  .btn { padding: 7px 12px; font-size: 13px; }

  /* No native resize grip on touch — textarea can't be dragged out of the card. */
  textarea { resize: none; }

  /* Composer / auth forms: stack field rows and shrink small fields. */
  .composer-row { flex-direction: column; gap: 10px; }
  .field.small { max-width: none; }
  .composer, .auth-card, .profile-hero, .catch-card { padding: 14px; }
  .composer-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .composer-foot .btn { width: 100%; }

  /* Leaderboard panels already stack via the 640px rule above; give
   * long usernames more room by relaxing the points column. */
  .lb-pts { min-width: 0; }
  .lb-row .uname { max-width: none; }

  /* Profile hero: let the actions wrap under the identity block and
   * shrink the avatar; long usernames break instead of pushing layout. */
  .profile-id { flex-wrap: wrap; }
  .avatar.xl { width: 64px; height: 64px; }
  .profile-id-main h1 { overflow-wrap: anywhere; font-size: 22px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { width: 100%; text-align: center; }

  /* Catch photos and grids scale down gracefully. */
  .catch-photo { aspect-ratio: 4 / 3; }
  .catch-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  /* Feed cards: tighten stats line and comment input. */
  .catch-stats { gap: 10px; font-size: 13px; }
  .comment-form { flex-wrap: wrap; }
  .comment-form .btn { flex: none; }
  .card-titleline .badge-row { width: 100%; }
}

/* Very small phones: give the greeting line real slack by dropping the
 * pts/level/level-name meta to its own line under the h1. */
@media (max-width: 480px) {
  .greet .greet-meta { flex-basis: 100%; }
}

/* ---- Species index ---- */
/* Fixed 5-column grid (name | catches | lbs total | lbs best | recent) so the
 * numeric columns line up down the page instead of drifting like flex items. */
.sp-list { display: flex; flex-direction: column; gap: 10px; }
.sp-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(96px, 1fr) minmax(116px, 1.15fr) minmax(96px, 1fr) minmax(110px, 1.1fr);
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
a.sp-row:hover { background: var(--glass-strong); border-color: var(--accent-line); }
.sp-head {
  padding: 4px 18px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sp-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.sp-row .stat { font-size: 14px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.sp-row .stat strong { color: var(--text); font-weight: 700; }
.sp-head .stat { text-align: right; }
.sp-last { text-align: right; }
@media (max-width: 640px) {
  /* Collapse to one column: species name on top, stats stacked under it. */
  .sp-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .sp-name { font-size: 15px; }
  .sp-row .stat { text-align: left; font-size: 13px; }
  .sp-last { text-align: left; }
  .sp-head { display: none; }
}

/* ------------------------- feed hero (logged out) -------- */

.feed-hero {
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.feed-hero .feed-hero-icon { color: var(--accent); opacity: 0.9; margin-bottom: 2px; }
.feed-hero h1 { font-size: var(--fs-display); }
.feed-hero .feed-hero-tag {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--fs-body);
  max-width: 44ch;
}
.feed-hero .feed-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------- greeting line (logged in) ----- */

.greet {
  padding: 4px 8px 0 2px;  /* right slack so the line never hits the edge */
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.greet h1 { margin: 0; font-size: var(--fs-title); }
.greet .greet-meta { color: var(--text-dim); font-size: var(--fs-meta); }
.greet .greet-meta strong { color: #c9c0fb; font-weight: 700; }

/* ------------------------- level progress (profile) ------ */

.level-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.level-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.level-progress-label { font-size: var(--fs-meta); color: var(--text-dim); }
.level-progress-label strong { color: #c9c0fb; }
.level-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  overflow: hidden;
}
.level-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c6cf0, #a99cf9);
  box-shadow: 0 0 8px rgba(139, 124, 246, 0.45);
}

/* ------------------------- how it works ------------------ */

.hiw-hero { text-align: center; padding: 8px 0 2px; }
.hiw-hero .hiw-hero-icon { color: var(--accent); opacity: 0.9; margin-bottom: 4px; }
.hiw-hero p { margin: 0; }

.hiw-card { padding: 22px; }
.hiw-card > .section-title { display: block; margin-bottom: 12px; }

.hiw-formula {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hiw-term {
  /* Real two-column grid: the "+2 points" label never collides with a
   * wrapped second line of the description at any viewport width. */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.hiw-term .hiw-pts {
  font-weight: 700;
  color: #c9c0fb;
  min-width: 118px;
  font-variant-numeric: tabular-nums;
}
.hiw-term .hiw-what { color: var(--text-dim); font-size: var(--fs-meta); }
.hiw-formula-op {
  text-align: center;
  color: var(--text-faint);
  font-weight: 700;
  line-height: 1;
}

.hiw-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;   /* matches formula-row rhythm */
  margin-top: 12px;
}
.hiw-example {
  padding: 10px 14px;  /* same vertical padding as .hiw-term rows */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.hiw-example .hiw-catch { font-weight: 600; color: var(--text); }
.hiw-example .hiw-math {
  margin-top: 4px;
  font-size: var(--fs-meta);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.hiw-example .hiw-total { color: #c9c0fb; font-weight: 700; }

.hiw-levels {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-meta);
}
.hiw-levels th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  font-size: var(--fs-micro);
  color: var(--text-dim);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-strong);
}
.hiw-levels td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.hiw-levels tr:last-child td { border-bottom: none; }
.hiw-levels td:first-child { color: #c9c0fb; font-weight: 700; }
.hiw-levels td:nth-child(3) { color: var(--text-faint); font-style: italic; }

.hiw-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hiw-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.hiw-badge .badge-icon { color: #c9c0fb; flex: none; }
.hiw-badge-name { font-weight: 700; color: var(--text); min-width: 140px; }
.hiw-badge-desc { color: var(--text-dim); font-size: var(--fs-meta); }

.hiw-faq { display: flex; flex-direction: column; gap: 8px; }
.hiw-faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0;
}
.hiw-faq summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hiw-faq summary::-webkit-details-marker { display: none; }
.hiw-faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.hiw-faq details[open] summary::after { content: "\2212"; }
.hiw-faq details[open] summary { border-bottom: 1px solid var(--line); }
.hiw-faq .hiw-answer {
  padding: 12px 14px;
  color: var(--text-dim);
  font-size: var(--fs-body);
  margin: 0;
}

@media (max-width: 640px) {
  .feed-hero { padding: 22px 14px; }
  .hiw-card { padding: 14px; }
  .hiw-badge { flex-wrap: wrap; }
  .hiw-badge-name { min-width: 0; }
  .hiw-term .hiw-pts { min-width: 0; }
  .hiw-levels td:nth-child(3),
  .hiw-levels th:nth-child(3) { display: none; }
}

/* ---------- notifications page ---------- */
.notif-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.notif-row.unread {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 55%), var(--glass);
}
.notif-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.notif-text { font-size: var(--fs-body); color: var(--text); }
.notif-text .uname { margin-right: 4px; }
.notif-time { font-size: var(--fs-meta); color: var(--text-faint); }
.notif-view { flex: none; }

/* ---------- search page ---------- */
.search-anglers { display: flex; flex-direction: column; gap: 10px; }
.search-angler {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.search-angler-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.search-angler-bio {
  font-size: var(--fs-meta);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-angler-you { font-size: var(--fs-micro); color: var(--text-faint); letter-spacing: var(--track-caps); text-transform: uppercase; }
.search-species { display: flex; flex-wrap: wrap; gap: 10px; }
.search-species-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.search-species-chip:hover { border-color: var(--accent-line); }
.search-species-chip svg { color: var(--accent); flex: none; }
.search-species-meta { font-size: var(--fs-meta); color: var(--text-faint); }
.search-catches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.search-catch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.search-catch:hover { border-color: var(--accent-line); }
.search-catch-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 4px;
}
.search-catch-loc { font-size: var(--fs-meta); color: var(--text-dim); }
.search-catch-meta { font-size: var(--fs-micro); color: var(--text-faint); }

/* ---------- photo lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 5, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-frame {
  position: relative;
  max-width: min(92vw, 900px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  display: block;
  object-fit: contain;
}
.lightbox-caption {
  text-align: center;
  color: var(--text-dim);
  font-size: var(--fs-meta);
  letter-spacing: 0.02em;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(13, 11, 27, 0.8);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover { color: var(--text); border-color: var(--accent-line); }
.catch-photo-link, .catch-tile { cursor: zoom-in; }

@media (max-width: 640px) {
  .lightbox { padding: 12px; }
}

/* ==========================================================
   Round: records & depth — catch detail, species best, PWA-lite
   touches, mobile touch-target refinement.
   ========================================================== */

/* ---------- catch detail page ---------- */
.catch-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  gap: 14px;
}
.detail-back {
  flex: none;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.detail-back:hover { color: var(--text); border-color: var(--accent-line); }
.detail-story {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.detail-loc { display: inline-flex; align-items: center; gap: 5px; }
.detail-actions { flex-wrap: wrap; }
.liker-row { display: inline-flex; align-items: center; }
.liker-row .liker {
  display: inline-block;
  margin-left: -6px;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.liker-row .liker:first-child { margin-left: 0; }
.liker-row .liker:hover { transform: translateY(-2px); }
.liker-row .avatar.sm { border: 1px solid var(--line-strong); }
.detail-no-comments { border-top: 1px solid var(--line); padding-top: 10px; }
.detail-no-comments p { margin: 0; }
.delete-catch-form {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
}
/* Danger action: pink = the like/heart danger accent, calm until hover. */
.btn-danger {
  background: transparent;
  border: 1px solid rgba(244, 114, 182, 0.45);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(244, 114, 182, 0.1); border-color: rgba(244, 114, 182, 0.6); }
.btn-danger svg { flex: none; }

/* The comment pill is a link into the catch detail page now. */
.comment-pill { text-decoration: none; }
a.comment-pill:hover { color: var(--text); border-color: var(--accent-line); }

/* Lightbox deep link into the catch detail page. */
.lightbox-more {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c9c0fb;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lightbox-more:hover { background: rgba(139, 124, 246, 0.28); color: var(--text); }

/* ---------- species records: "Best" subline ---------- */
.sp-best {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: #c9c0fb;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

/* ---------- composer: entered values read brighter than placeholders ---- */
/* One step brighter than --text (#eae7f7). Placeholders keep the dimmer
 * #9a94c2 via input::placeholder, so value vs placeholder is unmistakable. */
.composer input, .composer textarea { color: #f6f3ff; }

/* Tap accuracy for the inline "how points work" link: padding with a
 * matching negative margin keeps the visual layout identical while the
 * touch target grows past 44px. */
.points-hint a { display: inline-block; padding: 8px 6px; margin: -8px -6px; }


/* ------------------- feed filters (round 5) --------------- */
/* Segmented scope tabs + species dropdown share one row on desktop,
 * stack under 640px. Same glass pill language as .tabs. */
.feed-filters {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.feed-tabs { flex: 1 1 280px; }
.species-filter {
  flex: 0 1 260px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.15s ease;
}
.species-filter:hover { border-color: var(--accent-line); }
.species-filter:focus-within { border-color: var(--accent-line); }
.species-filter-icon { flex: none; display: inline-flex; color: var(--text-faint); }
.species-filter select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 2px;
}
.species-filter select:focus { outline: none; }
.species-filter option { background: var(--bg-1); color: var(--text); }
.species-filter .btn { padding: 6px 10px; font-size: 13px; flex: none; }

/* ------------------- profile tabs + about panel (round 5) - */
.profile-tabs { margin-top: 0; } /* .wrap gap handles spacing */

.about-panel { padding: 22px; display: grid; gap: 22px; }
@media (min-width: 641px) {
  .about-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.about-bio { margin: 8px 0 0; color: var(--text); line-height: 1.55; }
.about-facts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-facts li { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; }
.about-facts svg { flex: none; color: var(--accent); opacity: 0.85; }
.about-facts strong { color: var(--text); font-weight: 600; }
.about-most {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.about-most:hover { border-color: var(--accent-line); background: var(--glass-strong); }
.about-most img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.about-most-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.about-most-main .species { font-weight: 700; font-size: 15px; color: var(--text); }
.about-most-meta { font-size: 12.5px; color: var(--text-dim); }
.about-most-heart { margin-left: auto; flex: none; color: var(--danger); opacity: 0.85; }
.about-empty { margin: 14px 0 0; color: var(--text-dim); font-size: 14px; }

/* Mobile rebalance: six stat tiles go 2 cols x 3 rows at <=480px so the
 * full-word labels ("Favorite species", "Followers / Following") keep
 * their words whole instead of squeezing into 3 columns. */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-label { letter-spacing: 0.04em; }
}

/* ------------------------- paid access ------------------------- */


/* honeypot field: real visitors never see it */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.paid-welcome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(139, 124, 246, 0.35);
}
.paid-welcome svg { flex-shrink: 0; color: #8b7cf6; }
.paid-welcome h2 { margin: 0 0 4px; font-size: 17px; }
.paid-welcome p { margin: 0; color: var(--muted, #b9b3d9); font-size: 14px; }

.paywall-card { text-align: left; }
.paywall-copy { color: var(--muted, #b9b3d9); font-size: 14.5px; margin: 6px 0 16px; }

.checkout-card {
  max-width: 560px;
  margin: 32px auto 72px;   /* extra bottom air: full card + keep-browsing link never sit flush on the viewport edge */
  padding: 34px 36px;
  text-align: center;
}
.checkout-icon { color: #8b7cf6; margin-bottom: 8px; }
.checkout-card h1 { font-size: 24px; margin: 10px 0 8px; }
.checkout-sub { color: var(--muted, #b9b3d9); font-size: 15px; margin: 0 0 18px; }
.checkout-funds {
  list-style: none;
  margin: 0 auto 22px;
  padding: 14px 20px;
  max-width: 420px;
  text-align: left;
  border: 1px solid rgba(139, 124, 246, 0.25);
  border-radius: 12px;
  background: rgba(139, 124, 246, 0.06);
}
.checkout-funds li {
  padding: 6px 0 6px 26px;
  position: relative;
  color: var(--muted, #c6c0e8);
  font-size: 14.5px;
}
.checkout-funds li::before {
  content: '\2713';
  position: absolute;
  left: 4px;
  color: #8b7cf6;
  font-weight: 700;
}
.checkout-note { margin: 14px 0 0; font-size: 13px; color: #9c96c4; }


/* ------------------- identity round: chip menu, getting started, settings ------------------- */


/* getting-started card */
.getting-started {
  padding: 20px 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(139, 124, 246, 0.35);
}
.gs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gs-head h2 { margin: 0; font-size: 17px; }
.gs-dismiss { padding: 4px 12px; font-size: 12.5px; }
.gs-sub { margin: 6px 0 14px; color: var(--muted, #b9b3d9); font-size: 14px; }
.gs-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.gs-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
}
.gs-steps li.done { color: var(--text); }
.gs-steps li.done .gs-check {
  border-color: #8b7cf6;
  background: rgba(139, 124, 246, 0.18);
}
.gs-steps li.done .gs-check::after {
  content: '\2713';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b7cf6;
  font-size: 12px;
  font-weight: 700;
}

/* settings page */
.settings-card { max-width: 640px; margin: 0 auto 72px; padding: 30px 34px; }
.settings-card h1 { font-size: 22px; margin: 0 0 14px; }
.settings-saved {
  color: #34d399;
  font-size: 14px;
  margin: 0 0 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(52, 211, 153, 0.08);
}
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-avatar-row { display: flex; align-items: center; gap: 18px; }
.settings-avatar-row .field { flex: 1; }


/* ---------------- privacy round: visibility picker, chip, export ---------------- */
.vis-note { font-size: 12.5px; color: var(--text-dim); max-width: 420px; }
.composer select, .edit-form select {
  color: #f6f3ff;
  background: rgba(139, 124, 246, 0.08);
  border: 1px solid rgba(139, 124, 246, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
.composer select:focus, .edit-form select:focus { outline: none; border-color: var(--accent); }

.vis-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(139, 124, 246, 0.14);
  border: 1px solid rgba(139, 124, 246, 0.3);
}

.settings-export { margin-top: 18px; }
.settings-export h2 { font-size: 18px; margin: 0 0 8px; }
.settings-export-copy { color: var(--text-dim); font-size: 14px; margin: 0 0 14px; }

.export-card { max-width: 760px; margin: 0 auto 72px; padding: 26px 30px; }
.export-copy { color: var(--text-dim); font-size: 14.5px; margin: 0 0 18px; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.export-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border-radius: 14px;
  color: var(--text); text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.export-tile:hover { border-color: rgba(139, 124, 246, 0.45); background: rgba(139, 124, 246, 0.07); }
.export-kind {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.export-name { font-size: 15.5px; font-weight: 600; }
.export-meta { font-size: 12.5px; color: var(--text-dim); }
.export-foot { margin: 16px 0 0; font-size: 13px; color: var(--text-dim); }
.export-foot strong { color: var(--text); }

.hiw-privacy .hiw-promise { font-size: 15px; margin: 0 0 12px; }
.hiw-privacy-list { margin: 0; padding-left: 20px; display: grid; gap: 9px; }
.hiw-privacy-list li { font-size: 14px; color: var(--text-dim); }
.hiw-privacy-list strong { color: var(--text); }

@media (max-width: 720px) {
  .export-grid { grid-template-columns: 1fr; }
}

/* ---------------- smart-logging round: conditions + gear ---------------- */
.gear-note { font-size: 12.5px; color: var(--text-dim); max-width: 420px; }
.cond-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}
.cond-chip, .gear-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(139, 124, 246, 0.08);
  border: 1px solid rgba(139, 124, 246, 0.22);
  transition: border-color 160ms ease, color 160ms ease;
}
.cond-chip:hover, .gear-chip:hover { border-color: rgba(139, 124, 246, 0.45); color: var(--text); }
.gear-chip {
  color: var(--accent);
  background: rgba(139, 124, 246, 0.13);
  border-color: rgba(139, 124, 246, 0.3);
}

.cond-pattern { align-self: start; }
.cond-pattern-copy { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; }
.cond-buckets { display: grid; gap: 14px; }
.cond-bucket-group h3 {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.cond-bucket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(139, 124, 246, 0.1);
}
.cond-bucket-row:last-child { border-bottom: none; }
.cond-bucket-val { color: var(--text-dim); }
.cond-bucket-val strong { color: var(--text); }
@media (min-width: 641px) {
  .cond-buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ---------------- weekend derbies ---------------- */
.derby-panel { padding: 18px 20px 20px; margin-bottom: 18px; }
.derby-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #c9c0fb;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.derby-board { list-style: none; margin: 0; padding: 0; }
.derby-when { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.derby-weight {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}
.derby-weight:hover { color: #c9c0fb; }
.derby-weight strong { color: #fbbf24; font-size: 15px; font-weight: 700; }
.derby-none { margin: 4px 0 2px; color: var(--text-dim); font-size: 14px; }
.derby-none a { color: var(--accent); }
.derby-past-list { display: flex; flex-direction: column; margin-top: 4px; }
.derby-past-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.derby-past-row:first-child { border-top: none; }
.derby-past-species { font-weight: 700; min-width: 150px; }
.derby-past-window { color: var(--text-faint); font-size: 12.5px; }
.derby-champ {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 13px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  transition: border-color 0.15s ease;
  white-space: nowrap;
}
a.derby-champ:hover { border-color: rgba(251, 191, 36, 0.5); }
.derby-champ-none {
  color: var(--text-faint);
  background: var(--glass);
  border-color: var(--line);
  font-weight: 500;
}

/* ---------------- direct messages ---------------- */
.msg-panel { padding: 18px 20px 20px; margin-bottom: 18px; }
.msg-row .msg-preview {
  display: block;
  margin-top: 2px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-faint);
}
.msg-unread {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #17122e;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.msg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.msg-head-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.msg-head-main .uname { font-size: 16px; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.msg-line { display: flex; align-items: flex-end; gap: 8px; }
.msg-line.mine { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 76%;
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
}
.msg-line.mine .msg-bubble { background: var(--accent-soft); border-color: var(--accent-line); }
.msg-body { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-meta { display: block; margin-top: 3px; font-size: 11px; color: var(--text-faint); }
.msg-reply { display: flex; gap: 8px; align-items: center; }
.msg-reply input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(139, 124, 246, 0.08);
  color: #f6f3ff;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.msg-reply input[type="text"]:focus { border-color: var(--accent); }
.msg-reply input[type="text"]::placeholder { color: var(--placeholder); }
.msg-paywall {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid var(--line);
}
.msg-paywall a { color: var(--accent); }
.msg-none { margin: 6px 0; color: var(--text-dim); font-size: 14px; }
.msg-none-block { text-align: center; color: var(--text-dim); padding: 22px 0 8px; }
.msg-none-block svg { margin: 0 auto 10px; opacity: 0.45; }
.msg-none-block h1 { font-size: 20px; }
@media (max-width: 640px) {
  .msg-bubble { max-width: 88%; }
}


/* ==========================================================
   PWA / native-app layer — install UI, offline page, bottom
   tab bar (mobile only), safe areas, touch polish.
   ========================================================== */


/* --- iOS Add-to-Home-Screen instruction sheet --- */
.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 4, 14, 0.72);
  backdrop-filter: blur(6px);
}
.install-sheet-card {
  max-width: 340px;
  width: 100%;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.install-sheet-card h2 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.install-steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.install-steps strong { color: #f2c46a; font-weight: 600; }
.install-sheet-close { width: 100%; }

/* --- Offline fallback page (dusk-gold accents on brand art) --- */
.offline-card { max-width: 460px; margin: 48px auto; padding: 32px; text-align: center; }
.offline-brand { width: 96px; height: 96px; border-radius: 22px; margin-bottom: 16px; }
.offline-card h1 { margin: 0 0 6px; font-size: 24px; color: var(--text); }
.offline-sub { margin: 0 0 20px; color: var(--text-dim); }
.offline-box { text-align: left; margin-bottom: 22px; }
.offline-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.offline-list li { display: flex; align-items: center; gap: 9px; color: var(--text-dim); font-size: 14px; }
.offline-list li svg { color: #f2c46a; flex: none; }


/* ===================== launch: legal, admin, safety ===================== */
.flash-banner { padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--accent-line); color: var(--text); font-size: var(--fs-body); }
.form-notice { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: var(--fs-meta); }


.btn-sm { padding: 6px 12px; font-size: var(--fs-meta); }

.site-footer .footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.site-footer .footer-links a { color: var(--text-dim); font-size: var(--fs-meta); }
.site-footer .footer-links a:hover { color: var(--text); }

.legal-page { padding: 28px 30px; line-height: 1.6; }
.legal-page h1 { font-size: var(--fs-display); margin-bottom: 4px; }
.legal-page h2 { font-size: var(--fs-section); margin: 22px 0 8px; }
.legal-page ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-page p { margin: 8px 0; color: var(--text); }
.legal-updated { color: var(--text-faint); font-size: var(--fs-meta); }

.report-link { color: var(--text-faint); font-size: var(--fs-micro); }
.report-link:hover { color: var(--danger); }
.detail-report { float: right; margin-left: 12px; }
.report-reasons { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.report-reasons legend { color: var(--text-dim); font-size: var(--fs-meta); margin-bottom: 6px; }
.report-reason { display: flex; gap: 8px; align-items: center; color: var(--text); }

.profile-more { position: relative; display: inline-block; }
.profile-more > summary { list-style: none; cursor: pointer; }
.profile-more > summary::-webkit-details-marker { display: none; }
.profile-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; padding: 6px; display: grid; gap: 2px; }
.profile-more-menu form { margin: 0; }
.profile-more-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.profile-more-menu a:hover { background: var(--accent-soft); }

.feed-pager { display: flex; justify-content: center; gap: 12px; margin: 20px 0 8px; }

.settings-danger { border-color: rgba(244, 114, 182, 0.35); }
.settings-danger h2 { color: var(--danger); }
.blocked-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.blocked-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.blocked-list form { margin: 0; }

.admin-card { padding: 22px 24px; margin-bottom: 18px; }
.admin-card h2 { font-size: var(--fs-section); margin-bottom: 12px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--text-dim); margin: 10px 0; }
.admin-stats strong { color: var(--text); font-size: var(--fs-section); }
.admin-mode, .admin-empty, .admin-meta { color: var(--text-dim); font-size: var(--fs-meta); }
.admin-list { display: grid; gap: 10px; }
.admin-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.admin-row-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.admin-details { color: var(--text-dim); font-style: italic; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions form { margin: 0; }
.admin-search { display: flex; gap: 8px; margin-bottom: 8px; }
.admin-search input { flex: 1; }
.admin-link { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-meta); }

/* ==========================================================================
   UI OVERHAUL — PHASE 1
   Index: [a] base type + utilities  [b] app shell
          [c] right rail  [d] composer sheet + dialog  [e] feed card v2
          [f] guest landing  [g] mobile  [h] navigation v2
   All motion lives behind prefers-reduced-motion: no-preference (plus the
   global kill switch near :root). Gold = brag numbers only.
   ========================================================================== */

/* ---------- [a] base type + utilities ---------- */
h1, h2, h3 { font-family: var(--font-display); }
h1 { letter-spacing: -0.025em; }
.gold-num, .rail-pts, .hero-stats dd, .stat-tile strong {
  font-variant-numeric: tabular-nums;
}
.gold-num { font-family: var(--font-display); font-weight: 700; color: var(--gold); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #17122e; font-weight: 700;
}
.skip-link:focus { top: 10px; }
/* JS-only controls (share) stay hidden until app.js marks <html class="js">. */
html:not(.js) .js-only { display: none !important; }
select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 24px; border-radius: var(--radius-lg); }
.empty-state h1, .empty-state h2 { font-size: 20px; margin: 4px 0 0; color: var(--text); }
.empty-state p { margin: 0; max-width: 42ch; }
.empty-state .btn { margin-top: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.empty-state-icon {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
}
.empty-state .empty-state-icon svg { margin: 0; opacity: 1; }

.btn-lg { min-height: 52px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; border-radius: 14px; }
.btn-glass {
  background: rgba(255, 255, 255, 0.08); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.35); }

.rail-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  margin: -10px 0; font-size: 13px; font-weight: 600; color: #c9c0fb;
}
.rail-link:hover { color: #fff; }
.rail-link svg { transition: transform 0.15s var(--ease); }
.rail-link:hover svg { transform: translateX(2px); }

/* ---------- [b] app shell (the sidebar itself lives in [h] nav v2) ---------- */
.app-shell { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.app-shell > .wrap { padding-left: 0; padding-right: 0; }
main.wrap:focus { outline: none; }
.rail-right { display: none; }

@media (min-width: 900px) {
  .app-shell.has-rail {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(240px, 300px);
    justify-content: center;
    column-gap: 24px;
    align-items: start;
  }
  .app-shell.has-rail > .wrap { grid-column: 1; grid-row: 1; max-width: none; width: 100%; margin: 0; }
  .app-shell.has-rail > .rail-right { display: flex; grid-column: 2; grid-row: 1; }
}
@media (min-width: 1100px) {
  .app-shell { padding: 0 28px; }
  .app-shell > .wrap { max-width: 880px; width: 100%; }
  .app-shell.has-rail { grid-template-columns: minmax(0, 640px) minmax(272px, 320px); column-gap: 28px; }
}

/* ---------- [c] right rail ---------- */
.rail-right {
  flex-direction: column; gap: 16px; padding: 14px 0 32px; min-width: 0;
  position: sticky; top: 0; max-height: 100vh;
  overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
}
.rail-right::-webkit-scrollbar { display: none; }
.rail-right > * { flex-shrink: 0; }
.rail-card { padding: 16px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rail-card h2 { font-size: 16px; margin: 0; }
.rail-card .btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.rail-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.rail-me-top { display: flex; align-items: center; gap: 14px; }
.level-ring-wrap { flex: none; display: inline-flex; }
.level-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 6; }
.level-ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 32px 32px;
}
.level-ring-num { font-family: var(--font-display); font-size: 20px; font-weight: 800; fill: var(--text); }
.rail-me-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rail-me-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-me-name:hover { color: #c9c0fb; }
.rail-me-pts { font-size: 13px; color: var(--text-dim); }
.rail-me-pts strong {
  font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--text);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-right: 2px;
}
.rail-me-level { font-size: 12.5px; color: #c9c0fb; font-weight: 600; }
.rail-me-next { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.rail-me-next strong { color: var(--text); }
.rail-me-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin: 0; padding-top: 12px; border-top: 1px solid var(--line);
}
.rail-me-stats div { display: flex; flex-direction: column-reverse; min-width: 0; }
.rail-me-stats dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.rail-me-stats dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }

.rail-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.rail-cta h2 { font-size: 19px; line-height: 1.2; }
.rail-cta p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.rail-cta-login {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  margin: -6px 0 -10px; font-size: 13px; color: var(--text-dim);
}
.rail-cta-login:hover { color: var(--text); }

.rail-derby { padding: 0; gap: 0; overflow: hidden; }
.rail-derby-banner {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; gap: 3px;
  padding: 92px 16px 14px;
  background-color: #1d1838; background-size: cover; background-position: center 45%;
}
.rail-derby-banner::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(10, 8, 24, 0.96) 12%, rgba(10, 8, 24, 0.45) 65%, rgba(10, 8, 24, 0.2) 100%);
}
.rail-derby-banner h2 { font-size: 20px; color: #fff; }
.rail-derby-window { font-size: 12.5px; color: #d0cae8; }
.rail-derby-status {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(10, 8, 24, 0.72); color: #d6cffd; border: 1px solid var(--accent-line);
}
.rail-derby-status.live { background: var(--accent); color: #17122e; border-color: transparent; }
.rail-derby-body { padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.rail-countdown { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; }
.rail-countdown svg { color: var(--accent); flex: none; }
.rail-countdown strong {
  margin-left: auto; font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.rail-derby-leader { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-dim); }
.rail-derby-leader a { color: var(--text); font-weight: 600; }
.rail-derby-body .rail-link { align-self: flex-start; }

.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-list li { display: flex; align-items: center; gap: 10px; min-height: 46px; min-width: 0; }
.rail-rank {
  flex: none; width: 22px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.rail-rank.medal-1 { color: var(--gold); }
.rail-rank.medal-2 { color: #d9d8ea; }
.rail-rank.medal-3 { color: #e3a26b; }
.rail-list .avatar.sm { flex: none; }
.rail-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.rail-name:hover { color: #c9c0fb; }
.rail-pts { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.rail-pts small { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; font-weight: 500; color: var(--text-faint); }
.rail-follow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rail-follow-main .rail-name { flex: none; }
.rail-follow-sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-follow-form { margin: 0; flex: none; }
.rail-card .btn-follow {
  min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 13px;
  display: inline-flex; color: #d6cffd; border-color: var(--accent-line);
}

/* ---------- [d] composer sheet (details, no-JS) + modal dialog (JS) ---------- */
.composer-anchor { height: 0; scroll-margin-top: 84px; }
.composer-sheet > summary { list-style: none; cursor: pointer; }
.composer-sheet > summary::-webkit-details-marker { display: none; }
.composer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.composer-bar:hover { border-color: var(--accent-line); }
.composer-bar .avatar { flex: none; }
.composer-bar-prompt {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center;
  padding: 0 16px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--line);
  color: var(--placeholder); font-size: 15px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.composer-bar:hover .composer-bar-prompt { color: var(--text-dim); border-color: var(--line-strong); }
.composer-bar-photo {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.composer-sheet[open] > .composer-bar { border-color: var(--accent-line); }
.composer-panel { margin-top: 10px; padding: 20px; gap: 14px; border-radius: var(--radius-lg); }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-head h2 { font-size: 22px; margin: 0; }
.composer-close {
  flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--text-dim); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.composer-close:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-1); }
.composer-form { gap: 14px; }
.composer-form input[type="text"],
.composer-form input[type="number"],
.composer-form textarea { width: 100%; min-height: 46px; font-size: 15px; }
.composer-form textarea { resize: vertical; min-height: 92px; max-height: 240px; }
.composer-form textarea::-webkit-resizer {
  background: linear-gradient(135deg, transparent 55%, var(--line-strong) 55%, var(--line-strong) 62%, transparent 62%, transparent 75%, var(--line-strong) 75%, var(--line-strong) 82%, transparent 82%);
}
.composer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.composer-grid .field.small { max-width: none; }

.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 176px; overflow: hidden; text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(139, 124, 246, 0.45); border-radius: 18px;
  background: radial-gradient(400px 160px at 50% 0%, rgba(139, 124, 246, 0.12), transparent 70%), rgba(139, 124, 246, 0.04);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background-color: rgba(139, 124, 246, 0.1); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0; margin: 0;
}
.dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; pointer-events: none; }
.dropzone-ico {
  width: 54px; height: 54px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
}
.dropzone-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); }
.dropzone-hint { font-size: 12.5px; color: var(--text-dim); }
.dropzone-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone-preview[hidden] { display: none; }
.dropzone-change {
  display: none; position: absolute; right: 10px; bottom: 10px; z-index: 1;
  align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #fff;
  background: rgba(10, 8, 24, 0.72); border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}
.dropzone.has-file { border-style: solid; border-color: var(--accent-line); min-height: 280px; }
.dropzone.has-file .dropzone-empty { display: none; }
.dropzone.has-file .dropzone-change { display: inline-flex; }

.unit-input { position: relative; display: flex; }
.unit-input input { padding-right: 42px; -moz-appearance: textfield; appearance: textfield; }
.unit-input input::-webkit-inner-spin-button,
.unit-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 700; color: var(--text-dim); pointer-events: none;
}

.segmented { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.segmented legend { padding: 0; margin-bottom: 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.segmented-opts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--line);
}
.segmented-opts label { position: relative; display: block; min-width: 0; }
.segmented-opts input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented-opts span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 6px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented-opts span svg { flex: none; }
.segmented-opts label:hover span { color: var(--text); }
.segmented-opts input:checked + span { background: var(--accent-soft); color: #ece8ff; box-shadow: inset 0 0 0 1px var(--accent-line); }
.segmented-opts input:checked + span svg { color: var(--accent); }
.segmented-opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented .vis-note { margin: 0; max-width: none; font-size: 12px; color: var(--text-faint); }

.composer-more { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-1); }
.composer-more > summary {
  list-style: none; cursor: pointer; min-height: 48px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.composer-more > summary::-webkit-details-marker { display: none; }
.composer-more > summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin: 0 2px;
  border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transform: rotate(-45deg); transition: transform 0.15s var(--ease);
}
.composer-more[open] > summary::before { transform: rotate(45deg); }
.composer-more > summary span { font-size: 12.5px; font-weight: 500; color: var(--text-faint); }
.composer-more-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 14px 14px; }
.composer-form .gear-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; max-width: none; font-size: 12px; color: var(--text-faint); }
.composer-form .gear-note svg { color: var(--accent); flex: none; }
.composer-foot .btn { min-height: 46px; padding: 0 24px; }

dialog.composer-dialog {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(600px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 48px); overflow: visible;
}
dialog.composer-dialog::backdrop { background: rgba(6, 5, 16, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.composer-dialog .composer-panel {
  margin: 0; max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(23, 20, 45, 0.97); border-color: var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
@media (prefers-reduced-motion: no-preference) {
  dialog.composer-dialog[open] .composer-panel { animation: mtb-sheet-in 0.22s var(--ease); }
  dialog.composer-dialog[open]::backdrop { animation: mtb-fade-in 0.22s ease; }
}
@keyframes mtb-sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mtb-fade-in { from { opacity: 0; } to { opacity: 1; } }
html.composer-locked, html.composer-locked body { overflow: hidden; }

/* ---------- [e] feed card v2 ---------- */
.feed-card { padding: 14px; gap: 12px; border-radius: var(--radius-lg); position: relative; }
.feed-card:hover { transform: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .feed-card:hover { transform: translateY(-2px); }
}
/* An open ••• menu lifts its card above the next card's stacking context. */
.feed-card:has(.card-menu[open]) { z-index: 6; }
.feed-card .card-head { align-items: center; gap: 10px; }
.feed-card .card-avatar { flex: none; border-radius: 50%; }
.feed-card .card-titleline { flex-wrap: nowrap; gap: 6px; min-width: 0; }
.feed-card .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.badge-top {
  flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.35);
}
.badge-top svg { width: 14px; height: 14px; }
.feed-card .card-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 5px; line-height: 1.4; }
.card-time { color: inherit; }
.card-time:hover { color: var(--text); }
.card-loc { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.card-loc svg { flex: none; }
.feed-card .vis-chip { margin-left: 2px; }

.card-menu { position: relative; flex: none; margin: -6px -6px -6px auto; }
.card-menu > summary {
  list-style: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; color: var(--text-dim); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.card-menu > summary::-webkit-details-marker { display: none; }
.card-menu > summary:hover, .card-menu[open] > summary { background: var(--surface-2); color: var(--text); }
.card-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  min-width: 210px; padding: 6px; display: grid; gap: 2px;
  background: rgba(23, 20, 45, 0.97); border-color: var(--line-strong);
}
.card-menu-list form { margin: 0; }
.card-menu-list a, .card-menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap;
}
.card-menu-list a svg, .card-menu-list button svg { flex: none; color: var(--text-dim); }
.card-menu-list a:hover, .card-menu-list button:hover { background: var(--accent-soft); color: var(--text); }
.card-menu-list .card-menu-danger, .card-menu-list .card-menu-danger svg { color: var(--danger); }
.card-menu-list .card-menu-danger:hover { background: rgba(244, 114, 182, 0.1); }

.feed-card .catch-photo-link { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-1); }
.feed-card .catch-photo { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 641px) { .feed-card .catch-photo { aspect-ratio: 1 / 1; } }
.photo-scrim {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 64px 16px 14px; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 5, 16, 0.86) 0%, rgba(6, 5, 16, 0.5) 50%, rgba(6, 5, 16, 0) 100%);
}
.photo-species {
  max-width: 100%; font-family: var(--font-display); font-size: 22px; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.015em; color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
}
.photo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.catch-weight-chip, .catch-length-chip {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 11px 4px; border-radius: 999px;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.catch-weight-chip strong, .catch-length-chip strong { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.catch-weight-chip { background: var(--gold); color: #1f1504; box-shadow: 0 6px 18px rgba(251, 191, 36, 0.28); }
.catch-length-chip {
  background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.feed-card .cond-row { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cond-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cond-item svg { flex: none; color: var(--accent); }
.card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 2px; }
.feed-card .story { color: var(--text); font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.feed-card .gear-chip { padding: 3px 10px; font-size: 12px; }

.feed-card .card-actions { gap: 2px; margin: -4px -6px; }
.feed-card .like-btn, .feed-card .comment-pill, .share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; min-width: 44px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim);
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.feed-card .like-btn:hover { background: rgba(244, 114, 182, 0.1); color: var(--danger); }
.feed-card .like-btn.liked { background: transparent; color: var(--danger); }
.feed-card .like-btn.liked:hover { background: rgba(244, 114, 182, 0.1); }
.feed-card .comment-pill:hover, .share-btn:hover { background: var(--surface-2); color: var(--text); }
.share-btn { margin-left: auto; }
.share-btn.is-copied { color: #c9c0fb; }
@media (prefers-reduced-motion: no-preference) {
  .like-btn.pop svg { animation: mtb-heart-pop 0.18s var(--ease); }
}
@keyframes mtb-heart-pop { 50% { transform: scale(1.22); } }

.feed-card .comments { gap: 8px; padding-top: 10px; }
.comments-all {
  display: inline-flex; align-items: center; align-self: flex-start;
  min-height: 44px; margin: -10px 0 -8px; font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.comments-all:hover { color: var(--text); }
.feed-card .comment-form { flex-wrap: nowrap; }
.feed-card .comment-form input[type="text"] { min-width: 0; min-height: 44px; border-radius: 999px; padding: 0 16px; }
.feed-card .comment-form .btn { min-height: 44px; border-radius: 999px; flex: none; }

/* ---------- [f] guest landing ---------- */
.guest-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: clamp(540px, 76vh, 760px);
  border-bottom: 1px solid var(--line);
}
.guest-hero-img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 68% 55%;
}
.guest-hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 7, 20, 0.94) 0%, rgba(8, 7, 20, 0.78) 34%, rgba(8, 7, 20, 0.2) 64%, rgba(8, 7, 20, 0.05) 100%),
    linear-gradient(to top, var(--bg-0) 0%, rgba(11, 10, 26, 0) 26%);
}
.guest-hero-inner {
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 72px 40px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
}
.guest-hero-inner > * { max-width: 620px; }
.guest-hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(139, 124, 246, 0.18); border: 1px solid var(--accent-line); color: #ddd7ff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.guest-hero h1 {
  margin: 0; font-size: clamp(40px, 5.2vw, 70px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em;
  color: #fff; text-wrap: balance;
}
.guest-hero h1 span { color: #b8acff; }
.guest-hero-sub { margin: 0; max-width: 520px; font-size: 17px; line-height: 1.55; color: #d3cdea; }
.guest-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.guest-hero-ctas .btn-primary { box-shadow: 0 12px 30px rgba(139, 124, 246, 0.35); }
.hero-stats {
  display: flex; gap: 40px; margin: 14px 0 0; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.hero-stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; color: #b3acd2; }
.hero-stats dd {
  margin: 0; font-family: var(--font-display); font-size: 38px; font-weight: 800; line-height: 1;
  letter-spacing: -0.02em; color: #fff;
}
.hero-stats dd.gold-num, .sp-stats dd.gold-num, .stat-strip dd.gold-num { color: var(--gold); }
.guest-hero-login { margin: 0; font-size: 14px; color: #b3acd2; }
.guest-hero-login a { color: #ece8ff; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 12px 4px; margin: -12px -4px; }

.feed-anchor { height: 0; scroll-margin-top: 84px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; margin: 0; }
.mosaic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mosaic-tile {
  position: relative; display: block; min-width: 0; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-1);
}
.mosaic-tile-lg { grid-column: span 2; grid-row: span 2; border-radius: 18px; }
.mosaic-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s var(--ease); }
@media (hover: hover) { .mosaic-tile:hover img { transform: scale(1.03); } }
.mosaic-tile:hover { border-color: var(--accent-line); }
.mosaic-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 6px;
  padding: 30px 10px 8px; font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(to top, rgba(6, 5, 16, 0.85), rgba(6, 5, 16, 0));
}
.mosaic-species { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mosaic-cap .gold-num { flex: none; }
.mosaic-tile-lg .mosaic-cap { padding: 50px 16px 14px; font-size: 17px; font-family: var(--font-display); }
.mosaic-tile-lg .mosaic-cap .gold-num { font-size: 22px; }

.how-steps { padding: 22px; display: flex; flex-direction: column; gap: 16px; border-radius: var(--radius-lg); }
.how-steps h2 { font-size: 20px; margin: 0; }
.how-steps-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px;
}
.how-steps-list li {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--line);
}
.step-ico {
  width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
}
.step-num {
  position: absolute; top: 12px; right: 16px; font-family: var(--font-display);
  font-size: 34px; font-weight: 800; line-height: 1; color: rgba(255, 255, 255, 0.07);
}
.how-steps-list h3 { margin: 0; font-size: 16px; }
.how-steps-list p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.how-steps > .rail-link { align-self: flex-start; }

/* ---------- [g] mobile + tablet ---------- */
@media (max-width: 1099px) {
  .guest-hero-inner { padding: 64px 24px; }
}
@media (max-width: 640px) {
  .app-shell { padding: 0 12px; }
  .composer-form input[type="text"], .composer-form input[type="number"], .composer-form textarea { font-size: 16px; }

  .feed-card { padding: 12px; gap: 10px; }
  .feed-filters .species-filter { width: 100%; }
  .feed-filters .species-filter select { flex: 1; min-width: 0; }
  .feed-card .catch-photo-link { margin: 0 -2px; border-radius: 14px; }
  .photo-species { font-size: 20px; }
  .feed-card .card-titleline .badge-row { width: auto; }
  .share-label { display: none; }

  .composer-panel { padding: 16px; }
  .composer-head h2 { font-size: 20px; }
  .composer-form textarea { resize: none; }
  dialog.composer-dialog { width: 100vw; margin: auto 0 0; max-height: calc(100dvh - 20px); }
  dialog.composer-dialog .composer-panel {
    max-height: calc(100dvh - 20px); border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .guest-hero { min-height: 0; align-items: flex-end; background: var(--bg-0); }
  /* Mobile: the photo is a top band (angler visible), copy sits below it. */
  .guest-hero-img { height: 340px; bottom: auto; object-position: 55% 50%; }
  .guest-hero-scrim {
    bottom: auto; height: 342px;
    background: linear-gradient(to bottom, rgba(11, 10, 26, 0.15) 0%, rgba(11, 10, 26, 0.05) 45%, rgba(11, 10, 26, 0.75) 80%, var(--bg-0) 100%);
  }
  .guest-hero-kicker { display: none; }
  .guest-hero-inner { padding: 236px 18px 28px; gap: 14px; }
  .guest-hero-sub { font-size: 15.5px; }
  .guest-hero-ctas { width: 100%; }
  .guest-hero-ctas .btn { flex: 1 1 100%; }
  .hero-stats { width: 100%; gap: 12px; justify-content: space-between; }
  .hero-stats dd { font-size: 28px; }
  .hero-stats dt { font-size: 10.5px; }
  .mosaic-tile:not(.mosaic-tile-lg) .mosaic-species { display: none; }
  .mosaic-tile:not(.mosaic-tile-lg) .mosaic-cap { justify-content: flex-end; padding: 22px 8px 6px; }
}
@media (max-width: 480px) {
  .composer-grid { grid-template-columns: 1fr; }
  .composer-grid.composer-grid-units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .segmented-opts span svg { display: none; }
}



/* ============================================================
   UI phase 2 — content pages (ui.php components + page layouts)
   ============================================================ */
.flip-x { transform: scaleX(-1); }
.gold-num, .sp-stats dd.gold-num, .stat-strip dd.gold-num { color: var(--gold); }
.app-shell > .wrap.wrap-wide { max-width: 1040px; }
.feed-col { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 640px; margin: 0 auto; }
.you-chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #c9c0fb; background: var(--accent-soft); border: 1px solid var(--accent-line); vertical-align: middle;
}

/* ---------- page hero ---------- */
.page-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: 28px 24px 24px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(139, 124, 246, 0.22), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--surface-1);
}
.page-hero.has-image { min-height: 300px; display: flex; align-items: flex-end; padding: 0; background: #0d0b1d; }
.page-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; }
.page-hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 10, 26, 0.10) 0%, rgba(11, 10, 26, 0.45) 45%, rgba(11, 10, 26, 0.94) 100%),
    linear-gradient(90deg, rgba(11, 10, 26, 0.55), transparent 70%);
}
.page-hero-inner { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-hero.has-image .page-hero-inner { padding: 64px 24px 24px; width: 100%; }
.page-kicker {
  align-self: flex-start; font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps);
  text-transform: uppercase; color: #c9c0fb; padding: 4px 10px; border-radius: 999px;
  background: rgba(139, 124, 246, 0.18); border: 1px solid var(--accent-line);
}
.page-hero h1 {
  margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.02; color: #fff; overflow-wrap: anywhere;
}
.page-hero.has-image h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5); }
.page-hero-sub { margin: 0; max-width: 60ch; color: var(--text-dim); font-size: 15px; line-height: 1.5; }
.page-hero.has-image .page-hero-sub { color: rgba(234, 231, 247, 0.86); }
.page-hero-record { margin: 2px 0 0; display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; }
.page-hero-record svg { color: var(--gold); flex: none; }
.page-hero-record a { color: #fff; font-weight: 700; }
.page-hero-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  margin-top: 4px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.page-hero-back:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hero-search { margin-top: 8px; display: flex; align-items: center; gap: 8px; position: relative; max-width: 560px; }
.hero-search-icon { position: absolute; left: 14px; color: var(--text-faint); pointer-events: none; }
.hero-search input { flex: 1; min-width: 0; min-height: 48px; padding-left: 42px; border-radius: 14px; background: rgba(11, 10, 26, 0.55); border: 1px solid var(--line-strong); color: var(--text); }
.hero-search .btn { min-height: 48px; flex: none; }

/* ---------- segmented control (sort / period / profile tabs) ---------- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
  border-radius: 14px; background: var(--surface-1); border: 1px solid var(--line);
}
.seg-link {
  min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  border-radius: 10px; color: var(--text-dim); font-size: 14px; font-weight: 600; text-align: center;
  line-height: 1.15; transition: background-color 0.15s ease, color 0.15s ease;
}
.seg-link:hover { color: var(--text); background: var(--surface-2); }
.seg-link[aria-current="page"] { color: #fff; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.seg-count { font-size: 12px; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.seg-link[aria-current="page"] .seg-count { color: #c9c0fb; }
@media (max-width: 520px) {
  .seg:not(.seg-2):not(.seg-3) { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}

/* ---------- species grid ---------- */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sp-grid > * { min-width: 0; }
.sp-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); padding: 0; }
.sp-card-media { position: relative; aspect-ratio: 3 / 2; background: linear-gradient(135deg, #1d1840, #0f0d22); overflow: hidden; }
.sp-card-media img, .champ-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-card-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); opacity: 0.5; }
.sp-card-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(11, 10, 26, 0.88) 100%); }
.sp-card-name {
  position: absolute; left: 16px; right: 16px; bottom: 12px; margin: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 23px; line-height: 1.05; letter-spacing: -0.02em;
  color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); overflow-wrap: anywhere;
}
.sp-card-link { color: inherit; }
.sp-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is the hit area */
.sp-card-link:focus-visible { outline: none; }
.sp-card:has(.sp-card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-card-link:hover { color: #fff; }
.sp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 14px 16px 4px; gap: 8px; }
.sp-stats div { min-width: 0; }
.sp-stats .sp-best { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; line-height: inherit; overflow: visible; }
.sp-stats dt { font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-faint); }
.sp-stats dd {
  margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.sp-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 14px;
  margin-top: auto; border-top: 1px solid var(--line); margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0;
}
.sp-record { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; color: var(--text); }
.sp-record-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sp-record-label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); }
.sp-record-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-record:hover .sp-record-name { color: #c9c0fb; }
.sp-last { font-size: 12px; color: var(--text-faint); white-space: nowrap; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .sp-card, .champ-card { transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease; }
  .sp-card-media img { transition: transform 0.5s var(--ease); }
  .sp-card:hover { transform: translateY(-2px); }
  .sp-card:hover .sp-card-media img { transform: scale(1.04); }
}
.sp-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-lift); }

/* ---------- podium ---------- */
.podium {
  list-style: none; margin: 0 auto; padding: 8px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end; gap: 10px; width: 100%; max-width: 760px;
  border-bottom: 1px solid var(--line-strong);
}
.podium-spot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.podium-spot.rank-1 { order: 2; }
.podium-spot.rank-2 { order: 1; }
.podium-spot.rank-3 { order: 3; }
.podium-n1 { grid-template-columns: minmax(0, 1fr); max-width: 280px; margin: 0 auto; width: 100%; }
.podium-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; margin: 0 auto; width: 100%; }
.podium-avatar { position: relative; display: block; margin-bottom: 6px; }
.podium-avatar img {
  display: block; width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--ring, #94a3b8); box-shadow: 0 0 0 4px rgba(11, 10, 26, 0.9), 0 10px 30px var(--glow, rgba(0, 0, 0, 0.4));
}
.rank-1 .podium-avatar img { width: 104px; height: 104px; }
.rank-1 { --ring: var(--gold); --glow: rgba(251, 191, 36, 0.30); }
.rank-2 { --ring: #e2e8f0; --glow: rgba(226, 232, 240, 0.16); }
.rank-3 { --ring: #d9895a; --glow: rgba(217, 137, 90, 0.20); }
.podium-medal {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #1a1306;
  background: var(--ring); box-shadow: 0 0 0 3px #0b0a1a;
}
.podium-who { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; margin: 2px 0 -8px; }
.podium-who .uname { display: inline-block; line-height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; min-width: 0; }
.podium-value { font-family: var(--font-display); font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.podium-value strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.rank-1 .podium-value strong { font-size: 32px; }
.podium-value.is-gold strong { color: var(--gold); }
a.podium-value:hover strong { text-decoration: underline; text-underline-offset: 3px; }
a.podium-value { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.podium-sub { font-size: 12px; color: var(--text-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-plinth {
  width: 100%; margin-top: 10px; border-radius: 14px 14px 4px 4px; display: grid; place-items: start center; padding-top: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 22px; color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line); border-bottom: 0;
}
.rank-1 .podium-plinth { height: 96px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.20), rgba(251, 191, 36, 0.02)); border-color: rgba(251, 191, 36, 0.30); color: rgba(251, 191, 36, 0.7); }
.rank-2 .podium-plinth { height: 70px; }
.rank-3 .podium-plinth { height: 52px; }
.podium-spot.is-me .podium-plinth { box-shadow: inset 0 0 0 1px var(--accent-line); }
@media (max-width: 480px) {
  .podium { gap: 6px; }
  .podium-avatar img { width: 60px; height: 60px; }
  .rank-1 .podium-avatar img { width: 80px; height: 80px; }
  .podium-value strong { font-size: 20px; }
  .rank-1 .podium-value strong { font-size: 25px; }
  .podium-who .uname { font-size: 13.5px; }
  .podium-who .you-chip { display: none; }
  .podium-sub { font-size: 11px; white-space: normal; }
}

/* ---------- leaderboard rows ---------- */
.lb-board { display: flex; flex-direction: column; gap: 14px; }
.lb-rows { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; }
.lb-rows .lb-row { gap: 12px; padding: 10px; min-height: 60px; border-radius: 12px; }
.lb-rows .lb-row:hover { background: transparent; } /* no fake "selected" state */
.lb-rows .lb-row + .lb-row { border-top: 1px solid var(--line); }
.lb-rows .lb-row.is-me { background: rgba(139, 124, 246, 0.07); box-shadow: inset 3px 0 0 var(--accent); }
.lb-rows .lb-rank { background: transparent; color: var(--text-faint); font-family: var(--font-display); font-size: 16px; width: 28px; }
.lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-who .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lb-rows .lb-lvl { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 12.5px; white-space: normal; }
.lb-rows .lb-pts { min-width: 0; font-family: var(--font-display); font-weight: 600; color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-rows .lb-pts strong { color: var(--text); font-size: 19px; font-weight: 800; }
.lb-you-line { margin: 0; text-align: center; color: var(--text-dim); font-size: 14px; }
.lb-you-line strong { color: #fff; font-family: var(--font-display); }
.mini-ring { flex: none; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 3; }
.mini-ring-track { stroke: rgba(255, 255, 255, 0.1); }
.mini-ring-fill { stroke: var(--accent); stroke-linecap: round; }

/* ---------- derby ---------- */
.derby-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 6px; }
.countdown {
  margin: 0; display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 18px; border-radius: 16px;
  background: rgba(11, 10, 26, 0.55); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.countdown-ico { align-self: center; color: #c9c0fb; flex: none; }
.countdown-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(234, 231, 247, 0.8); }
.countdown-val { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 4.5vw, 36px); letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown.is-over .countdown-label { text-transform: none; letter-spacing: 0; font-size: 14px; }
.derby-window-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: rgba(234, 231, 247, 0.85); }
.derby-standings, .derby-past, .more-from { display: flex; flex-direction: column; gap: 4px; }
.section-meta { font-size: 13px; color: var(--text-faint); }
.derby-row .derby-weight { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); }
.derby-row .derby-weight strong { font-size: 19px; color: var(--gold); }
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.champ-grid > * { min-width: 0; }
.champ-card { padding: 0; overflow: hidden; border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.champ-media { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1d1840, #0f0d22); }
.champ-species { position: absolute; left: 14px; right: 14px; bottom: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.champ-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.champ-body .derby-champ { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .champ-media { aspect-ratio: 16 / 7; } }
.champ-card.is-unclaimed .champ-media { filter: grayscale(0.7); opacity: 0.7; }

/* ---------- profile ---------- */
.profile-top { padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.profile-cover {
  position: relative; height: 180px; overflow: hidden;
  background: radial-gradient(120% 140% at 10% 0%, rgba(139, 124, 246, 0.45), transparent 60%), linear-gradient(135deg, #231c4f, #0f0d22 70%);
}
.profile-cover-img { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(24px) saturate(1.15); }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 10, 26, 0.25), rgba(11, 10, 26, 0.75)); }
.profile-head { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "av act" "main main"; gap: 12px 16px; padding: 0 24px 18px; }
.profile-avatar.avatar { grid-area: av; width: 96px; height: 96px; margin-top: -48px; border: 4px solid #14112b; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); position: relative; z-index: 1; background: #14112b; }
.profile-actions { grid-area: act; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.profile-actions form { margin: 0; }
.profile-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.profile-actions .card-menu { margin: 0; }
.profile-actions .card-menu > summary { border: 1px solid var(--line); }
.profile-head .profile-id-main { grid-area: main; }
.profile-head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 38px); font-weight: 800; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.profile-head .profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 0; }
.level-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: #c9c0fb; font-weight: 600; font-size: 13px; }
.profile-pts strong { color: var(--text); font-family: var(--font-display); }
.profile-water { display: inline-flex; align-items: center; gap: 5px; }
.badge-strip { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-strip-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #c9c0fb; background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.badge-strip-item svg { width: 16px; height: 16px; flex: none; }
.profile-top .level-progress { padding: 0 24px 18px; }
.stat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.stat-strip div { padding: 16px 8px; text-align: center; min-width: 0; }
.stat-strip div + div { border-left: 1px solid var(--line); }
.stat-strip dt { font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.stat-strip dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .profile-cover { height: 130px; }
  .profile-head { padding: 0 16px 16px; }
  .profile-top .level-progress { padding: 0 16px 16px; }
  .profile-actions { flex-wrap: nowrap; gap: 6px; }
  .profile-actions .btn { padding-left: 12px; padding-right: 12px; white-space: nowrap; }
  .profile-actions .btn-msg { width: 44px; padding: 0; justify-content: center; }
  .profile-actions .btn-msg .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-strip div:nth-child(4) { border-left: 0; }
  .stat-strip div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .stat-strip dd { font-size: 21px; }
}
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pgrid-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #15122c; }
.pgrid-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pgrid-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(11, 10, 26, 0.85)); }
.pgrid-cap { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.pgrid-species { min-width: 0; font-weight: 700; font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.pgrid-cap .catch-weight-chip { flex: none; padding: 2px 9px 3px; font-size: 11.5px; }
.pgrid-cap .catch-weight-chip strong { font-size: 15px; }
.pgrid-vis { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(11, 10, 26, 0.7); }
.pgrid-tile:hover .pgrid-scrim { background: linear-gradient(180deg, rgba(139, 124, 246, 0.10) 30%, rgba(11, 10, 26, 0.9)); }
@media (prefers-reduced-motion: no-preference) {
  .pgrid-tile img { transition: transform 0.4s var(--ease); }
  .pgrid-tile:hover img { transform: scale(1.04); }
}
@media (max-width: 560px) {
  .pgrid { gap: 4px; }
  .pgrid-tile { border-radius: 8px; }
  .pgrid-species { display: none; }
  .pgrid-cap { left: 6px; right: 6px; bottom: 6px; justify-content: flex-end; }
  .pgrid-cap .catch-weight-chip { font-size: 10px; padding: 1px 7px 2px; }
  .pgrid-cap .catch-weight-chip strong { font-size: 13px; }
}
.badge-board .badge-grid { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .badge-board .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .badge-board .badge-tile { padding: 14px 8px; } }
.badge-board .badge-tile { padding: 18px 12px 16px; gap: 6px; border-radius: 16px; min-width: 0; }
.badge-board .badge-tile.earned { background: linear-gradient(180deg, rgba(139, 124, 246, 0.20), rgba(139, 124, 246, 0.06)); }
.badge-board .badge-tile.locked { opacity: 1; background: transparent; border-style: dashed; border-color: var(--line-strong); }
.badge-board .badge-tile.locked .badge-medal svg { filter: grayscale(1) brightness(0.55); opacity: 0.45; }
.badge-board .badge-tile.locked .badge-name { color: var(--text-dim); }
.badge-medal { display: grid; place-items: center; }
.badge-medal svg { width: 48px; height: 48px; }
.badge-state { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.badge-state.is-earned { color: #c9c0fb; }
.badge-progress { display: block; width: 80%; height: 5px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.badge-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stats-panel .pb-block, .stats-panel .cond-pattern { grid-column: 1 / -1; }
.pb-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pb-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--line); color: var(--text); }
.pb-row:hover { border-color: var(--accent-line); }
.pb-row img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; flex: none; }
.pb-species { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-len { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.pb-weight { font-family: var(--font-display); font-weight: 800; font-size: 19px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb-weight small { font-size: 12px; font-weight: 600; }

/* ---------- catch detail (two columns) ---------- */
.catch-detail { max-width: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.detail-media { min-width: 0; border-radius: var(--radius-lg); overflow: hidden; background: #0d0b1d; border: 1px solid var(--line); }
.detail-photo-link { display: block; }
.catch-detail .detail-photo { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; margin: 0 auto; border-radius: 0; border: 0; aspect-ratio: auto; }
.detail-side { min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; border-radius: var(--radius-lg); }
.detail-side .card-head { display: flex; align-items: center; gap: 10px; }
.detail-side .card-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-side .card-titleline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.detail-side .card-sub { font-size: var(--fs-meta); color: var(--text-faint); }
.detail-hero { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-species { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.04; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.detail-nums { display: flex; align-items: baseline; gap: 18px; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.detail-weight { color: var(--gold); font-size: 18px; font-weight: 700; }
.detail-weight strong { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.detail-length { color: var(--text-dim); font-size: 15px; font-weight: 600; }
.detail-length strong { color: var(--text); font-size: 26px; font-weight: 800; }
.detail-hero .detail-loc { margin: 0; color: var(--text-dim); font-size: 14px; gap: 6px; }
.detail-cond { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-cond .cond-item { padding: 10px 12px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--line); font-size: 13px; }
.detail-gear { margin: 0; }
.detail-side .detail-story { margin: 0; }
.detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-comments { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.detail-comments .section-title { margin: 0; }
.detail-comments .comments { margin: 0; padding: 0; border-top: 0; }
.detail-comments .comment-form { display: flex; gap: 8px; }
.detail-comments .comment-form input { flex: 1; min-width: 0; min-height: 44px; }
.detail-comments .comment-form .btn { min-height: 44px; }
.detail-login { margin: 0; color: var(--text-dim); font-size: 14px; }
.detail-login a { color: var(--accent); }
a.detail-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font-size: 14px; }
@media (min-width: 900px) {
  .catch-detail { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .detail-media { position: sticky; top: 84px; }
}
.more-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- search ---------- */
.search-species-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }

/* ==========================================================================
   [h] Navigation v2
   Desktop >=1100: 248px fixed sidebar that owns the brand (no top bar).
   Tablet 700-1099: 76px icon rail, tooltips from aria-label, dot badges.
   Mobile <700: slim top bar + 5-slot bottom bar with a raised Log FAB.
   Violet = actions/active. Gold never appears in nav chrome.
   ========================================================================== */

/* ---------- shared: page offsets ---------- */
body { -webkit-tap-highlight-color: transparent; }

/* ---------- sidebar (hidden on mobile) ---------- */
.sidenav { display: none; }
.sidenav .sn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.sn-brand {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 10px; margin-bottom: 14px;
  color: var(--text); font-family: var(--font-display); font-weight: 750;
  font-size: 20px; letter-spacing: -0.02em; border-radius: 12px;
}
.sn-brand:hover { color: #fff; }
.sn-mark { flex: none; }

.sn-item {
  position: relative;
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-dim);
  font: inherit; font-size: 15px; font-weight: 600; text-align: left;
  cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sn-item[hidden] { display: none; }
.sn-ico { flex: none; width: 22px; height: 22px; }
.sn-item:hover { background: var(--surface-1); color: var(--text); }
.sn-item.is-active { background: var(--accent-soft); color: #f1edff; }
.sn-item.is-active .sn-ico { color: var(--accent); }
.sn-item.is-active::before {
  content: ""; position: absolute; left: calc(-1 * var(--sn-pad, 12px)); top: 11px; bottom: 11px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 12px rgba(139, 124, 246, 0.7);
}
.sn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sn-count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px; background: var(--accent); color: #140f2c;
  font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.sn-live {
  margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.sn-nav-secondary { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sn-nav-secondary .sn-item { font-size: 14px; font-weight: 500; color: var(--text-faint); min-height: 44px; }
.sn-nav-secondary .sn-ico { width: 20px; height: 20px; }
.sn-nav-secondary .sn-item:hover { color: var(--text-dim); }
.sn-nav-secondary .sn-item.is-active { color: #f1edff; }

.sn-log {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; min-height: 48px; border-radius: 14px; font-size: 15px;
  box-shadow: 0 10px 24px rgba(139, 124, 246, 0.26);
}
.sn-log svg { flex: none; }

.sn-foot { margin-top: auto; padding-top: 16px; }
.sn-guest { display: flex; flex-direction: column; gap: 8px; }
.sn-guest .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; border-radius: 12px; font-size: 15px;
}
.sn-guest .btn svg { flex: none; width: 18px; height: 18px; }

/* account card + menu */
.acct-menu { position: relative; }
summary.acct-card {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 7px 10px 7px 7px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface-1);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
summary.acct-card::-webkit-details-marker { display: none; }
summary.acct-card::marker { content: ''; }
summary.acct-card:hover, .acct-menu[open] > summary.acct-card { background: var(--surface-2); border-color: var(--line-strong); }
.acct-avatar { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.acct-ring { position: absolute; inset: 0; width: 46px; height: 46px; transform: rotate(-90deg); }
.acct-ring circle { fill: none; stroke-width: 3; }
.acct-ring-track { stroke: rgba(255, 255, 255, 0.1); }
.acct-ring-fill { stroke: var(--accent); stroke-linecap: round; }
.acct-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.acct-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.acct-name { font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-level { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.acct-dots { margin-left: auto; flex: none; color: var(--text-faint); }
.acct-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 60;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  border-radius: 14px; background: #1b1738; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px rgba(3, 2, 12, 0.6);
}
.acct-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer; white-space: nowrap;
}
.acct-link[hidden] { display: none; }
.acct-link svg { flex: none; color: var(--text-dim); }
.acct-link:hover { background: var(--accent-soft); color: #fff; }
.acct-link:hover svg { color: var(--accent); }
.acct-link[aria-current="page"] { color: #c9c0fb; }
.acct-form { margin: 2px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }

@media (min-width: 700px) {
  body { padding-left: 76px; }
  .sidenav {
    --sn-pad: 10px;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    width: 76px; display: flex; flex-direction: column;
    padding: 14px var(--sn-pad) calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(18, 15, 38, 0.86), rgba(11, 10, 26, 0.92));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
}

/* tablet: icon-only rail */
@media (min-width: 700px) and (max-width: 1099px) {
  .sn-wordmark, .sn-label, .acct-who, .acct-dots { display: none; }
  .sn-brand { justify-content: center; padding: 0; margin-bottom: 10px; }
  .sidenav .sn-item { justify-content: center; width: 56px; height: 48px; min-height: 48px; padding: 0; margin: 0 auto; }
  .sn-nav-secondary { margin-top: 8px; padding-top: 8px; }
  .sn-count, .sn-live {
    position: absolute; top: 9px; right: 11px; margin: 0;
    min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; line-height: 0;
    border: 2px solid #120f27; box-shadow: none;
  }
  .sn-log { width: 52px; height: 52px; min-height: 52px; padding: 0; margin: 14px auto 0; border-radius: 16px; }
  .sn-guest { align-items: center; }
  .sn-guest .btn { width: 52px; height: 52px; padding: 0; }
  summary.acct-card { justify-content: center; padding: 4px; min-height: 56px; border-color: transparent; background: none; }
  .acct-pop { left: calc(100% + 12px); right: auto; bottom: 0; width: 220px; }

  /* tooltips: read the accessible name, shown on hover / keyboard focus */
  .sidenav .sn-item::after, .sn-log::after, .sn-guest .btn::after, .sn-brand::after {
    content: attr(aria-label);
    position: absolute; left: calc(100% + 12px); top: 50%; z-index: 70;
    transform: translateY(-50%);
    padding: 6px 10px; border-radius: 8px; white-space: nowrap;
    background: #221d44; border: 1px solid var(--line-strong); color: var(--text);
    font-size: 13px; font-weight: 600; letter-spacing: 0; box-shadow: 0 8px 22px rgba(3, 2, 12, 0.5);
    opacity: 0; visibility: hidden; pointer-events: none;
  }
  .sn-log, .sn-guest .btn, .sn-brand { position: relative; }
  .sidenav .sn-item:hover::after, .sidenav .sn-item:focus-visible::after,
  .sn-log:hover::after, .sn-log:focus-visible::after,
  .sn-guest .btn:hover::after, .sn-guest .btn:focus-visible::after,
  .sn-brand:hover::after, .sn-brand:focus-visible::after { opacity: 1; visibility: visible; }
}
@media (min-width: 700px) and (max-width: 1099px) and (prefers-reduced-motion: no-preference) {
  .sidenav .sn-item::after, .sn-log::after, .sn-guest .btn::after, .sn-brand::after { transition: opacity 0.12s ease 0.08s, visibility 0s linear 0.08s; }
}
/* very short tablet windows: let the rail scroll rather than clip */
@media (min-width: 700px) and (max-width: 1099px) and (max-height: 640px) {
  .sidenav { overflow-y: auto; scrollbar-width: none; }
}

/* desktop: full sidebar */
@media (min-width: 1100px) {
  body { padding-left: 248px; }
  .sidenav {
    --sn-pad: 12px;
    width: 248px; padding: 18px var(--sn-pad) calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto; scrollbar-width: none;
  }
  .sidenav::-webkit-scrollbar { display: none; }
}

/* ---------- centre-column search bar (>=700) ---------- */
.searchbar { display: none; }
@media (min-width: 700px) {
  .searchbar {
    display: block; position: sticky; top: 0; z-index: 15;
    margin: -24px 0 -4px; padding: 14px 0 10px;
    background: linear-gradient(to bottom, rgba(12, 10, 28, 0.94) 0%, rgba(12, 10, 28, 0.86) 72%, rgba(12, 10, 28, 0) 100%);
  }
}
.searchbar-field {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 8px 0 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
  color: var(--text-faint); cursor: text;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.searchbar-field:hover { border-color: var(--line-strong); }
.searchbar-field:focus-within {
  border-color: var(--accent-line); background: var(--surface-3); color: var(--text-dim);
  box-shadow: 0 0 0 3px rgba(139, 124, 246, 0.2);
}
.searchbar-ico { flex: none; }
.searchbar-field input {
  flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: none;
  color: var(--text); font: inherit; font-size: 15px;
}
.searchbar-field input:focus, .searchbar-field input:focus-visible { outline: none; }
.searchbar-field input::placeholder { color: var(--placeholder); }
.searchbar-field input::-webkit-search-cancel-button { filter: invert(0.7); }
.searchbar-kbd {
  flex: none; min-width: 26px; padding: 3px 8px; border-radius: 7px; text-align: center;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint); font: 600 12px/1.3 var(--font-display);
}
.searchbar-field:focus-within .searchbar-kbd { opacity: 0; }

/* ---------- mobile top bar ---------- */
.topnav { display: none; }
.install-banner { display: none; }
@media (max-width: 699px) {
  .topnav {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 56px; padding: calc(4px + env(safe-area-inset-top)) 8px 4px 14px;
    background: rgba(13, 11, 27, 0.8);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--line);
  }
  .topnav.is-hidden { transform: translateY(-100%); }
  .tn-brand {
    display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0;
    color: var(--text); font-family: var(--font-display); font-weight: 750; font-size: 19px; letter-spacing: -0.02em;
  }
  .tn-brand:hover { color: #fff; }
  .tn-mark { flex: none; }
  .tn-actions { display: flex; align-items: center; gap: 2px; flex: none; }
  .tn-btn {
    position: relative; width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 12px; color: var(--text-dim);
  }
  .tn-btn:hover { color: var(--text); background: var(--surface-1); }
  .tn-btn[aria-current="page"] { color: var(--accent); }
  .tn-dot {
    position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); border: 2px solid #120f27;
  }
  .tn-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
  .tn-avatar img {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  }
  .tn-avatar[aria-current="page"] img { box-shadow: 0 0 0 2px var(--accent); }
  .tn-login { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; margin-left: 4px; font-size: 14px; }

  .install-banner:not([hidden]) {
    display: flex; align-items: center; gap: 10px;
    margin: 10px 12px 0; padding: 6px 4px 6px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
  }
  .install-banner svg { flex: none; }
  .install-banner p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.3; }
  .install-banner strong { font-size: 14px; color: var(--text); }
  .install-banner p span { font-size: 12px; color: var(--text-dim); }
  .install-banner .btn { min-height: 44px; flex: none; }
  .install-banner-close {
    flex: none; width: 44px; height: 44px; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: none; color: var(--text-faint); cursor: pointer;
  }
  .install-banner-close:hover { color: var(--text); background: var(--surface-1); }
}
@media (max-width: 699px) and (prefers-reduced-motion: no-preference) {
  .topnav { transition: transform 0.22s var(--ease); }
}

/* ---------- mobile bottom bar ---------- */
.tabbar { display: none; }
@media (max-width: 699px) {
  body {
    overscroll-behavior-y: contain;
    /* room for the fixed bar + raised FAB so content is never covered */
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(13, 11, 27, 0.82);
    backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--line);
  }
  .tb-item {
    position: relative; min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
    padding-bottom: 5px; border-radius: 12px; color: var(--text-faint); text-decoration: none;
    font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
    transition: color 0.12s ease;
  }
  .tb-item:hover { color: var(--text-dim); }
  .tb-ico { position: relative; width: 24px; height: 24px; display: grid; place-items: center; }
  .tb-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-item[aria-current="page"] { color: #b9aefc; }
  .tb-item[aria-current="page"] .tb-ico { color: var(--accent); }
  .tb-dot {
    position: absolute; top: -2px; right: -5px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); border: 2px solid #120f27;
  }
  .tb-join { color: #c9c0fb; }
  .tb-join .tb-ico { color: var(--accent); }

  /* raised centre Log button */
  .tab-log { color: var(--text-dim); }
  .tb-fab {
    width: 56px; height: 56px; margin-top: -30px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(150deg, #a395ff 0%, #8b7cf6 45%, #6f5ee8 100%);
    box-shadow: 0 0 0 4px #110e25, 0 8px 22px rgba(139, 124, 246, 0.5), 0 0 30px rgba(139, 124, 246, 0.3);
  }
  .tab-log:hover .tb-fab { filter: brightness(1.08); }
  .tab-log:hover { color: var(--text); }
}
@media (max-width: 699px) and (prefers-reduced-motion: no-preference) {
  .tb-fab { transition: transform 0.15s var(--ease), filter 0.15s ease; }
  .tab-log:active .tb-fab { transform: scale(0.94); }
}
@media (display-mode: standalone) {
  [data-install], #install-banner { display: none !important; }
}

/* ---------- review fixes (nav v2 round) ---------- */
/* Fewer than 3 ranked: no lonely pedestal — compact top cards instead. */
.podium-n1, .podium-n2 { border-bottom: 0; align-items: stretch; gap: 14px; }
.podium-n1 .podium-plinth, .podium-n2 .podium-plinth { display: none; }
.podium-n1 .podium-spot, .podium-n2 .podium-spot {
  padding: 22px 16px 18px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.podium-n1 .podium-spot.rank-1, .podium-n2 .podium-spot.rank-1 {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.10), var(--surface-2) 60%);
  border-color: rgba(251, 191, 36, 0.28);
}
.podium-n2 .podium-spot.rank-1 { order: 1; }
.podium-n2 .podium-spot.rank-2 { order: 2; }
.podium-n1 .rank-1 .podium-avatar img, .podium-n2 .podium-avatar img { width: 84px; height: 84px; }
@media (max-width: 420px) {
  .podium-n2 { grid-template-columns: minmax(0, 1fr); max-width: 300px; }
}

/* Leaderboard rows: the whole row is the profile link (stretched link). */
.lb-rows .lb-row { position: relative; }
.lb-rows .lb-row .uname::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.lb-rows .lb-row:hover { background: var(--surface-1); }
.lb-rows .lb-row .uname:focus-visible { outline: none; }
.lb-rows .lb-row:has(.uname:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Catch detail like button: 44px target. */
.detail-actions .like-btn { min-height: 44px; padding: 0 18px; }

/* ===== Google sign-in ===== */
/* "Continue with Google" (login + signup), the "or" divider, the
 * Settings → Connected accounts row, and auth-google.php message cards.
 * Button follows Google's dark-theme branding: #131314 fill, #8E918F
 * stroke, #E3E3E3 label, official multicolor G (assets/google-g.svg). */
.google-signin { margin-top: 16px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 46px; padding: 10px 16px;
  background: #131314; color: #e3e3e3;
  border: 1px solid #8e918f; border-radius: 12px;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px; font-weight: 500; letter-spacing: 0.01em; line-height: 20px;
  text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.google-btn:hover { background: #1e1e21; border-color: #a7a9a7; color: #f1f1f1; text-decoration: none; }
.google-btn:active { background: #26262a; }
.google-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.google-btn-g { width: 20px; height: 20px; flex: none; display: block; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 2px;
  color: var(--text-faint); font-size: var(--fs-meta); text-transform: lowercase;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.connected-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.connected-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.connected-copy span { color: var(--text-dim); font-size: var(--fs-meta); }
.google-msg h1 { margin-bottom: 8px; }
.google-msg p { margin-top: 12px; }
/* ===== /Google sign-in ===== */
