html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.profile-dropdown-menu {
  max-height: 300px;
  overflow-y: auto;
}

.profile-dropdown-search-pin {
  position: sticky;
  top: 0;
  background-color: var(--bs-dropdown-bg, #fff);
  z-index: 1;
}

/* ---------- landing page ---------- */

:root {
  --sigil-accent-1: #f97316; /* orange */
  --sigil-accent-2: #facc15; /* yellow */
  --sigil-accent-1-rgb: 249, 115, 22;
  --sigil-accent-2-rgb: 250, 204, 21;
  --sigil-gradient: linear-gradient(135deg, var(--sigil-accent-1), var(--sigil-accent-2));

  /* the button redesign's own accent, sampled directly from the reference image (close to but not
     identical to --sigil-accent-1 above) - kept separate so it doesn't also change unrelated things
     like the nav underline or the premium gem. */
  --btn-accent: #fd9425;
  --btn-accent-rgb: 253, 148, 37;
  /* Measured directly from the reference image (button height vs. notch cut, both in raw pixels),
     as a ratio of font-size rather than a fixed px, so the cut scales correctly whether it's a
     small nav button or a large hero CTA - a fixed px was exactly what made "My Profile" oversized. */
  --btn-notch: 0.5em;
  --btn-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cpolyline points='13 5 20 12 13 19'/%3E%3C/svg%3E");
}

/* a genuinely dark page, not Bootstrap's default charcoal - the brand's own near-black. */
[data-bs-theme="dark"] {
  --bs-body-bg: #09080a;
  --bs-tertiary-bg: #131217;
  --bs-secondary-bg: #17161c;
  --bs-border-color: #2a2830;
}

.sigil-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.sigil-brand-text {
  background: var(--sigil-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.hero-mark {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 28px rgba(255, 122, 24, 0.45));
}

.hero-eyebrow {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* lets a section go edge to edge even though it sits in the .container */
.full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.hero {
  padding: 6rem 1rem 5rem;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.25), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(250, 204, 21, 0.18), transparent 50%),
    var(--bs-body-bg);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--sigil-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: var(--bs-secondary-color);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Two-column hero: text left, art right. Single column (art below) until desktop width. */
.hero-columns {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3rem;
}

@media (min-width: 992px) {
  .hero-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    text-align: left;
  }

  .hero-left .hero-mark {
    margin-left: 0;
  }

  .hero-left .hero-tagline {
    margin-left: 0;
  }

  .hero-left .hero-actions,
  .hero-left .hero-stats {
    justify-content: flex-start;
  }

  .hero-left .login-help p {
    margin-left: 0;
  }
}

.hero-right {
  display: flex;
  justify-content: center;
}

/* The "popping off the page" effect: a perspective container plus a tilted, glowing card. */
.hero-art {
  width: 100%;
  max-width: 38rem;
  perspective: 1600px;
}

.hero-art-image {
  display: block;
  width: 100%;
  /* matches the supplied illustration's own proportions (1901x907), so object-fit: cover only
     trims a little off the edges instead of cutting into the card panels either side */
  aspect-ratio: 2 / 1;
  border-radius: 1.5rem;
  object-fit: cover;
  transform: rotateY(-10deg) rotateX(6deg) rotateZ(1.5deg);
  box-shadow:
    0 45px 90px -35px rgba(var(--sigil-accent-1-rgb), 0.55),
    0 25px 55px -25px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .hero-art-image {
    transform: none;
  }
}

/* /EditEntrance */
.entrance-page {
  max-width: 52rem;
  margin: 0 auto;
}

.entrance-preview-figure {
  margin: 0 0 1.25rem;
}

.entrance-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.75rem;
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.6);
}

/* /EditReactions emoji grid, ticked ones get an accent outline */
.reactions-page {
  max-width: 52rem;
  margin: 0 auto;
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emoji-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.6rem;
  line-height: 1;
}

.emoji-choice:hover {
  background: rgba(255, 255, 255, 0.1);
}

.emoji-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.emoji-choice:has(input:checked) {
  border-color: var(--sigil-accent-1);
  background: rgba(var(--sigil-accent-1-rgb), 0.18);
}

.emoji-choice:has(input:focus-visible) {
  outline: 2px solid var(--sigil-accent-2);
  outline-offset: 2px;
}

