/* ==========================================================================
   AHS Fishing — app design system
   One shell, every device: phone (bottom tabs), tablet/desktop/folded-wide
   (left rail), PWA standalone (safe-area aware) and plain browser alike.
   ========================================================================== */

:root {
  --green-950: #03140a;
  --green-900: #04180d;
  --green-800: #062d17;
  --green-700: #0a4a26;
  --green-600: #0d6333;
  --green-500: #12803f;
  --green-400: #1fa356;
  --green-200: #a8ddbc;
  --green-100: #e6f3ea;
  --green-050: #f2f9f4;

  --white: #ffffff;
  --bg: #f2f6f2;
  --surface: #ffffff;
  --ink: #0e1a13;
  --ink-soft: #4a5a50;
  --ink-faint: #7b8a80;
  --line: #dde8e0;
  --red: #b3261e;
  --red-soft: #fdecea;
  --amber: #8a5a00;
  --amber-soft: #fdf3d7;

  --tabbar-h: 60px;
  --appbar-h: 56px;
  --col: 720px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-1: 0 1px 2px rgba(4, 24, 13, .07), 0 3px 10px rgba(4, 24, 13, .06);
  --shadow-2: 0 12px 34px rgba(4, 24, 13, .16);

  /* Semantic accents: colored TEXT/icons on cards. Dark mode remaps these
     to bright greens — dark-on-dark text was unreadable. */
  --ink-accent: #0d6333;   /* stat numbers, active tab, appbar actions */
  --chip-ink: #0a4a26;     /* green chip text */
  --chip-bg: var(--green-100);
  --chip-solid-bg: #0d6333;   /* filled badge */
  --chip-solid-ink: #ffffff;
  --link: #0d6333;
  --rank-bg: var(--green-050);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Safe areas (PWA standalone on notched phones); zeroed in browser. */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* Dark theme vars — applied when the system is dark and the user is on
   "auto", or when the user pins dark in Profile → Appearance. */
:root[data-theme="dark"] {
  --bg: #0a120d;
  --surface: #17251c;   /* clearly lifted from the page bg — cards must read */
  --ink: #e8f1ea;
  --ink-soft: #a7bab0;
  --ink-faint: #74887c;
  --line: #31493b;      /* a visible edge, not a whisper */
  --green-050: #1a2c21;
  --green-100: #213c2c;
  --green-200: #2c5c3f;
  --ink-accent: #6ee7a0;
  --chip-ink: #a5f0c4;
  --chip-bg: #1f4d33;
  --chip-solid-bg: #2e6b47;
  --chip-solid-ink: #ffffff;
  --link: #6ee7a0;
  --rank-bg: #244633;
  --red: #ff6b61;
  --red-soft: #3a1512;
  --amber: #f0b95c;
  --amber-soft: #322606;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 3px 10px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 34px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"],
  :root:not([data-theme]) {
    --bg: #0a120d;
    --surface: #17251c;   /* clearly lifted from the page bg — cards must read */
    --ink: #e8f1ea;
    --ink-soft: #a7bab0;
    --ink-faint: #74887c;
    --line: #31493b;      /* a visible edge, not a whisper */
    --green-050: #1a2c21;
    --green-100: #213c2c;
    --green-200: #2c5c3f;
    --red: #ff6b61;
    --red-soft: #3a1512;
    --amber: #f0b95c;
    --amber-soft: #322606;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 3px 10px rgba(0, 0, 0, .3);
    --shadow-2: 0 12px 34px rgba(0, 0, 0, .55);
  }
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; /* native feel: no rubber-band chain */
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
code {
  background: var(--green-050);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
:focus-visible { outline: 3px solid var(--green-400); outline-offset: 2px; border-radius: 6px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--green-600); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }
::selection { background: var(--green-200); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------- App frame ---------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  min-height: calc(var(--appbar-h) + var(--sat));
  padding: var(--sat) 10px 0 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(14px);
  backdrop-filter: saturate(1.8) blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar-brand {
  flex: none; width: 36px; height: 36px; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
}
.appbar-brand img { width: 100%; height: 100%; object-fit: cover; }
.appbar-brand svg { width: 100%; height: 100%; }
.appbar-title {
  flex: 1; min-width: 0;
  font: 700 17px/1.2 var(--sans); letter-spacing: -.01em;
  margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-back {
  flex: none; display: none;
  width: 40px; height: 40px; margin-right: -6px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-accent);
  align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.appbar-back svg { width: 22px; height: 22px; }
.app[data-depth="child"] .appbar-back { display: inline-flex; }
.appbar-back:active { background: var(--green-050); }
.appbar-theme {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-right: 2px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-accent);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.appbar-theme svg { width: 22px; height: 22px; }
.appbar-theme:active { background: var(--green-050); transform: scale(.94); }
.appbar-avatar, .appbar-action { flex: none; display: inline-flex; align-items: center; }
.appbar-action {
  font: 700 14px/1 var(--sans); color: var(--ink-accent); text-decoration: none;
  padding: 9px 12px; border-radius: 999px; background: var(--green-050);
}
.appbar-action:active { transform: scale(.96); }

/* Site-wide officer notice */
.site-notice {
  background: #ffd60a;
  color: #231a00;
  padding: 10px 16px;
  text-align: center;
  font: 700 14px/1.45 var(--sans);
  white-space: pre-line;
  border-bottom: 1px solid #d9b400;
}

/* Screen */
.screen {
  flex: 1;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 14px 16px calc(var(--tabbar-h) + var(--sab) + 28px);
  animation: screen-in .26s cubic-bezier(.2,.7,.3,1);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* Tab bar (bottom) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  display: flex; justify-content: space-around;
  padding: 4px 6px calc(4px + var(--sab));
  padding-bottom: max(4px, calc(4px + var(--sab)));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(14px);
  backdrop-filter: saturate(1.8) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; max-width: 108px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink-faint);
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, transform .1s;
}
.tab__icon { width: 25px; height: 25px; }
.tab__icon svg { width: 100%; height: 100%; }
.tab__label { font: 600 10.5px/1 var(--sans); letter-spacing: .01em; }
.tab:active { transform: scale(.92); }
.tab--active { color: var(--ink-accent); }
.tab--active .tab__label { font-weight: 800; }

/* Wide screens / folded-wide dual screens: nav rail on the left, app bar
   across the top of the content, screen beneath — a grid, so the app bar
   stays a bar instead of collapsing into a side column. */
@media (min-width: 1000px) {
  .app {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "rail appbar"
      "rail notice"
      "rail main";
  }
  .appbar {
    grid-area: appbar;
    padding-left: 16px;
  }
  .site-notice { grid-area: notice; }
  .appbar-back { margin-right: 0; }
  .appbar-brand { display: none; }
  .screen {
    grid-area: main;
    padding: 22px 32px calc(28px + var(--sab));
  }
  .tabbar {
    grid-area: rail;
    position: sticky; top: 0;
    flex-direction: column; justify-content: start; gap: 6px;
    width: 96px; height: 100dvh;
    padding: calc(16px + var(--sat)) 10px 16px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .tab { max-width: none; padding: 10px 4px; }
}

/* ---------- Content primitives ---------- */
.page-head { margin: 2px 0 16px; }
.page-head h1 { font-size: clamp(26px, 5vw, 34px); margin: 0; }
.page-head .sub { color: var(--ink-soft); margin: 6px 0 0; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section { padding: 22px 0; }
.section-head { margin: 0 0 18px; }
.eyebrow {
  font: 800 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--green-500); margin: 0 0 8px;
}
.section-title { font-size: clamp(22px, 4vw, 30px); }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.stack { display: grid; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
.hint { color: var(--ink-soft); font-size: 14px; }
.hint-inline { color: var(--ink-faint); font-size: 12.5px; }

/* Long tokens (otpauth URIs, emails, receipts) must wrap inside cards —
   never push a column wider. */
.secret-box code, .email-body, .email-row__meta, .pc-v, .audit-detail,
.audit-actor, .row__sub, .hint-inline {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.secret-box code { white-space: pre-wrap; display: block; }
.grid > *, .stack > *, .rows > * { min-width: 0; }

/* Cards / tiles */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px;
  margin: 0 0 14px;
}
.card--flush { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-top: 0; }

/* List rows (app-style, chevroned, 52px+ targets) */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  background: var(--surface);
  transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--green-050); }
.row:active { background: var(--green-100); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 700; line-height: 1.3; }
.row__sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 1px; }
.row__chev { flex: none; width: 18px; height: 18px; color: var(--ink-faint); }
.row__chev svg { width: 100%; height: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); color: var(--ink);
  font: 700 15.5px/1 var(--sans);
  text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--green-050); }
