/* public/css/global.css
   Global reset + app-wide base tokens + shell + simple primitives (LIGHT MODE++)
   - Mobile-first
   - POPPY background + gentle texture + richer header
   - Footer is FIXED to bottom with a clean white/glass background
   - ✅ Reusable centered "sheet" + form system (ui-sheet, ui-form, ui-field)
   - ✅ Reusable Avatar Ring system (ui-avatarring, ui-avatarimg)
   - ✅ Reusable clickable Tile primitive (ui-tile)
   - ✅ Reusable tooltip / info system (ui-info, ui-tooltip)
   --font-kid: ui-rounded, "Comic Sans MS", "Comic Sans", "Chalkboard SE",
    "Marker Felt", "Trebuchet MS", system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
*/

:root {
  /* Fonts */
  --font-kid: "Baloo 2", system-ui, sans-serif;

  /* ============================================================
     App palette (light+++ / brighter like the logo)
  ============================================================ */
  --app-fg: #0b1220;
  --app-muted: rgba(11, 18, 32, 0.66);

  /* Brighter accents (clean + candy, not neon-glow) */
  --accent: #22d3ff; /* bright cyan */
  --accent-2: #8b5cff; /* electric violet */
  --accent-3: #22e6a8; /* bright mint/green */
  --accent-4: #ff4fb3; /* bright pink (logo candy pink) */
  --accent-5: #ffb020; /* bright amber */

  /* Bonus: logo-ish primaries for brand moments (optional usage) */
  --brand-blue: #18bfff;
  --brand-yellow: #ffcc29;

  /* Shared rainbow gradient (more saturated) */
  --rainbow: linear-gradient(
    90deg,
    rgba(34, 211, 255, 0.96),
    rgba(139, 92, 255, 0.96),
    rgba(34, 230, 168, 0.96),
    rgba(255, 176, 32, 0.94),
    rgba(255, 79, 179, 0.94)
  );

  /* Surfaces (slightly brighter/cleaner) */
  --surface: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(255, 255, 255, 0.78);

  /* Borders */
  --border: rgba(11, 18, 32, 0.12);
  --border-strong: rgba(11, 18, 32, 0.18);

  /* Controls */
  --btn-bg: #0b1220;
  --btn-fg: #ffffff;
  --btn-border: rgba(11, 18, 32, 0.18);

  --input-bg: rgba(255, 255, 255, 0.94);
  --input-border: rgba(11, 18, 32, 0.16);
  --focus: rgba(34, 211, 255, 0.75);

  /* Radius */
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 20px;

  /* Layout */
  --container: 1100px;
  --sheet: 760px;

  /* Semantic (slightly brighter) */
  --good: #12b981;
  --bad: #ef4444;

  /* Shadow */
  --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.09);
  --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.14);

  /* ============================================================
     POPPY Background canvas (brighter, more “candy”)
  ============================================================ */
  --bg-grad: radial-gradient(
      1100px 700px at 10% 12%,
      rgba(139, 92, 255, 0.34),
      rgba(255, 255, 255, 0) 62%
    ),
    radial-gradient(
      1050px 720px at 88% 18%,
      rgba(34, 211, 255, 0.34),
      rgba(255, 255, 255, 0) 62%
    ),
    radial-gradient(
      1000px 760px at 55% 92%,
      rgba(34, 230, 168, 0.24),
      rgba(255, 255, 255, 0) 60%
    ),
    radial-gradient(
      820px 540px at 40% 52%,
      rgba(255, 79, 179, 0.18),
      rgba(255, 255, 255, 0) 66%
    ),
    radial-gradient(
      900px 560px at 82% 70%,
      rgba(255, 176, 32, 0.16),
      rgba(255, 255, 255, 0) 68%
    ),
    linear-gradient(180deg, #fff4fb 0%, #f3fbff 42%, #fffaf0 100%);

  --bg-dots: radial-gradient(
    circle at 1px 1px,
    rgba(11, 18, 32, 0.06) 1px,
    rgba(0, 0, 0, 0) 1.6px
  );

  /* Header/footer tint (glass band) */
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.9);

  /* Footer sizing */
  --footer-h: 74px;

  /* ============================================================
     Global badge
  ============================================================ */
  .app-link--hasbadge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .app-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 800;
    background: #ff3b30;
    color: #fff;
  }

  /* ============================================================
     Avatar ring system
  ============================================================ */
  --avatar-xs: 33px;
  --avatar-sm: 84px;
  --avatar-md: 96px;
  --avatar-lg: 112px;

  --avatar-ring: 3px;
  --avatar-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);

  /* ============================================================
     Tooltip system tokens
  ============================================================ */
  --tip-bg: rgba(255, 255, 255, 0.96);
  --tip-border: rgba(11, 18, 32, 0.12);
  --tip-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