.emoji-image {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

/* Log in / Log out button (inside the menu on phones) */
.navbar .nav-auth-btn {
  align-self: center;
  margin: 0.5rem 0 0.25rem;
  /* normal padding made the bar taller */
  padding: 0.4rem 1.1rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .navbar .nav-auth-btn {
    margin: 0 0 0 0.5rem;
  }
}

/* Nav links: an underline on hover/active, not a pill background. */
.site-nav {
  background: var(--bs-body-bg);
}

.nav-pills-row .nav-link {
  position: relative;
  padding: 0.4rem 0.2rem;
  margin: 0 0.6rem;
  font-family: "JetBrains Mono", monospace;
  color: #fff;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-pills-row .nav-link:hover,
.nav-pills-row .nav-link:focus-visible {
  color: #fff;
}

.nav-pills-row .nav-link.active {
  color: var(--sigil-accent-1);
  border-color: var(--sigil-accent-1);
}

/* counters */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-stat-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: var(--sigil-accent-1);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ff7a18, #ffd200);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stat-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* "Can't log in?" details, styled like a link */
.login-help summary {
  display: inline;
  cursor: pointer;
  list-style: none;
  color: var(--bs-link-color);
  text-decoration: underline;
}

.login-help summary::-webkit-details-marker {
  display: none;
}

.login-help[open] summary {
  margin-bottom: 0.5rem;
  display: block;
}

.login-help p {
  max-width: 32rem;
  margin: 0 auto;
}

/* All three share the same cut-corner silhouette and lettering; each variant below only sets its
   own colors. Quiet by default (charcoal surface, thin muted border) - the accent only shows up as
   a response to interaction (a thin line on the bottom edge, plus a sheen sweeping across), not as
   a constant glow. */
.btn-sigil,
.btn-sigil-outline,
.btn-sigil-danger {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  /* Derived, not guessed: rendered "CREATE PROFILE" in real JetBrains Mono Bold, measured its
     natural (zero-tracking) width, and compared that to the word's actual measured pixel width
     in the reference image. The gap between the two, spread over 13 letter-gaps, is this value. */
  letter-spacing: 0.36em;
  /* Not from the reference image (that's a fixed-scale mockup, not a proportion to this site's own
     body text) - a direct, modest reduction in response to "still a bit too big". */
  font-size: 0.7rem;
  border-radius: 0;
  clip-path: polygon(
    var(--btn-notch) 0, 100% 0, 100% calc(100% - var(--btn-notch)),
    calc(100% - var(--btn-notch)) 100%, 0 100%, 0 var(--btn-notch)
  );
}

/* the reference's primary button pins its arrow to the far edge, with a wide gap - not tight
   against the text - so it needs its own two ends pushed apart rather than centered as a group. */
.btn-sigil:not(.card-menu-toggle) {
  justify-content: space-between;
}

/* the diagonal sheen: a soft light band, off to the left at rest, that sweeps across on hover.
   ::before is free on all three variants (the arrow below uses ::after). */
.btn-sigil::before,
.btn-sigil-outline::before,
.btn-sigil-danger::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

.btn-sigil:hover::before,
.btn-sigil-outline:hover::before,
.btn-sigil-danger:hover::before {
  left: 130%;
}

.btn-sigil {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 55%), var(--bs-secondary-bg);
  border: 1.5px solid rgba(var(--btn-accent-rgb), 0.22);
  color: var(--btn-accent);
  font-weight: 700;
  padding: 1.3em 2em;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.btn-sigil:hover,
.btn-sigil:focus-visible {
  border-color: rgba(var(--btn-accent-rgb), 0.35);
  border-bottom-color: var(--btn-accent);
  color: #fff;
}

/* the reference's primary button has a trailing arrow; nothing else needs one, including this same
   class used as the icon-only card-menu button (.card-menu-toggle::after already turns this off). */
.btn-sigil:not(.card-menu-toggle)::after {
  content: "";
  width: 1.1em;
  height: 1.1em;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--btn-arrow) no-repeat center / contain;
  mask: var(--btn-arrow) no-repeat center / contain;
}

.btn-sigil-outline {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 55%), var(--bs-secondary-bg);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  padding: 1.3em 2em;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.btn-sigil-outline:hover,
.btn-sigil-outline:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* delete / remove buttons */
.btn-sigil-danger {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 55%), var(--bs-secondary-bg);
  border: 1.5px solid rgba(var(--bs-danger-rgb), 0.3);
  color: var(--bs-danger);
  font-weight: 600;
  padding: 1.3em 2em;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.btn-sigil-danger:hover,
.btn-sigil-danger:focus-visible {
  border-color: rgba(var(--bs-danger-rgb), 0.5);
  border-bottom-color: var(--bs-danger);
  color: #fff;
}

/* tighter row of buttons above a card (Friends, the options gear, moderator tools) reads as a
   toolbar, not a page-level call to action, so it gets its own smaller size - both a smaller font
   and tighter padding, since the padding ratio measured off the large reference button was too
   generous to also carry over to a compact toolbar. */
.btn-sigil.btn-sm,
.btn-sigil-outline.btn-sm,
.btn-sigil-danger.btn-sm {
  font-size: 0.5rem;
  padding: 0.9em 1.4em;
}

/* the one icon button above a card that expands into Edit profile / Edit card */
.card-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  padding: 0;
}