.btn:active { transform: scale(.97); }
.btn--primary {
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  border-color: transparent; color: #fff;
  box-shadow: var(--shadow-1);
}
.btn--primary:hover { background: linear-gradient(160deg, var(--green-400), var(--green-600)); }
.btn--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn--small { min-height: 38px; padding: 6px 14px; font-size: 13.5px; border-radius: 10px; }
.btn--block { width: 100%; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 700 11.5px/1 var(--sans); letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--green-050); color: var(--chip-ink);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip--draft { background: var(--amber-soft); color: var(--amber); }
.chip--archived { background: var(--green-100); color: var(--ink-soft); }
.chip--pending { background: var(--amber-soft); color: var(--amber); }
.chip--tombstoned { background: transparent; border-color: var(--line); color: var(--ink-faint); text-decoration: line-through; }
.chip--err { background: var(--red-soft); color: var(--red); }
.chip--failed { background: var(--red-soft); color: var(--red); }

/* Toasts: fixed layer at the bottom, above all content (z: tabbar 70,
   appbar 60, lightbox 200). Server-rendered flashes land here too. */
.toast-layer {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--sab) + 14px);
  z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 560px; padding: 13px 14px;
  border-radius: 13px;
  font-weight: 600; font-size: 14.5px; line-height: 1.45;
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  animation: toast-in .28s cubic-bezier(.2,.7,.3,1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.toast--ok { background: var(--green-600); color: #fff; }
.toast--err { background: var(--red); color: #fff; }
.toast--info { background: var(--green-800); color: #fff; }
.toast__msg { flex: 1; }
.toast__x {
  flex: none; border: 0; background: transparent; color: inherit;
  font-size: 18px; line-height: 1; padding: 2px 4px; cursor: pointer; opacity: .8;
}
.toast.is-done { opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }

/* Forms */
.field { margin-bottom: 15px; }
.field label { display: block; font: 700 13px/1 var(--sans); margin-bottom: 7px; color: var(--ink-soft); letter-spacing: .01em; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], input[type="date"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 16px; /* >=16px: iOS never zooms */
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a5a50' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
textarea { min-height: 96px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--green-400) 30%, transparent);
}
.field-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-actions .btn { flex: 1; min-width: 140px; }
.form-error { color: var(--red); font-weight: 600; font-size: 14px; margin: 8px 0; }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 14px 16px;
}
.stat__num { font: 800 26px/1.1 var(--sans); letter-spacing: -.02em; color: var(--ink-accent); }
.stat__label { font: 600 12px/1.4 var(--sans); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }

/* Tables (leaderboard, admin) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 12px; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table--board td, .table--board th { padding-block: 13px; }
.rank-badge {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--rank-bg); color: var(--ink-accent);
  font: 800 13px/1 var(--sans);
}
.rank-badge--1 { background: linear-gradient(150deg, #ffd66b, #e8a711); color: #4d3400; }
.rank-badge--2 { background: linear-gradient(150deg, #e8edf2, #b9c4cf); color: #35404a; }
.rank-badge--3 { background: linear-gradient(150deg, #f0b48f, #c96f3b); color: #4d2003; }

/* Avatars */
.avatar { border-radius: 50%; background: var(--green-100); color: var(--green-700); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* The avatar classes land on the <img> itself (see templates::avatar) —
   crop to the circle, never distort. */
img.avatar { object-fit: cover; object-position: center; }
.avatar svg { width: 100%; height: 100%; }
.avatar--nav { width: 34px; height: 34px; border: 2px solid var(--line); }
.avatar--row { width: 42px; height: 42px; }
.avatar--lg { width: 84px; height: 84px; border: 3px solid var(--line); }
.appbar-avatar:active { transform: scale(.94); }

/* Hero (home) */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--green-600), var(--green-900));
  border-radius: 20px; color: #fff;
  padding: 26px 22px 24px; margin-bottom: 18px;
  box-shadow: var(--shadow-2);
}
.hero h1 { font-size: clamp(26px, 6vw, 34px); margin: 0 0 8px; }
.hero p { color: rgba(255,255,255,.92); margin: 0; }
.hero .eyebrow { color: #b9edca; }
.hero__waves { position: absolute; inset: auto -20% -55% auto; width: 140%; opacity: .16; }
.hero__cta { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero__cta .btn { border-color: transparent; }

/* Species guide cards */
.fish-card { overflow: hidden; }
.fish-card__photo { aspect-ratio: 4/3; background: var(--green-050); }
.fish-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.fish-card__body { padding: 14px 16px; }

/* FAB (submit a catch) */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--sab) + 18px);
  z-index: 65;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: linear-gradient(160deg, var(--green-500), var(--green-700));
  color: #fff; text-decoration: none;
  font: 800 15px/1 var(--sans);
  box-shadow: var(--shadow-2);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 20px; height: 20px; }