/* ============================================================
   Reset-ish
============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--app-fg);
  font-family: var(--font-kid);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;


  overflow-x: hidden;
  position: relative;
}


img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

::selection {
  background: rgba(56, 189, 248, 0.28);
}

/* ============================================================
   Layout primitives
============================================================ */

.app-container {
  width: min(var(--container), calc(100%));
  margin: 0 auto;
}

.app-main {
  padding: 0px 0 24px;
  padding-bottom: calc(var(--footer-h) + 26px);
}

.ui-page {
  padding: 14px 0 24px;
}

/* ============================================================
   Tiny primitives
============================================================ */

.ui-title {
  margin: 0 0 10px 0;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 0.2px;
}

.ui-sub {
  margin: 6px 0 14px 0;
  color: var(--app-muted);
  line-height: 1.45;
}

.ui-grid {
  display: grid;
  gap: 12px;
}

.ui-card {
  
  background: var(--surface);
  border-radius: var(--r-md);
  backdrop-filter: blur(12px);
}

.ui-label {
  font-size: 13px;
  color: var(--app-muted);
}

/* Inputs */
.ui-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--app-fg);
  outline: none;
  font-family: var(--font-kid);
}

.ui-input:focus {
  border-color: rgba(11, 18, 32, 0.28);
  box-shadow: 0 0 0 4px var(--focus);
}

/* Buttons */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kid);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-border);

  background: var(--btn-bg);
  color: var(--btn-fg);

  font-weight: 900;
  cursor: pointer;

  box-shadow: var(--shadow-md);
  user-select: none;
}

.ui-btn:hover {
  transform: translateY(-0.5px);
}

.ui-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ui-btn--ghost {
  background: transparent;
  color: var(--app-fg);
  border-color: rgba(11, 18, 32, 0.14);
  box-shadow: none;
}

.ui-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(11, 18, 32, 0.12);
  transform: none;
}

/* Status pill */
.ui-status {
  font-size: 13px;
  color: var(--app-muted);
  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid rgba(11, 18, 32, 0.1);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.ui-status[data-kind="good"] {
  color: var(--good);
}
.ui-status[data-kind="bad"] {
  color: var(--bad);
}

/* ============================================================
   UI Tile (clickable card)
============================================================ */

.ui-tile {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 18px;

  backdrop-filter: blur(14px);
  box-shadow: none;

  color: inherit;
  text-decoration: none;

  transition: transform 120ms ease, box-shadow 120ms ease,
    border-color 120ms ease, background 120ms ease;
}

.ui-tile:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.ui-tile:active {
  transform: translateY(0px);
}

.ui-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 16px 34px rgba(0, 0, 0, 0.12);
}

.ui-tile--btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

/* ============================================================
   Avatar Ring System (reusable)
   ✅ includes XS again
============================================================ */

.ui-avatarring {
  width: var(--avatar-md);
  height: var(--avatar-md);
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  padding: var(--avatar-ring);
  border-radius: 50%;
  background: var(--rainbow);
}

.ui-avatarring--xs {
  width: var(--avatar-xs);
  height: var(--avatar-xs);
}

