      @import url("https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@600&family=Lekton:ital,wght@0,400;0,700;1,400&display=swap");

      :root {
        --bg: #0a0a0a;
        /* The deepest surface: footer, the CITY / MOB CITY bands, the bottom of
           the hero fade. Every theme sets its own so these never go pure black
           on a light or mid-dark theme. */
        --bg-deep: #000000;
        --fg: #ffffff;
        --border: rgba(255, 255, 255, 0.25);
        --accent: #ff1f3d;
        --muted: rgba(255, 255, 255, 0.7);
        /* Body / UI: Lekton, a humanist mono that keeps the terminal feel. */
        --font: "Lekton", "JetBrains Mono", "IBM Plex Mono", monospace;
        /* Used ONLY for the "BOSSx" wordmark in the header and the big BOSSx
           badge on the homepage. Everything else stays on --font (Lekton) for
           the terminal feel. */
        --font-display: "Azeret Mono", "Lekton", monospace;

        --ease: cubic-bezier(0.16, 1, 0.3, 1);
        --panel-glow: color-mix(in oklab, var(--accent) 22%, transparent);
        --footer-space: 112px;
      }

      html,
      body {
        height: 100%;
      }

      body {
        margin: 0;
        background: var(--bg);
        color: var(--fg);
        font-family: var(--font);
        /* Lekton runs small, so nudge the whole site up a touch for legibility. */
        font-size: 16px;
        line-height: 1.55;
      }

      a {
        color: inherit;
        text-decoration: none;
      }

      .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 16px;
      }

      /* ================= HEADER ================= */

      .header {
        position: sticky;
        top: 0;
        z-index: 50;
        backdrop-filter: blur(6px);
        background: color-mix(in oklab, var(--bg) 85%, black);
        border-bottom: 1px solid var(--border);
        padding: 0 20px; /* breathing room at both viewport edges */
      }

      .header-inner.container {
        max-width: none;
        margin: 0;
        padding: 16px 0; /* header height; the .container rule wins over .header-inner */
        width: 100%;
      }

      .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative; /* anchors absolute children */
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 12px; /* tight lockup: logo sits right next to the wordmark */
      }

      .logo {
        width: 46px;
        height: 46px;
        object-fit: contain;
        display: block;
      }

      .brand-title {
        font-family: var(--font-display);
        letter-spacing: 0.04em;
        font-weight: 600;
        font-size: 1.95rem;
        line-height: 1;
        display: inline-block;
      }

      .brand-title .x {
        font-size: 1.05em;
      }

      /* The hamburger wrapper flows in the flex row now; no absolute pinning. */
      .header-inner > div[style] {
        position: relative;
        z-index: 60;
      }

      /* Ensure the hamburger itself doesn't affect layout flow */
      .header-inner #hamburger {
        margin: 0;
      }

      .brand-title .x {
        color: var(--accent);
      }

      /* ================= HAMBURGER ================= */

      .hamburger {
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        color: var(--fg);
        border-radius: 6px;
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: background 160ms var(--ease);
      }

      .hamburger:hover,
      .hamburger:focus-visible {
        outline: none;
        background: color-mix(in oklab, var(--bg) 88%, var(--accent));
      }

      .bars {
        width: 20px;
        height: 14px;
        position: relative;
      }

      .bars::before,
      .bars::after,
      .bars span {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--fg);
        transition:
          transform 200ms var(--ease),
          opacity 140ms var(--ease),
          top 200ms var(--ease),
          bottom 200ms var(--ease);
      }

      .bars::before {
        top: 0;
      }
      .bars span {
        top: 6px;
      }
      .bars::after {
        bottom: 0;
      }

      /* Bars fold into an X while the menu is open. */
      .hamburger.is-open {
        background: color-mix(in oklab, var(--bg) 88%, var(--accent));
      }
      .hamburger.is-open .bars::before {
        top: 6px;
        transform: rotate(45deg);
      }
      .hamburger.is-open .bars span {
        opacity: 0;
      }
      .hamburger.is-open .bars::after {
        bottom: 6px;
        transform: rotate(-45deg);
      }

      /* ================= MENU PANEL ================= */

      .menu-panel {
        position: absolute;
        right: 0;
        top: calc(100% + 14px);
        width: 240px;
        background: color-mix(in oklab, var(--bg) 97%, black);
        border: 1px solid var(--border);
        border-top: 2px solid var(--accent);
        border-radius: 6px;
        box-shadow: 0 20px 46px rgba(0, 0, 0, 0.6);
        padding: 6px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition:
          opacity 160ms var(--ease),
          transform 160ms var(--ease),
          visibility 160ms var(--ease);
      }

      .menu-panel.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }

      .menu-group {
        display: flex;
        flex-direction: column;
      }

      .menu-item {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 14px;
        border-radius: 4px;
        background: transparent;
        border: none;
        color: var(--fg);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: var(--font);
        font-size: 15px;
        text-decoration: none;
        box-shadow: inset 0 0 0 0 var(--accent);
        transition:
          background 140ms var(--ease),
          box-shadow 140ms var(--ease);
      }

      .menu-item:hover {
        background: color-mix(in oklab, var(--bg) 84%, var(--accent));
        box-shadow: inset 3px 0 0 0 var(--accent);
      }

      /* The trailing arrow glyph on every menu item ("Login <span>&#8599;</span>",
         "Theme <span>&#9656;</span>", etc.) - dropped site-wide from here so
         every header/page markup copy doesn't need editing individually. */
      .menu-item > span {
        display: none;
      }

      /* ===== AUTH (sign in with Discord/GitHub) ===== */

      .auth-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
      }

      .auth-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
      }

      #authUsername {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      /* ===== ACCOUNT DROPDOWN (header, left of the hamburger) ===== */

      .acct-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 12px 0 6px;
        border-radius: 12px;
        border: none;
        background: transparent;
        color: var(--fg);
        cursor: pointer;
        font-family: var(--font);
        transition: background 160ms var(--ease);
      }

      .acct-toggle:hover,
      .acct-toggle:focus-visible {
        outline: none;
        background: color-mix(in oklab, var(--bg) 88%, var(--fg));
      }

      .acct-avatar {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background-color: var(--accent);
        background-size: cover;
        background-position: center;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: 12px;
        font-family: var(--font);
      }

      .acct-avatar-lg {
        width: 28px;
        height: 28px;
        font-size: 13px;
      }

      .acct-username {
        font-size: 14px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      #acctUsernameBig {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      /* ===== THEME SUB-PANEL ===== */
      /* Floats out to the left of the main menu, offset down a little so it
         reads as a diagonal branch. Animates in and out. */

      .submenu {
        position: absolute;
        right: calc(100% + 12px);
        top: 46px;
        width: 190px;
        background: color-mix(in oklab, var(--bg) 97%, black);
        border: 1px solid var(--border);
        border-top: 2px solid var(--accent);
        border-radius: 6px;
        box-shadow: 0 20px 46px rgba(0, 0, 0, 0.6);
        padding: 6px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(10px);
        transition:
          opacity 170ms var(--ease),
          transform 170ms var(--ease),
          visibility 170ms var(--ease);
      }

      .submenu.open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
      }

      .submenu button {
        width: 100%;
        padding: 10px 12px;
        border-radius: 4px;
        position: relative;
        background: transparent;
        border: none;
        color: var(--muted);
        text-align: left;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        font-family: var(--font);
        font-size: 14px;
        transition:
          color 140ms var(--ease),
          background 140ms var(--ease);
      }

      .submenu button:hover {
        color: var(--fg);
        background: color-mix(in oklab, var(--bg) 88%, var(--accent));
      }

      .check {
        display: none;
      }

      /* Active theme: accent text plus a red bar down the left edge. */
      .submenu button.active {
        color: var(--accent);
        font-weight: 700;
        box-shadow: inset 3px 0 0 0 var(--accent);
      }

      /* Not enough room to fly out sideways on a phone: drop back to expanding
         inline underneath the Theme row. */
      @media (max-width: 560px) {
        .submenu {
          position: static;
          width: auto;
          border: none;
          border-top: 1px solid var(--border);
          border-radius: 0;
          box-shadow: none;
          margin-top: 4px;
          padding: 4px 0 0;
          transform: none;
          transition: none;
          display: none;
        }
        .submenu.open {
          display: block;
          transform: none;
        }
      }

      /* ================= HERO ================= */

      .hero {
        position: relative;
        min-height: 80vh;
        /* The drifting glow layer below scales and translates past the right
           edge; clip it so it never adds horizontal page scroll. */
        overflow: hidden;
      }

      @media (min-width: 1024px) {
        .hero {
          min-height: 90vh;
        }
      }

      .hero-fallback {
        position: absolute;
        inset: 0;
        background:
          radial-gradient(
            1200px 400px at 50% 0%,
            color-mix(in oklab, var(--accent) 35%, transparent),
            transparent
          ),
          linear-gradient(180deg, var(--bg), var(--bg-deep));
      }

      .hero-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 22px;
        padding: 36px 16px;
      }

      .hero-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 16px 28px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: color-mix(in oklab, var(--bg) 40%, black);
      }

      .hero-title {
        font-family: var(--font-display);
        font-weight: 600;
        font-size: clamp(28px, 4vw, 48px);
        letter-spacing: 0.06em;
        line-height: 1;
      }

      /* =========================
   HERO THEME PULSE (RESTORED) + CONTINUOUS GLIMMER
   ========================= */

      .hero::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0.06; /* gentle base glow */
        background: radial-gradient(
          900px 300px at 50% 10%,
          color-mix(in oklab, var(--accent) 55%, transparent),
          transparent
        );
        transform: translateZ(0);
        animation: heroGlimmerDrift 12s ease-in-out infinite;
      }

      /* Keep the existing quick pulse on demand while preserving the continuous glimmer */
      .hero.pulse::after {
        animation:
          heroPulse 900ms ease-out,
          heroGlimmerDrift 12s ease-in-out infinite;
      }

      @keyframes heroGlimmerDrift {
        0% {
          opacity: 0.05;
          transform: translateX(0) translateY(0) scale(0.98);
        }
        25% {
          opacity: 0.28;
          transform: translateX(6px) translateY(-6px) scale(1.02);
        }
        50% {
          opacity: 0.12;
          transform: translateX(-6px) translateY(6px) scale(1.01);
        }
        75% {
          opacity: 0.3;
          transform: translateX(6px) translateY(-3px) scale(1.03);
        }
        100% {
          opacity: 0.05;
          transform: translateX(0) translateY(0) scale(0.98);
        }
      }

      @keyframes heroPulse {
        0% {
          opacity: 0;
          transform: scale(0.9);
        }
        30% {
          opacity: 0.8;
        }
        100% {
          opacity: 0;
          transform: scale(1.15);
        }
      }

      .x {
        color: var(--accent);
        animation: pulse 1s ease-in-out infinite;
      }

      @keyframes pulse {
        50% {
          opacity: 0.4;
        }
      }

      @keyframes chevBlink {
        0% {
          opacity: 1;
        }
        40% {
          opacity: 0.15;
        }
        80% {
          opacity: 1;
        }
        100% {
          opacity: 1;
        }
      }

      /* ================= CITY INTRO ================= */

      .city-intro {
        position: relative;
        overflow: hidden;
        min-height: 600px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 100px 0;
        background: var(--bg-deep);
        text-align: center;
      }

      .city-intro-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        background: radial-gradient(
          850px 500px at 50% 50%,
          rgba(0, 104, 255, 0.32),
          transparent 70%
        );
      }

      .city-intro-content {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
      }

      .city-intro-logo {
        width: 72px;
        height: 72px;
        border-radius: 16px;
      }

      .city-intro-content h2 {
        margin: 0;
        font-size: clamp(22px, 3.5vw, 34px);
      }

      .city-intro-content p {
        max-width: 520px;
        margin: 0;
        color: var(--muted);
      }

      .city-intro-btn {
        margin-top: 8px;
        display: inline-block;
        padding: 12px 28px;
        border-radius: 8px;
        background: #0068ff;
        color: #fff;
        font-weight: 600;
        font-family: var(--font);
        transition:
          background 160ms var(--ease),
          transform 160ms var(--ease);
      }

      .city-intro-btn:hover {
        background: #0058d6;
        transform: translateY(-1px);
      }

      /* ================= MOB CITY INTRO (same layout as CITY intro above) ================= */

      .mobcity-intro {
        position: relative;
        overflow: hidden;
        min-height: 600px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 100px 0;
        background: var(--bg-deep);
        text-align: center;
      }

      .mobcity-intro-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        background: radial-gradient(
          850px 500px at 50% 50%,
          color-mix(in oklab, var(--accent) 32%, transparent),
          transparent 70%
        );
      }

      .mobcity-intro-content {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
      }

      .mobcity-intro-logo {
        width: 116px;
        height: 116px;
        border-radius: 22px;
      }

      .mobcity-intro-content h2 {
        margin: 0;
        font-size: clamp(22px, 3.5vw, 34px);
      }

      .mobcity-intro-content p {
        max-width: 520px;
        margin: 0;
        color: var(--muted);
      }

      .mobcity-intro-btn {
        margin-top: 8px;
        display: inline-block;
        padding: 12px 28px;
        border-radius: 8px;
        background: var(--accent);
        color: #fff;
        font-weight: 600;
        font-family: var(--font);
        transition:
          background 160ms var(--ease),
          transform 160ms var(--ease);
      }

      .mobcity-intro-btn:hover {
        background: color-mix(in oklab, var(--accent) 82%, black);
        transform: translateY(-1px);
      }

      /* ================= SECTIONS ================= */

      .section {
        padding: 56px 0;
        margin-top: 16px;
      }

      .grid {
        display: grid;
        gap: 16px;
      }

      @media (min-width: 768px) {
        .grid {
          grid-template-columns: repeat(2, 1fr);
        }
      }

      @media (min-width: 1024px) {
        .grid {
          grid-template-columns: repeat(3, 1fr);
        }
      }

      /* ================= PANELS ================= */

      .panel {
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        background: color-mix(
          in oklab,
          var(--bg) 92%,
          black
        ); /* solid, not transparent */
        box-shadow: none;
        overflow: hidden;
        position: relative;
        transition:
          transform 0.25s var(--ease),
          box-shadow 320ms var(--ease);
        min-height: 420px; /* consistent panel height */
        display: flex;
        flex-direction: column;
      }

      .panel::after {
        content: "";
        position: absolute;
        inset: 0;
        background: none; /* removed glow for seamless layout */
        pointer-events: none;
        display: none;
      }

      .panel:hover {
        transform: translateY(-6px); /* subtle uplift */
      }

      /* ensure list area scrolls if content overflows */
      .panel .list {
        overflow: auto;
        flex: 1;
        padding-bottom: 12px;
      }

      /* ===== Carousel (panels as rotating selection) ===== */
      .hero-content.container {
        width: 100%;
        min-width: 0;
      }

      .carousel {
        position: relative;
        display: flex;
        align-items: center;
        gap: 18px;
        width: 100%;
        min-width: 0;
      }

      .carousel-viewport {
        overflow: hidden;
        width: 100%;
        min-width: 0;
      }

      .carousel-track {
        display: flex;
        gap: 22px;
        align-items: stretch;
        transition: transform 520ms var(--ease);
        will-change: transform;
        padding: 22px 0;
        touch-action: pan-y; /* allow vertical scroll while using horizontal pointer handling */
      }

      .carousel-item {
        min-width: 520px;
        flex: 0 0 520px;
        display: flex;
        justify-content: center;
        align-items: stretch;
        transition:
          box-shadow 320ms var(--ease),
          transform 320ms var(--ease);
        opacity: 1;
        transform: none;
        cursor: grab;
      }

      .carousel-item:focus {
        outline: 2px solid color-mix(in oklab, var(--accent) 35%, transparent);
      }

      .carousel-item .panel {
        width: 100%;
        height: 100%;
        border-radius: 12px;
      }

      .carousel-item.active .panel {
        box-shadow:
          0 18px 48px color-mix(in oklab, var(--accent) 22%, transparent),
          0 0 0 1px color-mix(in oklab, var(--accent) 28%, transparent);
      }

      .carousel-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: color-mix(in oklab, var(--bg) 86%, black);
        border: 1px solid var(--border);
        color: var(--fg);
        width: 44px;
        height: 44px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        cursor: pointer;
        z-index: 20;
        opacity: 0.95;
        backdrop-filter: blur(6px);
        font-size: 22px;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        transition:
          background 160ms var(--ease),
          color 160ms var(--ease),
          border-color 160ms var(--ease),
          box-shadow 160ms var(--ease),
          transform 160ms var(--ease);
      }

      .carousel-arrow:hover,
      .carousel-arrow:focus {
        background: color-mix(in oklab, var(--bg) 78%, var(--accent));
        border-color: var(--accent);
        color: var(--accent);
        outline: none;
        transform: translateY(-50%) scale(1.08);
        box-shadow: 0 10px 26px color-mix(in oklab, var(--accent) 35%, transparent);
      }

      .carousel-arrow:active {
        transform: translateY(-50%) scale(0.95);
      }

      .carousel-arrow.prev {
        left: 8px;
      }
      .carousel-arrow.next {
        right: 8px;
      }

      .carousel.dragging .carousel-item {
        cursor: grabbing;
      }

      @media (min-width: 1200px) {
        .carousel-item {
          min-width: 620px;
          flex: 0 0 620px;
        }
      }

      @media (min-width: 1024px) {
        .carousel-item {
          min-width: 520px;
          flex: 0 0 520px;
        }
        .carousel-track {
          padding: 32px 0;
          gap: 26px;
        }
      }

      @media (min-width: 640px) and (max-width: 1023px) {
        .carousel-item {
          min-width: 460px;
          flex: 0 0 460px;
        }
      }

      @media (max-width: 639px) {
        .carousel-item {
          min-width: 300px;
          flex: 0 0 300px;
        }
        .carousel-arrow {
          width: 36px;
          height: 36px;
          opacity: 0.95;
        }
        .carousel-arrow.prev {
          left: 6px;
        }
        .carousel-arrow.next {
          right: 6px;
        }
      }

      /* ================= CAROUSEL FOCUS POLISH ================= */

      .carousel-item {
        transition:
          transform 420ms var(--ease),
          filter 420ms var(--ease),
          opacity 420ms var(--ease);
      }

      /* Non-active cards */
      .carousel-item:not(.active) {
        filter: blur(1.5px) saturate(0.7);
        opacity: 0.55;
        transform: scale(0.94);
        pointer-events: none; /* prevents clicking other cards */
      }

      /* Active card */
      .carousel-item.active {
        filter: none;
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
      }

      .panel:hover::after {
        opacity: 1;
      }

      .panel-header {
        padding: 14px 18px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        font-size: 18px;
        color: var(--muted);
      }

      .panel .list {
        overflow-x: hidden;
        overflow-y: auto;
      }

      /* ================= LIST ITEMS ================= */

      .list {
        list-style: none;
        margin: 0;
        padding: 0;
      }

      .list-item {
        padding: 11px 16px; /* text starts flush, arrow only shows on hover */
        position: relative;
        font-size: 16px;
      }

      @media (max-width: 640px) {
        .list-item {
          font-size: 15px;
        }
      }

      /* Make label slide on hover (supports plain spans, anchors, and dropdown labels) */
      .list-item > span:last-child,
      .list-item a > span:last-child,
      .dropdown-toggle span:last-child {
        display: inline-block;
        transition: transform 260ms var(--ease);
      }

      /* Make anchors behave visually like the original list items */
      .list-item a {
        color: inherit;
        text-decoration: none;
        display: block; /* full-row clickable */
      }

      .list-item + .list-item {
        border-top: 1px solid rgba(255, 255, 255, 0.04);
      }

      .chev {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        pointer-events: none;
        z-index: 1;
        transition: opacity 180ms var(--ease);
      }

      .list-item:hover {
        background: color-mix(in oklab, var(--bg) 90%, var(--accent));
      }

      .list-item:hover .chev {
        color: var(--accent);
        opacity: 1;
        animation: chevBlink 700ms linear infinite;
      }

      /* Base position: text starts at the left (16px padding) */
      .list-item.dropdown .dropdown-toggle {
        padding-left: 16px;
      }

      /* On hover/open: move text right to make room for the arrow */
      .list-item.dropdown:hover .dropdown-toggle,
      .list-item.dropdown.open .dropdown-toggle {
        padding-left: 32px;
      }

      /* ===== DROPDOWN LIST ITEMS ===== */

      .list-item.dropdown {
        padding: 0; /* dropdown-toggle will handle padding */
      }

      .dropdown-toggle {
        all: unset;
        width: 100%;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px; /* same as .list-item */
        font-family: inherit;
        font-size: 14px;
        position: relative;
        transition: padding-left 220ms var(--ease);
      }

      .dropdown-content {
        max-height: 0;
        overflow: hidden;
        padding: 0 16px 0 44px;
        font-size: 14px;
        line-height: 1.5;
        color: var(--muted);
        opacity: 0;
        transform: translateY(-6px);
        transition:
          max-height 420ms var(--ease),
          opacity 280ms var(--ease),
          transform 320ms var(--ease);
      }

      .dropdown-content p {
        margin: 0 0 12px;
        font-size: 15px;
        line-height: 1.6;
      }

      .dropdown-action {
        background: transparent;
        border: 1px solid var(--border);
        color: var(--fg);
        padding: 7px 14px;
        font-family: inherit;
        font-size: 14px;
        cursor: pointer;
      }

      .dropdown-action:hover {
        background: color-mix(in oklab, var(--bg) 85%, var(--accent));
        color: var(--accent);
      }

      .list-item.open .dropdown-content {
        max-height: 240px; /* safe height for text + button */
        padding: 12px 16px 16px 44px;
        opacity: 1;
        transform: translateY(0);
      }

      .dropdown-action {
        transition:
          background 180ms var(--ease),
          color 180ms var(--ease),
          transform 220ms var(--ease);
      }

      /* ===== COMING SOON (THEME-AWARE) ===== */

      .dropdown-action.coming-soon,
      .dropdown-action[disabled] {
        opacity: 0.45; /* fade based on theme */
        filter: grayscale(100%);
        cursor: not-allowed; /* 🚫 cursor */
        pointer-events: none; /* truly not clickable */
        border-style: dashed;
      }

      /* Kill all hover / active effects */
      .dropdown-action.coming-soon:hover,
      .dropdown-action[disabled]:hover,
      .list-item.open .dropdown-action.coming-soon,
      .list-item.open .dropdown-action[disabled] {
        background: transparent;
        color: var(--muted);
        transform: none;
      }

      /* Optional: slightly dim text for clarity */
      .dropdown-action.coming-soon {
        color: var(--muted);
      }

      .list-item.open .dropdown-action {
        transform: translateY(2px);
      }

      .list-item.open .chev {
        opacity: 1;
        color: var(--accent);
        transform: translateY(-50%) rotate(90deg);
      }

      /* ===== REDIRECT CONFIRM MODAL ===== */

      .redirect-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: none; /* hidden by default */
        align-items: center;
        justify-content: center;
        z-index: 80; /* above header/footer */
      }

      .redirect-overlay.open {
        display: flex;
      }

      .redirect-dialog {
        background: color-mix(in oklab, var(--bg) 96%, black);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 20px 22px;
        max-width: 420px;
        width: calc(100% - 32px);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
        font-family: var(--font);
        position: relative;
      }

      .redirect-title {
        font-size: 16px;
        margin: 0 0 10px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--muted);
      }

      .redirect-body {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 18px;
      }

      .redirect-url {
        display: inline-block;
        margin-top: 6px;
        padding: 6px 8px;
        border-radius: 6px;
        border: 1px solid var(--border);
        font-size: 12px;
        word-break: break-all;
        color: var(--accent);
        background: color-mix(in oklab, var(--bg) 90%, black);
      }

      .redirect-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 4px;
      }

      .redirect-btn {
        border-radius: 8px;
        padding: 6px 14px;
        font-family: var(--font);
        font-size: 13px;
        cursor: pointer;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--fg);
        transition:
          background 160ms var(--ease),
          color 160ms var(--ease),
          transform 160ms var(--ease);
      }

      .redirect-btn:hover {
        transform: translateY(-1px);
      }

      .redirect-btn-confirm {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }

      .redirect-btn-confirm:hover {
        background: color-mix(in oklab, var(--accent) 80%, black);
      }

      .redirect-btn-cancel:hover {
        background: color-mix(in oklab, var(--bg) 85%, var(--accent));
        color: var(--accent);
      }

      /* close "X" in corner */
      .redirect-close {
        position: absolute;
        top: 8px;
        right: 10px;
        border: none;
        background: transparent;
        color: var(--muted);
        font-size: 18px;
        cursor: pointer;
        padding: 2px 6px;
      }

      .redirect-close:hover {
        color: var(--accent);
      }

      /* ================= LOGIN MODAL ================= */
      /* Injected into every page by main.js. Opening it blurs the page behind
         a box with the sign-in options and a note that it is secure. The
         standalone /login/ page still works on its own. */

      .lm-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.62);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        z-index: 90;
      }

      .lm-overlay.open {
        display: flex;
        animation: lmFade 140ms var(--ease);
      }

      @keyframes lmFade {
        from {
          opacity: 0;
        }
      }

      .lm-modal {
        position: relative;
        width: 100%;
        max-width: 340px;
        border: 1px solid var(--border);
        border-top: 2px solid var(--accent);
        border-radius: 10px;
        background: color-mix(in oklab, var(--bg) 96%, black);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
        padding: 26px 24px 20px;
        text-align: center;
        font-family: var(--font);
      }

      .lm-overlay.open .lm-modal {
        animation: lmPop 180ms var(--ease);
      }

      @keyframes lmPop {
        from {
          opacity: 0;
          transform: translateY(8px) scale(0.97);
        }
      }

      .lm-close {
        position: absolute;
        top: 8px;
        right: 12px;
        border: none;
        background: transparent;
        color: var(--muted);
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        padding: 4px 8px;
      }

      .lm-close:hover {
        color: var(--accent);
      }

      .lm-mark {
        font-family: var(--font-display);
        letter-spacing: 0.03em;
        font-weight: 600;
        font-size: 1.9rem;
        line-height: 1;
        margin-bottom: 6px;
      }

      .lm-mark .x {
        color: var(--accent);
      }

      .lm-title {
        font-family: var(--font);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.24em;
        color: var(--muted);
        margin: 0 0 14px;
      }

      .lm-sub {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.6;
        margin: 0 auto 18px;
        max-width: 260px;
      }

      .lm-actions {
        display: flex;
        flex-direction: row;
        gap: 10px;
      }

      .lm-btn {
        box-sizing: border-box;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 11px 12px;
        border-radius: 8px;
        border: 1px solid transparent;
        font-family: var(--font);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        transition:
          background 150ms var(--ease),
          border-color 150ms var(--ease),
          transform 150ms var(--ease);
      }

      .lm-btn:hover {
        transform: translateY(-1px);
      }

      .lm-btn svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
      }

      .lm-btn-discord {
        background: #5865f2;
        color: #fff;
      }
      .lm-btn-discord svg {
        fill: #fff;
      }
      .lm-btn-discord:hover {
        background: #4752c4;
      }

      .lm-btn-github {
        background: color-mix(in oklab, var(--bg) 78%, black);
        color: var(--fg);
        border-color: var(--border);
      }
      .lm-btn-github svg {
        fill: var(--fg);
      }
      .lm-btn-github:hover {
        border-color: var(--fg);
      }

      /* ===== LOGIN/REGISTER TABS ===== */

      .lm-tabs {
        display: flex;
        gap: 4px;
        margin: 0 0 20px;
        border-bottom: 1px solid var(--border);
      }

      .lm-tab {
        flex: 1;
        background: none;
        border: none;
        padding: 10px 0;
        font-family: var(--font);
        font-size: 14px;
        font-weight: 700;
        color: var(--muted);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        transition:
          color 140ms var(--ease),
          border-color 140ms var(--ease);
      }

      .lm-tab.active {
        color: var(--fg);
        border-color: var(--accent);
      }

      .lm-tab:hover:not(.active) {
        color: var(--fg);
      }

      .lm-panel {
        text-align: left;
      }

      .lm-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      /* [hidden] alone loses to the class's display:flex above since author
         CSS always wins over the UA stylesheet default. */
      .lm-form[hidden] {
        display: none;
      }

      .lm-input {
        width: 100%;
        box-sizing: border-box;
        padding: 11px 14px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: color-mix(in oklab, var(--bg) 92%, black);
        color: var(--fg);
        font-family: var(--font);
        font-size: 14px;
      }

      .lm-input::placeholder {
        color: var(--muted);
      }

      .lm-input:focus {
        outline: none;
        border-color: var(--accent);
      }

      .lm-submit {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        border: none;
        background: var(--accent);
        color: #fff;
        font-family: var(--font);
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        transition:
          background 150ms var(--ease),
          opacity 150ms var(--ease);
      }

      .lm-submit:hover:not(:disabled) {
        background: color-mix(in oklab, var(--accent) 85%, black);
      }

      .lm-submit:disabled {
        opacity: 0.6;
        cursor: default;
      }

      .lm-forgot-link {
        align-self: flex-end;
        background: none;
        border: none;
        padding: 0;
        margin-top: -2px;
        font-family: var(--font);
        font-size: 12px;
        color: var(--muted);
        cursor: pointer;
        transition: color 140ms var(--ease);
      }

      .lm-forgot-link:hover {
        color: var(--accent);
      }

      .lm-divider {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 18px 0 14px;
        color: var(--muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
      }

      .lm-divider::before,
      .lm-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--border);
      }

      .lm-notice {
        background: color-mix(in oklab, var(--accent) 10%, transparent);
        border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
        border-radius: 8px;
        padding: 14px 16px;
        margin-top: 14px;
        font-size: 13px;
        line-height: 1.6;
        color: var(--fg);
        text-align: center;
      }

      /* ===== GENDER PILL SWITCH ===== */

      .lm-gender-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 2px;
      }

      .lm-gender-label {
        font-size: 13px;
        color: var(--muted);
      }

      .lm-gender-label em {
        font-style: normal;
        opacity: 0.7;
      }

      .lm-pill {
        position: relative;
        width: 84px;
        height: 34px;
        box-sizing: border-box;
        border-radius: 999px;
        background: color-mix(in oklab, var(--bg) 80%, black);
        border: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px;
        transition:
          background 200ms var(--ease),
          border-color 200ms var(--ease);
      }

      .lm-pill[data-gender="male"] {
        background: #2f6fed;
        border-color: #2f6fed;
      }

      .lm-pill[data-gender="female"] {
        background: #ed5fa6;
        border-color: #ed5fa6;
      }

      .lm-pill-icon {
        position: relative;
        z-index: 2;
        width: 24px;
        height: 24px;
        border: none;
        background: none;
        color: var(--muted);
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 200ms var(--ease);
      }

      .lm-pill[data-gender="male"] .lm-pill-icon-male,
      .lm-pill[data-gender="female"] .lm-pill-icon-female {
        color: #fff;
      }

      .lm-pill-thumb {
        position: absolute;
        top: 3px;
        left: 3px;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
        opacity: 0;
        transform: translateX(0);
        transition:
          transform 220ms var(--ease),
          opacity 180ms var(--ease);
      }

      .lm-pill[data-gender="male"] .lm-pill-thumb {
        opacity: 1;
        transform: translateX(0);
      }

      .lm-pill[data-gender="female"] .lm-pill-thumb {
        opacity: 1;
        transform: translateX(50px);
      }

      .lm-safe {
        display: flex;
        align-items: flex-start;
        gap: 7px;
        margin: 18px 2px 0;
        text-align: left;
        font-size: 11px;
        line-height: 1.55;
        color: var(--muted);
      }

      .lm-safe svg {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
        margin-top: 1px;
        fill: color-mix(in oklab, var(--accent) 80%, var(--fg));
      }

      /* ================= TOAST NOTIFICATIONS ================= */

      .toast-stack {
        position: fixed;
        left: 50%;
        bottom: 24px;
        transform: translateX(-50%);
        z-index: 500;
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 100vw;
        padding: 0 16px;
        box-sizing: border-box;
        pointer-events: none;
      }

      .toast {
        position: relative;
        overflow: hidden;
        min-width: 240px;
        max-width: min(90vw, 420px);
        box-sizing: border-box;
        opacity: 0;
        transform: translateY(140%);
        background: color-mix(in oklab, var(--bg) 90%, black);
        border: 1px solid var(--border);
        border-top: 2px solid var(--accent);
        color: var(--fg);
        font-family: var(--font);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.5;
        padding: 14px 18px 12px;
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        transition:
          transform 250ms var(--ease),
          opacity 250ms var(--ease);
        pointer-events: auto;
        text-align: center;
      }

      .toast.show {
        transform: translateY(0);
        opacity: 1;
      }

      .toast-success {
        border-top-color: #4ade80;
      }

      .toast-error {
        border-top-color: #ff6b6b;
      }

      .toast-text {
        display: block;
      }

      /* The depleting bar: starts full-width, transitions to 0 over the
         toast's display duration (set inline in showToast() to match
         TOAST_DURATION_MS exactly). */
      .toast-progress {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: rgba(255, 255, 255, 0.08);
      }

      .toast-progress-bar {
        height: 100%;
        width: 100%;
        background: var(--accent);
        transition-property: width;
        transition-timing-function: linear;
      }

      .toast-success .toast-progress-bar {
        background: #4ade80;
      }

      .toast-error .toast-progress-bar {
        background: #ff6b6b;
      }

      /* ================= THEMES ================= */

      /* BOSSx */
      body.theme-bossx {
        --panel-glow: color-mix(in oklab, #ff1f3d 28%, transparent);
      }

      /* Nord / NordVPN: deep navy, one bright blue accent, white text. */
      body.theme-nordvpn {
        --bg: #0d1220;
        --bg-deep: #070b14;
        --fg: #eaf0fb;
        --accent: #4687ff;
        --border: rgba(160, 185, 235, 0.22);
        --muted: rgba(205, 218, 242, 0.74);
        --font: Inter, system-ui, sans-serif;
        --panel-glow: color-mix(in oklab, #4687ff 26%, transparent);
      }

      /* Discord: the real dark-mode greys (not near-black), blurple accent. */
      body.theme-discord {
        --bg: #313338;
        --bg-deep: #1e1f22;
        --fg: #f2f3f5;
        --accent: #5865f2;
        --border: rgba(255, 255, 255, 0.1);
        --muted: #b5bac1;
        --font: "gg sans", Inter, system-ui, sans-serif;
        --panel-glow: color-mix(in oklab, #5865f2 26%, transparent);
      }

      body.theme-discord .dropdown-action {
        background: #5865f2; /* Discord Blurple */
        border-color: #5865f2;
        color: #ffffff;
        border-radius: 6px; /* Discord-style pill */
        font-family: Inter, system-ui, sans-serif;
        font-weight: 500;
        padding: 6px 14px;
      }

      body.theme-discord .dropdown-action:hover {
        background: #4752c4; /* darker Blurple hover */
        border-color: #4752c4;
        color: #ffffff;
      }

      /* Pirate Bay, intentionally ugly & flat */
      body.theme-piratebay {
        --bg: #ffffff; /* true white */
        --bg-deep: #e8e3dc; /* parchment, so the CITY / MOB CITY bands aren't black */
        --fg: #000000;
        --accent: #a8895f;
        --border: #cdbfae;
        --muted: #000000;
        --font: Verdana, Geneva, sans-serif;
        --panel-glow: transparent;

        background: #ffffff; /* hard override */
      }

      /* CITY / MOB CITY bands: parchment strip, no coloured glow, flat buttons. */
      body.theme-piratebay .city-intro,
      body.theme-piratebay .mobcity-intro {
        border-top: 1px solid #cdbfae;
        border-bottom: 1px solid #cdbfae;
      }

      body.theme-piratebay .city-intro-bg,
      body.theme-piratebay .mobcity-intro-bg {
        display: none;
      }

      body.theme-piratebay .city-intro-content p,
      body.theme-piratebay .mobcity-intro-content p,
      body.theme-piratebay .city-intro-content h2,
      body.theme-piratebay .mobcity-intro-content h2 {
        color: #000;
      }

      body.theme-piratebay .city-intro-btn,
      body.theme-piratebay .mobcity-intro-btn {
        border-radius: 0;
      }

      body.theme-piratebay .header {
        background-color: #cdbfae;
      }

      /* Pirate Bay hero, keep glow, kill flat grey */
      body.theme-piratebay .hero {
        background: transparent;
        border-bottom: 1px solid #cdbfae;
      }

      /* Remove ONLY the fallback grey gradient */
      body.theme-piratebay .hero-fallback {
        background: none !important;
      }

      /* KEEP the glowing orb */
      body.theme-piratebay .hero::after {
        opacity: 0.22;
        background: radial-gradient(
          900px 300px at 50% 10%,
          rgba(25, 25, 163, 0.45),
          transparent
        );
      }

      /* Hero overlay stays transparent */
      body.theme-piratebay .hero-overlay {
        background: transparent;
      }

      /* Remove dark hero badge completely */
      body.theme-piratebay .hero-badge {
        background: none;
        border: none;
        padding: 0;
      }

      /* Panels: flat, square, boring */
      body.theme-piratebay .panel,
      body.theme-piratebay .panel:hover {
        transform: none;
        box-shadow: none;
        border-radius: 0;
      }

      /* No glow layer */
      body.theme-piratebay .panel::after {
        display: none;
      }

      /* Header strip like old TPB tables */
      body.theme-piratebay .panel-header {
        background: #cdbfae;
        color: #000;
      }

      /* Hover rows */
      body.theme-piratebay .list-item:hover,
      body.theme-piratebay .list-item span:hover {
        background: #ddd6cd;
      }

      body.theme-piratebay .dropdown-content {
        text-decoration: none;
      }

      /* FOOTER, flat HTML look */
      body.theme-piratebay .footer,
      body.theme-piratebay .footer-bottom {
        color: #000;
        box-shadow: none;
      }

      /* Classic blue links */
      body.theme-piratebay .footer-list a,
      body.theme-piratebay .list-item,
      body.theme-piratebay .donate-link {
        color: #0000ee;
      }

      body.theme-piratebay .footer-list a:hover,
      body.theme-piratebay .donate-link:hover {
        text-decoration: underline;
      }

      /* ================= FOOTER ================= */

      .footer {
        border-top: 1px solid var(--border);
        background: var(--bg-deep);
        width: 100%;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
      }

      main {
        padding-bottom: var(--footer-space, 112px);
      }

      .footer-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        padding: 10px 16px 8px;
        align-items: flex-start;
      }

      @media (min-width: 640px) {
        .footer-inner {
          justify-content: space-between;
        }
      }

      .footer-group {
        min-width: 140px;
      }

      .footer-group h4 {
        margin: 0 0 6px;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.18em;
        color: var(--muted);
        font-weight: 600;
      }

      .footer-list {
        list-style: none;
        padding: 0;
        margin: 0;
      }

      .footer-list li {
        margin: 4px 0;
      }

      .footer-group a,
      .footer-list a,
      .donate-link {
        font-size: 12px;
        color: var(--muted);
        opacity: 0.88;
        text-decoration: none;
        transition:
          color 150ms var(--ease),
          opacity 150ms var(--ease),
          transform 150ms var(--ease);
      }

      .footer-group a:hover,
      .footer-list a:hover,
      .donate-link:hover {
        color: var(--accent);
        opacity: 1;
        transform: translateY(-1px);
      }

      .donate-crypto {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 6px;
      }

      .donate-copy-btn {
        display: inline-flex;
        align-items: center;
        padding: 0;
        border: none;
        background: none;
        font-family: var(--font);
        font-size: 12px;
        color: var(--muted);
        opacity: 0.88;
        cursor: pointer;
        text-align: left;
        transition:
          color 150ms var(--ease),
          opacity 150ms var(--ease),
          transform 150ms var(--ease);
      }

      .donate-copy-btn:hover {
        color: var(--accent);
        opacity: 1;
        transform: translateY(-1px);
      }

      /* ===== STACK COLUMN ===== */

      .footer .stack-strip {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
      }

      .footer .stack-strip i {
        font-size: 24px;
        line-height: 1;
        opacity: 0.85;
        transition:
          transform 160ms ease,
          opacity 160ms ease;
      }

      .footer .stack-strip i:hover {
        transform: translateY(-2px);
        opacity: 1;
      }

      /* ===== PIRATE BAY ===== */

      body.theme-piratebay .footer {
        background: #e8e3dc;
        color: #000;
        border-top-color: #cdbfae;
        box-shadow: none;
      }

      body.theme-piratebay .footer .stack-strip i {
        font-size: 28px;
        transform: none;
        opacity: 1;
      }

      body.theme-piratebay .footer-group a,
      body.theme-piratebay .footer-list a,
      body.theme-piratebay .donate-link,
      body.theme-piratebay .donate-copy-btn {
        color: #0000ee;
        opacity: 1;
      }

      body.theme-piratebay .footer-group a:hover,
      body.theme-piratebay .footer-list a:hover,
      body.theme-piratebay .donate-link:hover,
      body.theme-piratebay .donate-copy-btn:hover {
        text-decoration: underline;
        transform: none;
      }

      /* ===== FOOTER BOTTOM ===== */

      .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding: 6px 16px 8px;
        text-align: center;
        font-size: 11px;
        color: var(--muted);
        opacity: 0.85;
      }

      body.theme-piratebay .footer-bottom {
        border-top-color: #cdbfae;
        color: #000;
        opacity: 0.9;
      }