.card-menu-toggle::after {
  display: none;
}

.card-menu-icon {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.premium-badge {
  color: #14100a;
  background: linear-gradient(135deg, #ff7a18, #ffd200);
  font-weight: 700;
  vertical-align: middle;
}

/* opacity preview, busy backdrop so the fade is easy to see */
.opacity-value {
  min-width: 3.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.opacity-sample-backdrop {
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f97316, #ec4899 45%, #6366f1);
}

.opacity-sample {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  background: color-mix(in srgb, var(--bs-body-bg) calc(var(--tile-opacity, 100) * 1%), transparent);
}

.edit-background-preview {
  display: block;
  max-width: 100%;
  max-height: 10rem;
  border-radius: 0.6rem;
}

/* With several presets, each one's background gets its own panel. */
.preset-background-many {
  padding: 0.9rem 1rem;
  margin-top: 0.9rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.8rem;
}

.preset-background-title {
  margin-bottom: 0.75rem;
}

.font-sample {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
}

.how-it-works {
  padding: 5rem 1rem;
}

.step-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--sigil-gradient);
  color: #14100a;
}

.step-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(var(--sigil-accent-1-rgb), 0.5);
  background: rgba(var(--sigil-accent-1-rgb), 0.08);
}

.step-icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--sigil-accent-1);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-heading {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* ---- Featured cards (home page) ---- */
.featured {
  padding: 2rem 1rem 3rem;
}

.featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .featured-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 3rem;
  }
}

.featured-text .btn {
  margin-top: 0.5rem;
}

.featured-carousel {
  position: relative;
  min-width: 0;
}

/* several cards visible at once, scrolling horizontally; snap keeps them settled on a card. */
.featured-stage {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.25rem 0.1rem 1rem;
  scrollbar-width: thin;
}

.featured-slide {
  flex: 0 0 auto;
  width: min(78vw, 15rem);
  margin: 0;
  scroll-snap-align: start;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 1rem;
  border: 1.5px solid rgba(var(--sigil-accent-2-rgb), 0.55);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 22px -6px rgba(var(--sigil-accent-1-rgb), 0.6), 0 16px 40px -24px rgba(0, 0, 0, 0.6);
}

.featured-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the arrows only show once featured.js confirms it's running */
.featured-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.15rem;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.4);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}

.featured-arrow:hover,
.featured-arrow:focus-visible {
  background: rgba(0, 0, 0, 0.8);
}

.featured-prev { left: -0.75rem; }
.featured-next { right: -0.75rem; }

.featured-carousel.is-ready .featured-arrow {
  display: flex;
}

.featured-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 1.5rem;
  text-align: center;
  color: var(--bs-secondary-color);
  border: 2px dashed rgba(var(--sigil-accent-2-rgb), 0.35);
  border-radius: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .featured-stage {
    scroll-behavior: auto;
  }
}

/* landing page: What's New panel */
.whats-new {
  padding: 2rem 1rem 3rem;
  max-width: 64rem;
  margin: 0 auto;
}

.whats-new-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.whats-new-header .section-heading {
  margin-bottom: 0;
}