.ui-avatarring--sm {
  width: var(--avatar-sm);
  height: var(--avatar-sm);
}
.ui-avatarring--md {
  width: var(--avatar-md);
  height: var(--avatar-md);
}
.ui-avatarring--lg {
  width: var(--avatar-lg);
  height: var(--avatar-lg);
}

.ui-avatarimg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;

  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms ease;
}

.ui-avatarimg--placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.ui-avatarring--btn {
  appearance: none;
  -webkit-appearance: none;

  border: 0;
  cursor: pointer;
  user-select: none;

  transition: transform 120ms ease, box-shadow 120ms ease;
}

.ui-avatarring--btn:hover {
  transform: translateY(-1px);
}

.ui-avatarring--btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), var(--avatar-shadow);
}

.ui-avatarring.is-selected {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.12), 0 0 0 8px var(--focus),
    var(--avatar-shadow);
}

.ui-avatarring.is-selected .ui-avatarimg,
.ui-avatarring.is-selected .ui-avatarimg--placeholder {
  transform: scale(1.04);
}

/* ============================================================
   Tooltip / info system (reusable)
   ✅ make the "i" dark so it is visible
============================================================ */

.ui-info {
  appearance: none;
  -webkit-appearance: none;

  width: 20px;
  height: 20px;

  display: inline-grid;
  place-items: center;

  border-radius: 999px;
  border: 2px solid transparent;

  background: rgba(11, 18, 32, 0.86); /* 👈 DARK */
  color: #fff; /* 👈 readable */

  cursor: pointer;
  user-select: none;

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
  transition: background 120ms ease, border-color 120ms ease,
    transform 120ms ease, box-shadow 120ms ease;
}

.ui-info::before {
  content: "i";
  font-weight: 950;
  font-size: 12px;
  line-height: 1;
}

.ui-info:hover {
  background: rgba(11, 18, 32, 0.95);
  transform: translateY(-0.5px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
}

.ui-info:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.ui-tooltip {
  z-index: 9999;

  padding: 10px 12px;
  border-radius: 14px;

  background: var(--tip-bg);
  border: 1px solid var(--tip-border);

  color: rgba(11, 18, 32, 0.92);
  font-size: 13px;
  line-height: 1.35;

  backdrop-filter: blur(14px);
  box-shadow: var(--tip-shadow);

  opacity: 0;
  pointer-events: none;

  transition: opacity 120ms ease, transform 120ms ease;
  transform: translate(-9999px, -9999px);
}

.ui-tooltip.is-on {
  opacity: 1;
  pointer-events: none;
}

/* ============================================================
   Brand logo (brain)
============================================================ */

.app-brand__logo {
  width: 100px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
  margin-left: 10px;
}

.app-footer__brand {
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-footer__logo {
  width: 100px;
  object-fit: contain;
  opacity: 0.9;
}

/* ============================================================
   Centered "sheet" + form system
============================================================ */

.ui-sheet {
  width: min(var(--sheet), calc(100% - 28px));
  margin: 0 auto;
}


.ui-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.ui-field {
  display: grid;
  gap: 8px;
}

.ui-help {
  font-size: 12px;
  color: var(--app-muted);
  margin-top: -2px;
}

.ui-form__actions {
  margin-top: 6px;
}

.ui-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--app-muted);
}

/* Inline validation helpers */
.ui-statusline {
  display: none;
  width: fit-content;
}
.ui-statusline.is-on {
  display: inline-flex;
}
.ui-statusline.is-good {
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: var(--good);
}
.ui-statusline.is-bad {
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(185, 28, 28, 0.07);
  color: var(--bad);
}