@media (min-width: 1000px) { .fab { right: calc(50% - var(--col)/2 - 8px); } }

/* Entry meter on tournament cards */
.meter { height: 7px; border-radius: 99px; background: var(--green-050); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-500), var(--green-400)); transition: width .4s; }

/* Countdown */
.countdown {
  display: flex; gap: 8px; margin: 10px 0;
}
.countdown__cell {
  flex: 1; max-width: 90px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 6px; text-align: center;
  box-shadow: var(--shadow-1);
}
.countdown__num { font: 800 22px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-accent); }
.countdown__lab { font: 700 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

/* Photo submissions / catch cards */
.catch-card { overflow: hidden; }
.catch-card__photo { position: relative; background: var(--green-050); }
.catch-card__photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.catch-card__ruler {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 30px; background: rgba(3, 20, 10, .62);
  color: #fff; font: 700 12.5px/30px var(--sans);
  display: flex; justify-content: space-between; padding: 0 12px;
}
.catch-card__body { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--green-050); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented a, .segmented .seg-choice {
  padding: 8px 16px; border-radius: 9px; text-decoration: none;
  border: 0; background: transparent; cursor: pointer;
  font: 700 13px/1 var(--sans); color: var(--ink-soft);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.segmented a[aria-current="page"], .segmented .seg-choice[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
}

/* Admin bits */
.admin-table { font-size: 14px; }
.admin-emails td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.dates-cell { white-space: nowrap; color: var(--ink-soft); font-size: 13px; }
.actions-cell { text-align: right; white-space: nowrap; }

/* Login / register / hero-form screens */
.auth-card { max-width: 460px; margin: 0 auto; }
.auth-card .btn--block { width: 100%; margin-top: 6px; }
.division-grid { display: grid; gap: 12px; margin: 14px 0; }
.division-card {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.division-card:hover, .division-card:focus-visible { border-color: var(--green-500); }
.division-card strong { display: block; margin-bottom: 4px; font-size: 17px; color: var(--ink-accent); }
.division-card span { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.division-card .division-note {
  display: block; margin-top: 6px; color: var(--ink-soft);
  font-size: 12.5px; line-height: 1.4;
}
@media (min-width: 600px) { .division-grid { grid-template-columns: 1fr 1fr; } }
.team-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0; }
@media (min-width: 560px) { .team-grid { grid-template-columns: 1fr 1fr; } }
.team-pick {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.team-pick:hover, .team-pick:focus-visible { border-color: var(--green-500); background: var(--green-050); }
.team-pick strong { font-size: 16px; line-height: 1.25; }
.team-selected {
  display: flex; align-items: center; gap: 12px; margin: 14px 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--green-050);
}
.team-checks { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.team-check {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.team-check input { width: auto; min-height: 0; margin: 0; }
.team-check span { font-size: 14px; }
.team-eligibility { padding: 4px 0 12px; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--ink-soft); font-size: 14.5px; }

/* Empty states */
.empty {
  text-align: center; padding: 44px 20px;
  color: var(--ink-soft);
}
.empty svg { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--green-200); }
.empty h3 { color: var(--ink); }

/* Misc legacy helpers kept for older fragments */
.main { padding: 0; }
.site-footer { display: none; }
.shell { width: 100%; }
.notice { color: var(--ink-soft); font-size: 14px; }
.flash { display: block; padding: 10px 12px; border-radius: 9px; font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ==========================================================================
   Component layer — tournament cards, leaderboard, submissions,
   admin tables, account rows, forms extras. (Classes used by templates.)
   ========================================================================== */

/* --- Tournament cards --- */
.tournament-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.tournament-card__sponsor { display: block; }
.sponsor-label {
  display: block; margin-bottom: 4px;
  font: 700 10.5px/1 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
}
.tournament-card__sponsor img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-sm);
}
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase {
  font: 800 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-accent);
}
.phase--big { font-size: 13px; }
.tournament-card h3 { margin: 0; font-size: 19px; }
.tournament-card h3 a { color: var(--ink); text-decoration: none; }
.tournament-card h3 a:active { color: var(--ink-accent); }
.tournament-subtitle { margin: -4px 0 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.35; }
.dates { color: var(--ink-soft); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dates--big { font-size: 15px; }
.card-meta {
  display: flex; gap: 8px 14px; flex-wrap: wrap;
  color: var(--ink-soft); font-size: 13.5px;
}
.card-meta strong { color: var(--ink); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.btn--outline { border-color: var(--green-500); color: var(--ink-accent); background: transparent; }
.btn--outline:hover { background: var(--green-050); }

/* --- Leaderboard --- */
.lb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.leaderboard { width: 100%; border-collapse: collapse; font-size: 15px; }
.leaderboard th {
  text-align: left; font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 10px; border-bottom: 1.5px solid var(--line);
}
.leaderboard td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.leaderboard tr:last-child td { border-bottom: 0; }
.leaderboard .rank { white-space: nowrap; font-weight: 800; color: var(--ink-accent); font-variant-numeric: tabular-nums; }
.leaderboard .angler { font-weight: 700; }
.leaderboard .num { text-align: right; }
.leaderboard .big { font-size: 17px; font-weight: 800; color: var(--ink-accent); }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 999px;
  background: var(--rank-bg); color: var(--ink-accent); font: 800 12px/1 var(--sans);
}
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager button {
  min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 13.5px/1 var(--sans); text-decoration: none; cursor: pointer;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chat-empty { color: var(--ink-soft); padding: 18px 0; text-align: center; }

/* --- Photos & thumbs --- */
.thumb { border-radius: 12px; border: 1px solid var(--line); background: var(--green-050); }
.thumb--sm { width: 52px; height: 52px; object-fit: cover; }
.thumb--big { width: 100%; max-width: 320px; height: auto; object-fit: cover; }
.thumb--empty { display: grid; place-items: center; color: var(--ink-faint); font-size: 12px; }

/* --- Submissions (admin review & profile lists) --- */
.submission { border-bottom: 1px solid var(--line); padding: 14px 0; }
.submission:last-child { border-bottom: 0; }
.submission-photos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px; margin: 4px 0 10px;
}
.submission-photos figure { margin: 0; }
.submission-photos img {
  width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: 12px; background: var(--green-050);
}
.submission-photos figcaption { margin-top: 4px; color: var(--ink-faint); font-size: 12px; }
.submission-body { margin: 6px 0; }
.submission-meta, .submission-actions { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.submission-meta { color: var(--ink-soft); font-size: 13.5px; }
.submission-actions { margin-top: 10px; }
.sub-notes { color: var(--ink-soft); font-size: 14px; font-style: italic; }
.when { color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.row-idx { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.min-label { color: var(--ink-soft); font-size: 12.5px; }
.orig { color: var(--ink-faint); text-decoration: line-through; }
.override { color: var(--amber); font-weight: 700; }
.corr-details {
  margin: 8px 0; padding: 10px 12px; border-left: 3px solid var(--amber);
  background: var(--amber-soft); border-radius: 0 9px 9px 0; font-size: 14px;
}
.corr-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.admin-notes { color: var(--ink-soft); font-size: 13.5px; }
.admin-subs { display: grid; gap: 0; }
.caption { color: var(--ink-faint); font-size: 12.5px; margin-top: 4px; }

/* --- Account rows --- */
.reg-line { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.pickup-note {
  margin-top: 8px; padding: 10px 12px; border-radius: 9px;
  background: var(--green-050); color: var(--ink-soft); font-size: 14px;
}
.profile-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.email-body {
  white-space: pre-wrap; word-break: break-word;
  background: var(--green-050); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 13px; margin-top: 8px;
}
.email-details { margin-top: 8px; color: var(--ink-soft); font-size: 13px; }

/* --- Auth / entry / 2FA extras --- */
.error { color: var(--red); font-weight: 700; }
.enter-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.entry-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.entry-line { margin: 8px 0; }
.entry-ok { color: var(--ink-accent); font-weight: 700; }
.recovery-box {
  background: var(--green-050); border: 1px dashed var(--green-400);
  border-radius: var(--radius-sm); padding: 14px; margin: 12px 0;
}
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
@media (min-width: 560px) { .recovery-grid { grid-template-columns: repeat(3, 1fr); } }
.recovery-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; text-align: center; user-select: all;
}
.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 700;
  letter-spacing: .06em; user-select: all;
  background: var(--surface); border: 1.5px solid var(--green-400); border-radius: var(--radius-sm);
  padding: 12px 14px; text-align: center; margin: 10px 0;
}
.secret-box--small { font-size: 14px; padding: 8px 10px; }
.howto-inline { color: var(--ink-soft); font-size: 13.5px; }
.rules-list { margin: 8px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 14.5px; }
.rules-list li { margin: 5px 0; }
.rules { margin-top: 10px; }
.edit-grid { display: grid; gap: 18px; }
.edit-photos { display: grid; gap: 10px; }
.edit-photos figure { margin: 0; }
.edit-photos figcaption { margin-top: 4px; color: var(--ink-faint); font-size: 12px; }
@media (min-width: 760px) { .edit-grid { grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); align-items: start; } }
.section-gap { margin-top: 34px; }
.measure-photos { display: grid; gap: 12px; max-width: 720px; margin: 10px 0; }
.measure-photos figure { margin: 0; }
.measure-photos img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.measure-photos figcaption { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
@media (min-width: 640px) {
  .measure-photos { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

/* --- Hero (legacy variants still referenced) --- */
.hero__inner { position: relative; }
.hero--compact { padding: 20px; }
.hero__eyebrow {
  font: 800 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: #b9edca; margin: 0 0 8px;
}
.hero__lede { color: rgba(255,255,255,.92); }
.accent { color: #9fe8bc; }

/* --- Admin --- */
.card--admin { border-color: color-mix(in srgb, var(--green-500) 25%, var(--line)); }
.audit-wrap { display: grid; gap: 0; }
.audit { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.audit:last-child { border-bottom: 0; }
.audit-time { flex: none; width: 150px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.audit-actor { flex: none; width: 130px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-detail { flex: 1; color: var(--ink-soft); word-break: break-word; }
.audit-none { color: var(--ink-faint); padding: 14px 0; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 14px 16px;
}
.stat-n { font: 800 26px/1.1 var(--sans); color: var(--ink-accent); }
.stat-label { font: 600 12px/1.4 var(--sans); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.flash {
  display: block; margin: 0 0 14px; padding: 12px 14px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px;
}
.flash--ok { background: var(--green-100); color: var(--chip-ink); border: 1px solid color-mix(in srgb, var(--green-500) 30%, transparent); }
.flash--err { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.empty-card { text-align: center; padding: 36px 18px; color: var(--ink-soft); }
.empty-card h3 { color: var(--ink); }
.avatar--default { color: var(--green-600); }
.avatar--profile { width: 84px; height: 84px; border: 3px solid var(--line); }
.avatar--lb { width: 34px; height: 34px; border: 2px solid var(--line); }
.team-logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 8px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-accent); font: 800 14px/1 var(--sans);
}
.team-logo--default { background: var(--green-050); }
.team-logo--empty { background: transparent; border: 0; }
.team-logo--lb { width: 34px; height: 34px; }
.team-logo--total { width: 30px; height: 30px; }
.team-logo--pick { width: 76px; height: 76px; border-radius: 14px; }
.team-logo--selected { width: 44px; height: 44px; }
.team-logo--check { width: 28px; height: 28px; }
.team-logo--admin { width: 56px; height: 56px; border-radius: 12px; }

/* --- Chips: visible pills in both themes --- */
.chip--published, .chip--paid {
  background: var(--chip-solid-bg); color: var(--chip-solid-ink);
}

/* --- Admin purchase cards (replaced the wide table) --- */
.purchase-card { margin: 0 0 12px; }
.pc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-receipt {
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  background: var(--green-050); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px;
}
.pc-grid {
  display: grid; grid-template-columns: 78px 1fr; gap: 6px 12px;
  font-size: 14.5px; align-items: baseline;
}
.pc-k { color: var(--ink-faint); font: 700 11.5px/1.6 var(--sans); text-transform: uppercase; letter-spacing: .05em; }
.pc-v { min-width: 0; overflow-wrap: anywhere; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pc-actions:empty { display: none; }

/* --- Leaderboard as ranked rows --- */
.lb-section + .lb-section { margin-top: 20px; }
.lb-section h3 {
  margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-accent);
}
.lb-list { display: flex; flex-direction: column; }
.lb-row {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: 0; }
.lb-photo { display: block; flex: none; width: 56px; height: 42px; border-radius: 9px; overflow: hidden; background: var(--green-050); border: 1px solid var(--line); }
.lb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-who { flex: 1; min-width: 0; }
.lb-angler { font-weight: 700; line-height: 1.25; }
.lb-meta { margin-top: 2px; font: 500 11px/1.2 var(--sans); color: var(--ink-faint); }
.lb-unit { margin-left: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.sponsor-current {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--green-050);
}
.sponsor-current img { max-width: 180px; max-height: 80px; object-fit: contain; }
.tournament-sponsor { margin: 12px 0 16px; }
.tournament-sponsor img {
  display: block; width: auto; max-width: min(100%, 360px);
  max-height: 140px; object-fit: contain;
}
.code-word {
  margin: 18px 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--green-050); color: var(--ink-accent);
  font-size: 2em; font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em; overflow-wrap: anywhere;
}
.code-word--waiting { color: var(--ink-soft); }
.code-word__value { font-weight: 900; letter-spacing: .01em; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.check input { width: auto; min-height: 0; margin: 0; }
.lb-length {
  flex: none; font: 800 19px/1 var(--sans); color: var(--ink-accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.team-totals {
  margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--green-050);
}
.team-totals__title {
  margin-bottom: 7px; color: var(--ink-faint);
  font: 700 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.team-totals__list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.team-total { display: flex; align-items: center; gap: 7px; min-width: 0; }
.team-total__name { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.team-total__count { color: var(--ink-accent); font: 800 17px/1 var(--sans); font-variant-numeric: tabular-nums; }

/* --- Admin: users, dashboard tournaments, submissions, emails, audit --- */
.admin-t-card { margin: 0; }
.team-admin-card { margin: 0; }
.team-admin-head { display: flex; align-items: center; gap: 12px; }
.team-admin-name { min-width: 0; overflow-wrap: anywhere; }
.user-card { margin: 0; }
.uc-head { display: flex; align-items: center; gap: 12px; }
.uc-who { flex: 1; min-width: 0; }
.uc-role { margin-top: 10px; }
.uc-role .inline-form { display: flex; gap: 8px; align-items: center; }
.uc-role select { min-height: 40px; width: auto; padding: 8px 34px 8px 12px; }
.sub-card { margin: 0; }
.sub-top { display: flex; gap: 12px; align-items: flex-start; }
.sub-legality { margin-top: 6px; }
.sub-card .card-actions { margin-top: 12px; }
.sub-card details.corr-details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0; margin: 0; overflow: hidden; flex: 1; min-width: 200px;
}
.sub-card details.corr-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sub-card details.corr-details summary::-webkit-details-marker { display: none; }
.sub-card details.corr-details[open] { padding: 12px; border-left: 3px solid var(--amber); }
.sub-card details.corr-details[open] summary { display: none; }
.email-row { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.email-row:last-child { border-bottom: 0; }
.email-row__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.email-row__meta { color: var(--ink-soft); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.audit-body { flex: 1; min-width: 0; }
.audit .badge { display: inline-block; margin-bottom: 2px; }

/* --- Photo lightbox (in-app photo viewer) --- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 10, 5, .92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  padding: var(--sat) 0 var(--sab);
  animation: lb-in .18s ease-out;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox__bar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 10px 14px; color: #fff;
}
.lightbox__x {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer;
}
.lightbox__img {
  flex: 1; min-height: 0; margin: 0 auto;
  max-width: 100%; object-fit: contain;
  animation: lb-zoom .2s cubic-bezier(.2,.7,.3,1);
}
@keyframes lb-zoom { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Passkey rows (profile) --- */
.pk-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.pk-row:last-child { border-bottom: 0; }
.pk-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pk-rename { display: flex; gap: 8px; flex: 1; min-width: 0; }
.pk-rename input {
  flex: 1; min-width: 0; min-height: 40px; padding: 8px 12px;
}

/* --- Avatar crop modal --- */
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-btn:active .avatar { transform: scale(.95); }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 180;
  background: rgba(2, 10, 5, .72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; padding-bottom: calc(20px + var(--sab));
  animation: lb-in .15s ease-out;
}
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  width: 100%; max-width: 400px; padding: 20px;
  animation: modal-in .2s cubic-bezier(.2,.7,.3,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.crop-box {
  position: relative; width: 100%; aspect-ratio: 1;
  overflow: hidden; border-radius: 12px;
  background: var(--green-050);
  touch-action: none; user-select: none; cursor: grab;
  margin-bottom: 10px;
}
.crop-box:active { cursor: grabbing; }
.crop-box img {
  position: absolute; transform-origin: 0 0;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.crop-circle {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(2, 10, 5, .55);
  pointer-events: none;
}
.pm-remove { margin-top: 12px; text-align: center; }
/* avatar: size must survive inside a button (inline spans ignore w/h) */
.avatar { display: inline-block; }
.avatar-btn { -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; line-height: 0; }
/* visually hidden file input behind the Choose-photo label-button */
.pm-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-id { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* crop math sizes the img via transform against its NATURAL size —
   the global `img { max-width: 100% }` clamps CSS width first and
   breaks the fit (photo renders small, top-left). */
.crop-box img { max-width: none; max-height: none; }
/* Buttons shouldn't sit on top of the text that follows them:
   give following paragraphs/hints a proper gap (screens: 2FA, passkeys). */
.actions + .hint, .actions + p { margin-top: 14px; }
form + .hint, form + p { margin-top: 14px; }
/* --- 2FA setup / recovery codes --- */
.qr-box {
  background: #fff; border-radius: 12px; padding: 14px;
  width: max-content; max-width: 100%; margin: 4px auto 16px;
}
.qr-box svg { display: block; width: 210px; height: auto; }
.codes-box {
  background: var(--green-050); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 12px; margin: 10px 0 8px; text-align: center;
  font: 700 15px/1.9 var(--mono); letter-spacing: .06em; white-space: pre-wrap;
  cursor: copy; user-select: all; -webkit-user-select: all;
}
/* dark-on-dark fix: the "2FA is on" banner must stay readable in both themes */
.flash--ok {
  background: var(--chip-bg); color: var(--chip-ink);
  border: 1px solid color-mix(in srgb, var(--green-500) 35%, transparent);
}

/* Non-interactive switcher rows (upcoming tournaments on Standings). */
.row--static { cursor: default; }
.row--static:hover, .row--static:active { background: var(--surface); }
.row__title { display: block; }
.row__sub { display: block; }

.btn--full { width: 100%; justify-content: center; }

/* --- Profile badges & admin badge management --- */
.badge-grid {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px;
}
.badge-card {
  flex: none; width: 128px; margin: 0; padding: 0;
  text-align: center; background: none; border: 0;
}
.badge-link { display: block; line-height: 0; }
.badge-img {
  width: 128px; height: 128px; max-width: 128px; max-height: 128px;
  object-fit: contain; border-radius: 10px; background: var(--green-050);
}
.badge-img--admin { width: 140px; height: 140px; }
.badge-preview-row { margin: 10px 0; }
.badge-admin-list { display: grid; gap: 10px; }
.badge-admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.badge-admin-row:last-child { border-bottom: 0; }
.badge-admin-row .badge-img--admin { width: 64px; height: 64px; }
.badge-admin-info { flex: 1; min-width: 0; }
.badge-award-list { display: grid; }
.badge-award-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.badge-award-row:last-child { border-bottom: 0; }
.award-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.award-form label { flex: 1; min-width: 220px; }

/* --- Bug reports --- */
.tab--bug { appearance: none; background: none; border: 0; font: inherit; cursor: pointer; }
.bug-message {
  margin: 10px 0; padding: 12px 14px; border-radius: 10px;
  background: var(--green-050); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.bug-meta { margin: 10px 0; }
.bug-meta summary { cursor: pointer; display: inline-block; list-style: none; }
.bug-meta summary::-webkit-details-marker { display: none; }
.bug-meta pre {
  margin: 10px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--green-050); border: 1px solid var(--line);
  font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 380px; overflow: auto;
}