.whats-new-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.whats-new-post {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(var(--sigil-accent-2-rgb), 0.3);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.whats-new-offer {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.55);
  box-shadow: 0 0 22px -10px rgba(var(--sigil-accent-1-rgb), 0.6);
}

.whats-new-image {
  flex: 0 0 auto;
  width: 7rem;
  height: 7rem;
  object-fit: cover;
  border-radius: 0.75rem;
}

.whats-new-body {
  min-width: 0;
}

.whats-new-kind {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 0.25rem;
}

.whats-new-offer .whats-new-kind {
  color: rgb(var(--sigil-accent-1-rgb));
}

.whats-new-post-title {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.whats-new-post p {
  margin-bottom: 0.35rem;
}

.whats-new-date {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.whats-new-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--bs-secondary-color);
  border: 2px dashed rgba(var(--sigil-accent-2-rgb), 0.35);
  border-radius: 1rem;
}

@media (max-width: 575.98px) {
  .whats-new-post {
    flex-direction: column;
  }

  .whats-new-image {
    width: 100%;
    height: 10rem;
  }
}

/* /Admin/WhatsNew */
.admin-whatsnew {
  max-width: 52rem;
  margin: 0 auto;
}

.whatsnew-add {
  margin: 1.25rem 0 2rem;
  padding: 1rem;
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.25);
  border-radius: 0.75rem;
}

.whatsnew-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.whatsnew-admin-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.25);
  border-radius: 0.75rem;
}

.whatsnew-admin-thumb {
  flex: 0 0 auto;
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

.whatsnew-admin-body {
  flex: 1 1 auto;
  min-width: 0;
}

.whatsnew-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.whatsnew-admin-actions form {
  margin: 0;
}

/* /Premium */
.premium-page {
  max-width: 64rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.premium-hero {
  text-align: center;
  padding: 2rem 1rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(var(--sigil-accent-1-rgb), 0.3);
  border-radius: 1.1rem;
  background: radial-gradient(ellipse at top, rgba(var(--sigil-accent-1-rgb), 0.16), transparent 70%), var(--bs-tertiary-bg);
}

.premium-hero-gem {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--sigil-accent-2);
  filter: drop-shadow(0 0 18px rgba(var(--sigil-accent-1-rgb), 0.55));
}

.premium-hero-title {
  margin: 0.4rem 0 0.25rem;
  font-weight: 800;
  background: var(--sigil-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.premium-hero-lead {
  max-width: 34rem;
  margin: 0 auto 0.75rem;
  color: var(--bs-secondary-color);
}

.premium-hero-price {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.premium-hero-price strong {
  font-size: 1.6rem;
}

.premium-hero-price span {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.premium-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.premium-feature {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.9rem;
  background: var(--bs-tertiary-bg);
}

/* what a Premium member already has gets a warmer edge */
.premium-feature.is-unlocked {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.45);
}

.premium-feature-soon {
  border-style: dashed;
}

.premium-feature-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  color: var(--sigil-accent-1);
  background: rgba(var(--sigil-accent-1-rgb), 0.15);
}

.premium-feature-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.premium-feature h3 {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  font-weight: 700;
}

.premium-feature p {
  flex: 1;
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.premium-feature a {
  font-size: 0.85rem;
}

/* /Admin/Dashboard */
.dashboard-page {
  max-width: 64rem;
  margin: 0 auto;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}

.dash-stat {
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-tertiary-bg);
}

.dash-stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.dash-stat-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.dash-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex: 1 1 16rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-tertiary-bg);
}

.dash-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.dash-search .form-control {
  flex: 1 1 14rem;
  max-width: 22rem;
}

.dash-table td,
.dash-table th {
  white-space: nowrap;
}

.dash-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

/* /Admin/Featured */
.admin-featured {
  max-width: 52rem;
  margin: 0 auto;
}

.featured-add {
  margin: 1.25rem 0;
}

.featured-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.featured-add-row .form-control {
  flex: 1 1 16rem;
}

.featured-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.featured-admin-item {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.25);
  border-radius: 0.75rem;
}

.featured-admin-thumb {
  display: block;
  width: 12rem;
  max-width: 100%;
  height: 7.5rem;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.5rem;
}

.featured-admin-body {
  flex: 1 1 16rem;
  min-width: 0;
}