.ui-input.is-bad {
  border-color: rgba(185, 28, 28, 0.35);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

.ui-input.is-good {
  border-color: rgba(15, 118, 110, 0.28);
}

/* ============================================================
   App shell (header/nav/footer)
============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-bottom: 2px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
}

.app-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  pointer-events: none;
  background: var(--rainbow);
  opacity: 0.9;
}

.app-header__inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.app-brand__text {
  font-weight: 950;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: rgba(11, 18, 32, 0.92);
  font-weight: 900;
  font-size: 13px;
  line-height: 1;

  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid transparent;

  background: transparent;
  user-select: none;
}

.app-link:hover {
  border-color: rgba(11, 18, 32, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.app-link--muted {
  color: rgba(11, 18, 32, 0.55);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 12px;
  border-radius: 999px;

  background: var(--btn-bg);
  color: #fff;
  font-weight: 950;
  font-size: 13px;
  line-height: 1;

  border: 2px solid var(--btn-border);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.app-btn:hover {
  transform: translateY(-0.5px);
}

.app-logout-form {
  display: inline;
  margin: 0;
}

.app-link--btn {
  appearance: none;
  -webkit-appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: 2px solid transparent;
  border-radius: 999px;

  padding: 8px 10px;
  margin: 0;

  font: inherit;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;

  color: inherit;
  cursor: pointer;
}

.app-link--btn:focus {
  outline: none;
}

.app-link--btn:focus-visible {
  box-shadow: 0 0 0 4px var(--focus);
}

/* ============================================================
   Footer (FIXED)
============================================================ */

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 4px;
  margin: 0;
  

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(11, 18, 32, 0.1);
}

.app-footer__inner {
  width: min(var(--container), calc(100% - 28px));
  margin: 0 auto;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-footer__brand {
  font-weight: 950;
}

.app-footer__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--app-muted);
}

.app-footer__links {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   Mobile polish
============================================================ */

@media (max-width: 520px) {
  .app-nav {
    gap: 6px;
  }

  .app-link,
  .app-link--btn {
    padding: 7px 9px;
    font-family: var(--font-kid);
    font-size: 12px;
  }

  .app-btn {
    padding: 8px 10px;
    font-family: var(--font-kid);
    font-size: 12px;
  }

  .app-main {
    padding-bottom: calc(var(--footer-h) + 42px);
  }
}

/* ============================================================
   Avatar dropdown (kid-mode)
============================================================ */

.app-avatarwrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Same hover border behavior as app links */
.app-avatarbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;

  font-family: inherit;
  color: inherit;
  padding: 6px 10px;
  border-radius: 999px;

  transition: background 120ms ease, border-color 120ms ease,
    transform 120ms ease;
}

.app-avatarbtn:hover {
  border-color: rgba(11, 18, 32, 0.12);
  background: rgba(255, 255, 255, 0.62);
  transform: translateY(-0.5px);
}

.app-avatarbtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.app-avatarname {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.app-avatarmenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;

  min-width: 200px;
  padding: 6px;

  background: var(--glass-strong);
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 12px;

  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.app-avatarmenu__item {
  display: block;
  width: 100%;

  text-align: left;
  font-size: 14px;
  font-weight: 500;

  padding: 8px 10px;
  border-radius: 8px;

  color: #111;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;

  transition: background 120ms ease;
}

.app-avatarmenu__item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.app-avatarmenu__btn {
  font-family: inherit;
}

.app-avatarmenu__muted {
  color: rgba(0, 0, 0, 0.55);
}

.app-avatarmenu__sep {
  height: 1px;
  margin: 6px 0;
  background: rgba(0, 0, 0, 0.1);
}

.app-avatarmenu__form {
  margin: 0;
}

@media (max-width: 640px) {
  .app-avatarname {
    display: none;
  }
}

.app-avatarmenu {
  transform-origin: top right;
  animation: avatarMenuIn 120ms ease-out;
}

@keyframes avatarMenuIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Reusable Drawer (ui-drawer)
   - Right-side slide-in panel + overlay
============================================================ */

.ui-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(11, 18, 32, 0.35);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.ui-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, calc(100% - 44px));
  z-index: 1000;

  background: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(11, 18, 32, 0.12);

  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);

  transform: translateX(110%);
  transition: transform 180ms ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.ui-drawer__head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(11, 18, 32, 0.1);
  display: grid;
  gap: 6px;
}

.ui-drawer__title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.ui-drawer__sub {
  margin: 0;
  font-size: 12px;
  color: var(--app-muted);
}

.ui-drawer__body {
  padding: 14px;
  overflow: auto;
}

.ui-drawer__foot {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(11, 18, 32, 0.1);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* open state */
.ui-drawer-overlay.is-on {
  opacity: 1;
  pointer-events: auto;
}

.ui-drawer.is-on {
  transform: none;
}

/* prevent background scroll when drawer open */
body.is-drawer-open {
  overflow: hidden;
}

/* ============================================================
   Brainrot Toolbar + Chips + Pager (ONLY the knobs/filters)
   Put in: public/css/brainrot.css (loaded after global.css)
   Uses global tokens: --surface/--surface-2/--border/--focus/--shadow-*
============================================================ */

.br-shell {
  width: min(var(--sheet), calc(100% - 28px));
  margin: 0 auto;
}

/* Top controls (Generate + status) */
.br-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 12px auto 10px;
}

.br-btn {
  /* piggyback global button feel */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-border);

  background: var(--btn-bg);
  color: var(--btn-fg);

  font-weight: 950;
  cursor: pointer;

  box-shadow: var(--shadow-md);
  user-select: none;
}

.br-btn:hover {
  transform: translateY(-0.5px);
}