.featured-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.featured-admin-actions form {
  margin: 0;
}

.featured-replace {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.featured-replace .form-control {
  flex: 1 1 12rem;
}

.admin-prompts {
  max-width: 52rem;
  margin: 0 auto;
}

.prompt-kind-section {
  margin: 1.75rem 0;
  padding: 1rem;
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.25);
  border-radius: 0.75rem;
}

.prompt-add textarea {
  resize: vertical;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.prompt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.15);
  border-radius: 0.5rem;
}

.prompt-item form {
  margin: 0;
  flex: 0 0 auto;
}

.categories-showcase {
  padding: 2rem 1rem 5rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 2rem;
}

.category-pill {
  border: 1px solid rgba(var(--sigil-accent-2-rgb), 0.35);
  color: var(--bs-body-color);
  padding: 0.4rem 1.1rem;
  border-radius: 50rem;
  font-size: 0.95rem;
  background: rgba(var(--sigil-accent-1-rgb), 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.category-pill:hover {
  border-color: var(--sigil-accent-1);
  background: rgba(var(--sigil-accent-1-rgb), 0.16);
}

.final-cta {
  padding: 5rem 1rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(var(--sigil-accent-1-rgb), 0.14), transparent 65%),
    linear-gradient(180deg, transparent, rgba(249, 115, 22, 0.08));
  border-top: 1px solid rgba(250, 204, 21, 0.15);
}

/* ---------- profile box contents (the boxes are in card.css) ---------- */

/* a thin accent-tinted ring, not the old solid gradient disc - the cinematic look keeps the
   picture itself as the focal point rather than wrapping it in a bright band of colour. */
.profile-avatar-ring {
  display: inline-block;
  position: relative;
  padding: 3px;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: rgba(var(--sigil-accent-1-rgb), 0.5);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6);
}

.profile-avatar {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(8, 8, 10, 0.9);
}

.profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #14100a;
  background: var(--sigil-gradient);
}

.profile-username {
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-handle {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.profile-bio {
  white-space: pre-line;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 32ch;
}

.profile-category-group {
  margin-bottom: 1.5rem;
}

.profile-category-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.5rem;
  display: block;
}

.profile-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bs-secondary-color);
}

/* ---------- edit profile sidebar shell ---------- */

.edit-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .edit-shell {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
}

.edit-sidebar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  position: static;
}

@media (min-width: 768px) {
  .edit-sidebar {
    flex-direction: column;
    position: sticky;
    top: 1rem;
  }
}

.edit-sidebar-link {
  text-align: left;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--bs-body-color);
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.edit-sidebar-link:hover {
  background: rgba(var(--sigil-accent-1-rgb), 0.1);
}

.edit-sidebar-link.active {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.4);
  background: rgba(var(--sigil-accent-1-rgb), 0.14);
  color: var(--sigil-accent-2);
}

.edit-content {
  min-width: 0;
}

.permission-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.permission-toggle {
  padding: 1.75rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(250, 204, 21, 0.25);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.05), transparent 35%), var(--bs-body-bg);
}

/* ---------- edit profile sections ---------- */

.edit-section-box {
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(250, 204, 21, 0.25);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.05), transparent 35%), var(--bs-body-bg);
}

.edit-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.edit-section-subtitle {
  margin-bottom: 1.5rem;
}

/* keeps the space so nothing jumps when "No avatar" hides the preview */
.avatar-preview-slot {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.edit-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.edit-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #14100a;
  background: var(--sigil-gradient);
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  position: relative;
}

/* radio is hidden, the coloured chip is what you click */
.theme-swatch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.theme-swatch-chip {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  transition: transform 0.15s ease, outline-color 0.15s ease;
  outline: 3px solid transparent;
  outline-offset: 3px;
}

.theme-swatch:hover .theme-swatch-chip {
  transform: scale(1.08);
}

.theme-swatch input:checked + .theme-swatch-chip {
  outline-color: var(--bs-body-color);
}

.theme-swatch input:focus-visible + .theme-swatch-chip {
  outline-color: var(--sigil-accent-1);
}

/* "None" choice, empty box with a slash */
.background-none-chip {
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, 0.12) 6px 8px);
}

.theme-swatch-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