.br-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.br-status {
  /* mirror ui-status but keep class local */
  font-size: 13px;
  color: var(--app-muted);
  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid rgba(11, 18, 32, 0.1);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.br-status[data-kind="good"] {
  color: var(--good);
}
.br-status[data-kind="bad"] {
  color: var(--bad);
}

/* ============================================================
   Toolbar container
============================================================ */

.br-toolbar {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 14px;

  backdrop-filter: blur(14px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);

  display: grid;
  gap: 12px;

  margin: 8px auto 16px;
}

/* Rows + groups */
.br-toolbar__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.br-toolbar__row--pager {
  justify-content: center;
}

.br-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Section label (View/Sort/Filter) */
.br-toolbar__label {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.22px;
  text-transform: uppercase;
  color: rgba(11, 18, 32, 0.62);

  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(11, 18, 32, 0.08);
}

/* Chip containers */
.br-toolbar__chips {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* segmented group for View */
.br-toolbar__seg {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;

  border: 1px solid rgba(11, 18, 32, 0.12);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   Chips (buttons)
============================================================ */

.br-chip {
  appearance: none;
  -webkit-appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 11px;
  border-radius: 999px;

  border: 1px solid rgba(11, 18, 32, 0.14);
  background: rgba(255, 255, 255, 0.68);
  color: rgba(11, 18, 32, 0.92);

  font: inherit;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;

  cursor: pointer;
  user-select: none;

  transition: transform 120ms ease, background 120ms ease,
    border-color 120ms ease, box-shadow 120ms ease;
}

.br-chip:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(11, 18, 32, 0.18);
  transform: translateY(-0.5px);
}

.br-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.br-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Active state (your template uses .is-on) */
.br-chip.is-on {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(11, 18, 32, 0.22);
  box-shadow: 0 0 0 4px var(--focus);
  transform: none;
}

/* Tighten chips inside segmented control */
.br-toolbar__seg .br-chip {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.br-toolbar__seg .br-chip:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: none;
}

.br-toolbar__seg .br-chip.is-on {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px var(--focus);
}

/* Optional: give rarity chips a tiny “hint” tint while still subtle */
.br-chip[data-br-rarity="OG"] {
  box-shadow: inset 0 0 0 2px rgba(139, 92, 255, 0.12);
}
.br-chip[data-br-rarity="Mythic"] {
  box-shadow: inset 0 0 0 2px rgba(255, 79, 179, 0.12);
}
.br-chip[data-br-rarity="Legendary"] {
  box-shadow: inset 0 0 0 2px rgba(255, 176, 32, 0.14);
}
.br-chip[data-br-rarity="Epic"] {
  box-shadow: inset 0 0 0 2px rgba(34, 211, 255, 0.12);
}
.br-chip[data-br-rarity="Rare"] {
  box-shadow: inset 0 0 0 2px rgba(139, 92, 255, 0.1);
}
.br-chip[data-br-rarity="Uncommon"] {
  box-shadow: inset 0 0 0 2px rgba(34, 230, 168, 0.12);
}
.br-chip[data-br-rarity="Common"] {
  box-shadow: inset 0 0 0 2px rgba(11, 18, 32, 0.08);
}

/* Active rarity chip can keep its hint */
.br-chip.is-on[data-br-rarity] {
  box-shadow: 0 0 0 4px var(--focus), inset 0 0 0 2px rgba(11, 18, 32, 0.06);
}

/* ============================================================
   Pager
============================================================ */

.br-pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.br-pager__btn {
  appearance: none;
  -webkit-appearance: none;

  width: 38px;
  height: 38px;
  border-radius: 999px;

  border: 1px solid rgba(11, 18, 32, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(11, 18, 32, 0.92);

  display: grid;
  place-items: center;

  font: inherit;
  font-size: 14px;
  font-weight: 950;

  cursor: pointer;
  user-select: none;

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
  transition: transform 120ms ease, background 120ms ease,
    border-color 120ms ease, box-shadow 120ms ease;
}

.br-pager__btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(11, 18, 32, 0.18);
  transform: translateY(-0.5px);
}

.br-pager__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 10px 22px rgba(0, 0, 0, 0.1);
}

.br-pager__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.br-pager__meta {
  font-size: 13px;
  font-weight: 900;
  color: rgba(11, 18, 32, 0.78);

  padding: 8px 12px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(11, 18, 32, 0.1);
  backdrop-filter: blur(12px);
}

.br-pager__meta strong {
  font-weight: 950;
}

.br-pager__muted {
  color: rgba(11, 18, 32, 0.55);
  font-weight: 900;
}

/* Bottom pager spacing */
.br-pagerBottom {
  margin: 18px auto 24px;
}

/* ============================================================
   Mobile tweaks
============================================================ */

@media (max-width: 520px) {
  .br-toolbar {
    padding: 12px;
  }

  .br-chip {
    padding: 8px 10px;
    font-size: 12px;
  }

  .br-toolbar__label {
    font-size: 11px;
  }

  .br-pager__meta {
    font-size: 12px;
  }
}

/* ============================================================
   GoldRot pill (match app-link exactly)
============================================================ */

.app-goldrot {
  /* inherits .app-link sizing/hover; just add the inner layout */
  gap: 8px;
}

.app-goldrot__icon {
  font-size: 14px; /* match overall nav visual weight */
  line-height: 1;
}

.app-goldrot__value {
  font: inherit;
  font-weight: inherit;
  line-height: 1;
}

/* ============================================================
   Kid bottom tabs (footer nav)
============================================================ */

.app-footer--kid {
 
}

.app-footer--kid .app-footer__inner {
  align-items: center;
  justify-content: center;
}

.kid-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kid-tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;

  padding: 10px 10px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.55);

  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: transform 120ms ease, background 120ms ease,
    border-color 120ms ease;
}



.kid-tab:active {
  transform: translateY(0px);
}

.kid-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.kid-tab__icon {
  font-size: 20px;
  line-height: 1;
}

.kid-tab__label {
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  color: rgba(11, 18, 32, 0.84);
}

/* Put badge in top-right corner of the Messages tab */
.kid-tab__badge {
  position: absolute;
  top: 6px;
  right: 10px;
}

/* Optional: "active" styling (set via JS or server class) */
.kid-tab.is-active {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(11, 18, 32, 0.12);
  box-shadow: 0 0 0 4px var(--focus);
}

/* Tighten on tiny phones */
@media (max-width: 380px) {
  .kid-tab__icon {
    font-size: 18px;
  }
  .kid-tab__label {
    font-size: 11px;
  }
  .kid-tabs {
    gap: 8px;
  }
}