/* ---------- Free / Premium plans ---------- */

.plans {
  padding: 4rem 1rem;
}

.plans-lead {
  max-width: 38rem;
  margin: 0 auto 2.5rem;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 1.25rem;
  overflow: hidden;
}

.plan-free {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.plan-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.plan-price {
  margin-bottom: 0.75rem;
}

.plan-amount {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.plan-per {
  color: var(--bs-secondary-color);
}

.plan-tagline {
  color: var(--bs-secondary-color);
  min-height: 3rem;
}

.plan-includes {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.plan-features li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.75rem;
}

.plan-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.3rem;
  font-weight: 800;
  color: var(--sigil-accent-1);
}

.plan-feature-soft {
  color: var(--bs-secondary-color);
  font-style: italic;
}

.plan-btn {
  margin-top: auto;
  width: 100%;
  cursor: default;
}

/* buttons don't do anything yet so no hover effect */
.plan-btn:hover,
.plan-btn:focus-visible {
  transform: none;
  box-shadow: none;
}

/* Premium: shimmering gold/pink border, glow, a few sparks */
.plan-premium-wrap {
  position: relative;
  padding: 2px;
  border-radius: 1.4rem;
  background: linear-gradient(120deg, #ff7a18, #ffd200, #ff4d9d, #ffd200, #ff7a18);
  background-size: 300% 300%;
  animation: plan-shimmer 7s ease-in-out infinite;
  box-shadow: 0 0 60px -14px rgba(255, 122, 24, 0.6), 0 0 120px -34px rgba(255, 77, 157, 0.5);
}

@media (min-width: 992px) {
  .plan-premium-wrap {
    transform: translateY(-0.6rem);
  }
}

.plan-premium {
  height: 100%;
  border-radius: calc(1.4rem - 2px);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 122, 24, 0.24), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(255, 77, 157, 0.2), transparent 50%),
    #18120d;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.plan-premium .plan-name {
  background: linear-gradient(135deg, #ffb347, #ffe066 55%, #ff8fbf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.plan-gem {
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  color: #ffd76a;
  filter: drop-shadow(0 0 8px rgba(255, 180, 60, 0.7));
}

.plan-price-premium .plan-amount {
  background: linear-gradient(120deg, #fff1b8 20%, #ffd200 45%, #ff9d4d 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: plan-sheen 5s linear infinite;
}

.plan-premium .plan-features li::before {
  color: #ffd76a;
  text-shadow: 0 0 10px rgba(255, 190, 70, 0.6);
}

.plan-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff3c4;
  border-radius: 1px;
  transform: rotate(45deg);
  box-shadow: 0 0 10px 2px rgba(255, 214, 120, 0.8);
  opacity: 0;
  animation: plan-twinkle 4s ease-in-out infinite;
  pointer-events: none;
}

.spark-1 { top: 14%; right: 12%; animation-delay: 0s; }
.spark-2 { top: 42%; right: 6%; animation-delay: 1.3s; width: 4px; height: 4px; }
.spark-3 { bottom: 22%; left: 8%; animation-delay: 2.4s; width: 5px; height: 5px; }
.spark-4 { top: 8%; left: 44%; animation-delay: 3.1s; width: 4px; height: 4px; }

@keyframes plan-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes plan-sheen {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

@keyframes plan-twinkle {
  0%, 100% { opacity: 0; transform: rotate(45deg) scale(0.4); }
  50% { opacity: 1; transform: rotate(45deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .plan-premium-wrap,
  .plan-price-premium .plan-amount,
  .plan-spark {
    animation: none;
  }

  .plan-spark {
    opacity: 0.7;
  }
}

.plans-note {
  margin-top: 1.5rem;
}

/* ---------- Guide page ---------- */

.guide-page {
  max-width: 48rem;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.guide-page h2 {
  scroll-margin-top: 1rem;
}

.guide-toc {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-tertiary-bg);
}

.guide-toc ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  columns: 2 14rem;
}

.guide-toc li {
  padding: 0.15rem 0;
}

.guide-list dt {
  margin-top: 0.9rem;
  font-weight: 700;
}

.guide-list dd {
  margin: 0.15rem 0 0;
  color: var(--bs-secondary-color);
}

.guide-commands code {
  font-size: 1rem;
}
