* {
    box-sizing: border-box;
}

:root {
    /* Core — deep navy + cool lavender (reference header) */
    --bc-bg-0: #0b0e14;
    --bc-bg-1: #0f131c;
    --bc-text: #f4f2f6;
    --bc-muted: #a89bb0;
    --bc-muted-2: #8a7d92;
    --bc-gold: #c9a87a;
    --bc-gold-dim: #9a7b52;
    --bc-line: rgba(180, 168, 198, 0.14);
    --bc-line-strong: rgba(200, 188, 215, 0.28);
    --bc-surface: rgba(16, 20, 30, 0.82);
    --bc-surface-2: rgba(12, 15, 22, 0.88);
    --bc-accent: #5c7ab8;
    --bc-accent-2: #3d5280;
    --bc-wine: rgba(90, 28, 48, 0.18);
    --bc-discord: #5865f2;
    --bc-focus: rgba(120, 160, 220, 0.45);
    /* Scrollbar (Firefox + custom props for webkit) */
    --bc-scrollbar-track: rgba(11, 14, 20, 0.92);
    --bc-scrollbar-thumb: rgba(168, 155, 176, 0.38);
    --bc-scrollbar-thumb-hover: rgba(198, 188, 210, 0.52);
    --bc-scrollbar-corner: var(--bc-bg-0);
    /* Police accents */
    --pd-navy: #0a1424;
    --pd-blue-deep: rgba(22, 38, 62, 0.5);
    --pd-blue-mid: #3d5a80;
    --pd-blue-glow: rgba(70, 120, 180, 0.18);
    --pd-blue-core: rgba(175, 205, 245, 0.92);
    --pd-amber: #c9a068;
    --pd-amber-glow: rgba(200, 160, 90, 0.35);
    --pd-red-glow: rgba(180, 70, 85, 0.28);
    /* Motion — one curve family sitewide */
    --ease-out-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-smooth: cubic-bezier(0.45, 0, 0.55, 1);
    --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
    --t-fast: 0.2s;
    --t-base: 0.32s;
    --t-reveal: 0.58s;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

@keyframes crown-float-portal {
    0%,
    100% {
        transform: translateY(-50%) translate(0, 0);
    }
    50% {
        transform: translateY(-50%) translate(-6px, -10px);
    }
}

@keyframes portal-light-sweep {
    0% {
        transform: translate(-18%, -12%) rotate(-6deg);
    }
    45% {
        transform: translate(14%, 10%) rotate(2deg);
    }
    100% {
        transform: translate(-18%, -12%) rotate(-6deg);
    }
}

@keyframes ember-rise {
    0% {
        opacity: 0;
        transform: translate3d(0, 8px, 0) scale(0.7);
    }
    22% {
        opacity: 0.92;
    }
    62% {
        opacity: 0.58;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--spark-drift, 0px), calc(var(--spark-rise, 200px) * -1), 0) scale(1.45);
    }
}

@keyframes ember-fall {
    0% {
        opacity: 0;
        transform: translate3d(0, -8px, 0) scale(0.65);
    }
    18% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--spark-drift, 0px), var(--spark-fall, 100px), 0) scale(1.05);
    }
}

@keyframes intro-pulse {
    0%,
    100% {
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.38),
            0 0 0 1px var(--bc-line);
    }
    50% {
        box-shadow:
            0 16px 48px rgba(0, 0, 0, 0.42),
            0 0 0 1px var(--bc-line-strong);
    }
}

@keyframes header-shine {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes spark-ambient-sweep {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes pd-topbar-stripe {
    0%,
    100% {
        opacity: 0.45;
        filter: hue-rotate(-6deg);
    }
    50% {
        opacity: 0.78;
        filter: hue-rotate(8deg);
    }
}

@keyframes pd-footer-glow {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.65;
    }
}

body.theme-blood-crown {
    margin: 0;
    font-family:
        "Segoe UI",
        system-ui,
        -apple-system,
        "Inter",
        "Helvetica Neue",
        sans-serif;
    color: var(--bc-text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
    scrollbar-width: thin;
    scrollbar-color: var(--bc-scrollbar-thumb) var(--bc-scrollbar-track);
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(45, 65, 100, 0.16), transparent 52%),
        radial-gradient(80% 50% at 100% 50%, rgba(70, 40, 55, 0.08), transparent 50%),
        linear-gradient(180deg, var(--bc-bg-0) 0%, var(--bc-bg-1) 55%, #0a0c12 100%);
}

body.theme-blood-crown::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

body.theme-blood-crown::-webkit-scrollbar-track {
    background: var(--bc-scrollbar-track);
    border-left: 1px solid rgba(255, 255, 255, 0.035);
}

body.theme-blood-crown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--bc-scrollbar-thumb-hover), var(--bc-scrollbar-thumb));
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.theme-blood-crown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(210, 200, 220, 0.55),
        rgba(175, 165, 190, 0.45)
    );
    background-clip: padding-box;
    border: 2px solid transparent;
}

body.theme-blood-crown::-webkit-scrollbar-corner {
    background: var(--bc-scrollbar-corner);
}

body.theme-blood-crown::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 45% at 50% 0%, rgba(55, 75, 110, 0.1), transparent 65%),
        radial-gradient(500px 180px at 0% 100%, rgba(80, 45, 60, 0.06), transparent 70%);
}

body.theme-blood-crown::after {
    content: "";
    position: fixed;
    inset: -55%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    background: linear-gradient(
        118deg,
        transparent 0%,
        transparent 42%,
        rgba(200, 210, 230, 0.04) 48%,
        rgba(220, 200, 175, 0.07) 50%,
        rgba(200, 210, 230, 0.04) 52%,
        transparent 58%,
        transparent 100%
    );
    background-size: 150% 150%;
    animation: portal-light-sweep 28s var(--ease-in-out-smooth) infinite;
    mix-blend-mode: soft-light;
}

.bg-crown {
    position: fixed;
    width: min(52vw, 480px);
    aspect-ratio: 1;
    right: -72px;
    top: 52%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.22;
    mix-blend-mode: screen;
    filter: saturate(1.06) contrast(1.05);
    -webkit-mask-image: radial-gradient(circle at center, #000 52%, transparent 82%);
    mask-image: radial-gradient(circle at center, #000 52%, transparent 82%);
    background: url("assets/blood-crown-logo.png") no-repeat center / contain;
    animation: crown-float-portal 11s var(--ease-in-out-smooth) infinite;
}

.spark-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.spark-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(640px 240px at 50% 100%, rgba(35, 85, 140, 0.14), transparent 72%),
        radial-gradient(560px 200px at 14% 100%, rgba(183, 28, 44, 0.12), transparent 70%),
        radial-gradient(520px 200px at 86% 100%, rgba(205, 90, 45, 0.08), transparent 72%),
        radial-gradient(360px 160px at 50% 100%, rgba(214, 140, 55, 0.06), transparent 74%);
}

.spark-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    background: linear-gradient(
        102deg,
        transparent 0%,
        rgba(50, 85, 130, 0.06) 44%,
        rgba(120, 70, 85, 0.035) 50%,
        rgba(180, 145, 95, 0.04) 56%,
        transparent 100%
    );
    background-size: 220% 100%;
    background-position: 0% 50%;
    animation: spark-ambient-sweep 40s linear infinite;
    mix-blend-mode: soft-light;
}

.portal-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(0.25px);
    will-change: transform, opacity;
}

.portal-spark-rise {
    animation: ember-rise 2.75s var(--ease-soft) forwards;
}

.portal-spark-fall {
    animation: ember-fall 2.1s var(--ease-in-out-smooth) forwards;
}

.portal-spark-gold {
    background: radial-gradient(circle, rgba(250, 221, 161, 0.95) 0%, rgba(193, 140, 66, 0.2) 58%, transparent 100%);
    box-shadow: 0 0 8px rgba(255, 226, 173, 0.35);
}

.portal-spark-fire {
    background: radial-gradient(circle, rgba(255, 120, 90, 0.9) 0%, rgba(180, 40, 50, 0.25) 55%, transparent 100%);
}

.portal-spark-blue {
    background: radial-gradient(circle, var(--pd-blue-core) 0%, rgba(60, 130, 210, 0.35) 50%, transparent 100%);
    box-shadow:
        0 0 6px rgba(120, 190, 255, 0.55),
        0 0 14px rgba(40, 100, 180, 0.25);
}

.portal-spark-amber {
    background: radial-gradient(circle, rgba(255, 214, 140, 0.98) 0%, rgba(232, 140, 40, 0.35) 52%, transparent 100%);
    box-shadow: 0 0 10px var(--pd-amber-glow);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(11, 14, 20, 0.78);
    border-bottom: 1px solid var(--bc-line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.topbar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(160, 90, 100, 0.35) 0%,
        rgba(90, 120, 170, 0.4) 50%,
        rgba(160, 90, 100, 0.3) 100%
    );
    opacity: 0.65;
    pointer-events: none;
}

.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 155, 188, 0.2), transparent);
    opacity: 0.85;
}

.brand-block {
    min-width: 0;
    max-width: min(340px, 36vw);
}

.brand-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
    transition: opacity var(--t-base) var(--ease-out-smooth);
}

.brand-subtitle {
    margin: 6px 0 0;
    color: var(--bc-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.topbar > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.topbar > nav a {
    color: rgba(244, 242, 246, 0.88);
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    transition:
        background var(--t-fast) var(--ease-out-smooth),
        border-color var(--t-fast) var(--ease-out-smooth),
        color var(--t-fast) var(--ease-out-smooth),
        box-shadow var(--t-fast) var(--ease-out-smooth);
}

.topbar > nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--bc-line);
    color: var(--bc-text);
}

.topbar > nav a.nav-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bc-line-strong);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(201, 168, 122, 0.12);
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.brand-link:hover .brand-title {
    color: #fff;
    opacity: 0.92;
}

.home-hero .home-title {
    margin: 10px 0 14px;
    font-size: clamp(1.5rem, 3.6vw, 1.95rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.home-lead {
    margin: 0;
    color: var(--bc-muted);
    line-height: 1.55;
    font-size: 1.05rem;
}

.container-page {
    max-width: 900px;
}

.btn,
button[type="submit"] {
    display: inline-block;
    border: 1px solid rgba(201, 168, 122, 0.35);
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(180deg, #1c2638 0%, #141b28 100%);
    color: #f4f2f6;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition:
        transform var(--t-fast) var(--ease-out-smooth),
        box-shadow var(--t-base) var(--ease-out-smooth),
        border-color var(--t-base) var(--ease-out-smooth),
        background var(--t-base) var(--ease-out-smooth),
        filter var(--t-fast) var(--ease-out-smooth);
    text-decoration: none;
}

.topbar .btn {
    background: linear-gradient(180deg, #5865f2 0%, #4752c4 100%);
    border-color: rgba(120, 135, 245, 0.5);
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
}

.btn:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
    border-color: rgba(215, 188, 150, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.topbar .btn:hover {
    border-color: rgba(150, 160, 255, 0.55);
    box-shadow: 0 6px 22px rgba(88, 101, 242, 0.38);
}

/* Side language switch (English / Roman Urdu) */
.lang-rail {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 8px;
    background: rgba(11, 14, 20, 0.92);
    border: 1px solid var(--bc-line);
    border-right: none;
    border-radius: 10px 0 0 10px;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.lang-rail__btn {
    display: block;
    padding: 8px 10px;
    min-width: 5.5rem;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bc-muted);
    border-radius: 6px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    transition:
        background var(--t-fast) var(--ease-out-smooth),
        border-color var(--t-fast) var(--ease-out-smooth),
        color var(--t-fast) var(--ease-out-smooth);
}

.lang-rail__btn:hover {
    color: var(--bc-text);
    border-color: var(--bc-line);
    background: rgba(255, 255, 255, 0.07);
}

.lang-rail__btn--active {
    color: #fff;
    border-color: var(--bc-line-strong);
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

@media (max-width: 640px) {
    .lang-rail {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 12px 12px 0 0;
        border-right: 1px solid var(--bc-line);
        border-bottom: none;
    }

    body.theme-blood-crown {
        padding-bottom: 58px;
    }
}

.nav-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(240px, 28vw);
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--bc-line);
    background: rgba(255, 255, 255, 0.04);
}

.nav-profile--link {
    text-decoration: none;
    color: inherit;
    transition:
        border-color var(--t-fast) var(--ease-out-smooth),
        background var(--t-fast) var(--ease-out-smooth);
}

.nav-profile--link:hover {
    border-color: var(--bc-line-strong);
    background: rgba(255, 255, 255, 0.06);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--bc-line-strong);
}

.nav-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #3d2430, #1a1016);
    color: var(--bc-gold);
    font-weight: 800;
    font-size: 14px;
}

.nav-user {
    font-size: 13px;
    color: rgba(244, 242, 246, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.rank-row--person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-row__body {
    min-width: 0;
    flex: 1;
}

.rank-row__body strong,
.rank-row__body span {
    display: block;
    line-height: 1.35;
}

.rank-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(196, 151, 78, 0.35);
}

.rank-avatar--placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #3d2430, #1a1016);
    color: var(--bc-gold);
    font-weight: 800;
    font-size: 18px;
    border: 1px solid rgba(196, 151, 78, 0.35);
}

.btn-logout {
    background: linear-gradient(140deg, rgba(90, 40, 50, 0.95), rgba(50, 18, 28, 0.92)) !important;
    box-shadow: 0 8px 20px rgba(40, 10, 16, 0.45) !important;
}

.btn-logout:hover {
    box-shadow: 0 12px 24px rgba(60, 20, 30, 0.5) !important;
}

.btn:active,
button[type="submit"]:active {
    transform: translateY(0);
}

.btn-discord {
    background: linear-gradient(180deg, #5865f2 0%, #4752c4 100%) !important;
    border-color: rgba(130, 145, 255, 0.45) !important;
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.32) !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    margin-top: 8px;
}

a {
    color: var(--bc-gold);
    text-underline-offset: 3px;
    transition: color var(--t-fast) var(--ease-out-smooth);
}

a:hover {
    color: #dcc29a;
}

:focus-visible {
    outline: 2px solid var(--bc-focus);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

.container {
    width: min(1100px, 94%);
    margin: 22px auto;
    position: relative;
    z-index: 1;
}

.portal-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 320px 1fr;
}

.content-stack {
    display: grid;
    gap: 16px;
}

.card {
    border: 1px solid var(--bc-line);
    border-radius: 10px;
    padding: 18px;
    background: var(--bc-surface);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    transition:
        box-shadow var(--t-base) var(--ease-out-smooth),
        border-color var(--t-base) var(--ease-out-smooth),
        transform var(--t-base) var(--ease-out-smooth);
    transform: translateZ(0);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card:hover {
    border-color: var(--bc-line-strong);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
    transform: translateZ(0) translateY(-1px);
}

.card h2 {
    margin-top: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.95);
}

.rank-sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow: auto;
}

details {
    border: 1px solid rgba(166, 53, 67, 0.22);
    border-radius: 10px;
    margin-bottom: 9px;
    background: rgba(12, 6, 9, 0.72);
}

summary {
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    color: #f2e4e8;
}

summary::-webkit-details-marker {
    display: none;
}

.rank-list {
    border-top: 1px solid rgba(120, 40, 50, 0.25);
    padding: 8px;
}

.rank-row {
    border: 1px solid rgba(179, 145, 226, 0.2);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(14, 10, 18, 0.85);
}

.rank-row strong,
.rank-row span {
    display: block;
    line-height: 1.35;
}

.rank-row span {
    color: #d8c4e6;
    font-size: 13px;
}

.item {
    border-top: 1px solid rgba(120, 40, 50, 0.2);
    padding: 10px 0;
}

.item:first-of-type {
    border-top: 0;
}

form {
    display: grid;
    gap: 10px;
}

input,
textarea,
button {
    border-radius: 11px;
    font-size: 14px;
}

input,
textarea {
    border: 1px solid rgba(179, 145, 226, 0.28);
    padding: 11px 12px;
    background: rgba(14, 10, 18, 0.88);
    color: var(--bc-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(231, 199, 132, 0.65);
    box-shadow: 0 0 0 3px rgba(205, 159, 88, 0.12);
}

input.input-readonly {
    opacity: 0.92;
    cursor: default;
    border-style: dashed;
}

button {
    cursor: pointer;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    border: 1px solid rgba(166, 53, 67, 0.22);
    padding: 9px;
    text-align: left;
}

th {
    background: rgba(50, 14, 24, 0.65);
    color: #f5e8cf;
}

.notice {
    background: rgba(80, 24, 38, 0.45);
    border: 1px solid rgba(202, 77, 106, 0.45);
    padding: 11px;
    border-radius: 10px;
}

.hint {
    color: #d1b7bf;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

figure {
    margin: 0;
    border: 1px solid var(--bc-line);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(12, 6, 10, 0.75);
}

figure img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

figcaption {
    padding: 8px;
    font-size: 13px;
    color: var(--bc-muted);
}

.portal-footer,
footer {
    margin: 24px auto;
    width: min(1100px, 94%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--bc-muted);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.portal-footer {
    padding-top: 18px;
}

.portal-footer::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(55, 130, 200, 0.45),
        rgba(232, 168, 56, 0.32),
        rgba(180, 60, 72, 0.28),
        transparent
    );
    opacity: 0.55;
    animation: pd-footer-glow 12s var(--ease-in-out-smooth) infinite;
    pointer-events: none;
}

footer a {
    color: var(--bc-gold);
}

.center-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    position: relative;
    z-index: 1;
}

.intro-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
    animation: intro-pulse 6s var(--ease-in-out-smooth) infinite;
}

.intro-card h1,
.portal-title {
    margin: 12px 0 14px;
    font-size: clamp(1.65rem, 4.8vw, 2.1rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.intro-card .portal-lead {
    color: var(--bc-muted);
    line-height: 1.55;
    margin: 0 0 20px;
    font-size: 1.02rem;
}

.hero-kicker {
    display: inline-flex;
    margin: 0 auto 4px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bc-line);
    color: var(--bc-muted);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
}

.small-text {
    margin-top: 18px;
    opacity: 0.78;
    font-size: 13px;
    line-height: 1.45;
    color: var(--bc-muted);
}

.reveal-pending {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    filter: saturate(0.97);
    transition:
        opacity var(--t-reveal) var(--ease-out-smooth),
        transform var(--t-reveal) var(--ease-out-smooth),
        filter calc(var(--t-reveal) * 0.85) var(--ease-in-out-smooth);
}

.reveal-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: saturate(1);
}

/* Cinematic imagery — home hero, showcase, inner pages */
@keyframes hero-ken {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.07);
    }
}

@keyframes banner-light-pulse {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.65;
    }
}

.hero-banner {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: clamp(240px, 42vw, 400px);
    margin-bottom: 18px;
    border: 1px solid var(--bc-line);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-banner__bg {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    transform-origin: center center;
    animation: hero-ken 32s var(--ease-in-out-smooth) infinite alternate;
}

.hero-banner--patrol .hero-banner__bg {
    background-image: url("assets/brpd-hero-patrol.png");
}

/* Home hero — night pursuit / portal banner */
.hero-banner--portal .hero-banner__bg {
    background-image: url("assets/brpd-hero-home.png");
    background-position: center 42%;
}

.hero-banner__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        105deg,
        rgba(6, 3, 5, 0.93) 0%,
        rgba(8, 4, 6, 0.72) 38%,
        rgba(10, 5, 8, 0.35) 68%,
        rgba(12, 18, 36, 0.25) 100%
    );
}

.hero-banner--portal .hero-banner__scrim {
    background: linear-gradient(
        105deg,
        rgba(4, 8, 18, 0.94) 0%,
        rgba(8, 12, 22, 0.78) 40%,
        rgba(10, 14, 28, 0.4) 72%,
        rgba(14, 20, 40, 0.2) 100%
    );
}

.hero-banner__glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 45% at 70% 85%, rgba(60, 120, 255, 0.12), transparent 55%);
    animation: banner-light-pulse 5s ease-in-out infinite;
    mix-blend-mode: screen;
}

.hero-banner__inner {
    position: relative;
    z-index: 2;
    padding: clamp(22px, 4.5vw, 44px);
    max-width: 560px;
}

.hero-banner .home-title {
    color: #fdf8fa;
}

.hero-banner .home-lead {
    color: rgba(248, 240, 242, 0.88);
}

.showcase-strip__heading {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.showcase-strip__sub {
    margin: 0 0 16px;
    color: var(--bc-muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.showcase-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, 1fr);
}

.showcase-card {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(166, 53, 67, 0.22);
    background: rgba(8, 4, 6, 0.65);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.showcase-card:hover {
    transform: translateY(-3px);
    border-color: var(--bc-line-strong);
}

.showcase-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center;
    display: block;
}

.showcase-card figcaption {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #f0dede;
    background: rgba(12, 6, 9, 0.92);
}

.page-banner {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 160px;
    margin-bottom: 16px;
    border: 1px solid var(--bc-line);
}

.page-banner__bg {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
}

.page-banner--station .page-banner__bg {
    background-image: url("assets/brpd-hero-station.png");
}

.page-banner__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(6, 3, 5, 0.88) 0%, rgba(8, 5, 10, 0.45) 55%, rgba(12, 8, 14, 0.55) 100%);
}

.page-banner__inner {
    position: relative;
    z-index: 2;
    padding: 22px 24px;
}

.page-banner__title {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 800;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.65);
}

.page-banner__meta {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(252, 238, 240, 0.86);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.join-visual {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--bc-line);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.join-visual img {
    width: 100%;
    display: block;
    max-height: 240px;
    object-fit: cover;
    object-position: center 25%;
}

/* —— Instagram-style gallery / feed —— */
.gallery-page {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-page--insta {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* Full feed app: hide global portal header */
body.feed-shell .topbar {
    display: none;
}

body.feed-shell .container.gallery-page {
    width: min(480px, 100%);
    max-width: 480px;
    margin-top: 12px;
    margin-bottom: 0;
    overflow-x: visible;
}

/* Feed UI (stories rings) must not be clipped by global body overflow-x:hidden */
body.feed-shell.theme-blood-crown {
    overflow-x: visible;
}

.ig-shell {
    position: relative;
    min-height: calc(100vh - 24px);
}

/* — IG top bar (logo + icons) — */
.ig-top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px 12px;
    border-bottom: 1px solid rgba(166, 53, 67, 0.2);
    margin-bottom: 4px;
}

.ig-top-bar__back {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -4px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    color: #f5e8ec;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ig-top-bar__back:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.ig-top-bar__brand {
    flex: 1;
    min-width: 0;
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.04em;
    background: linear-gradient(120deg, #fff8fc, #e8c88a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ig-top-bar__brand--explore {
    text-align: center;
    padding-right: 48px;
}

a.ig-top-bar__brand--link {
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

a.ig-top-bar__brand--link:hover {
    opacity: 0.9;
    filter: brightness(1.08);
}

.ig-top-bar__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* — Explore (search + grid) — */
.ig-explore {
    padding-bottom: 8px;
}

.ig-explore-searchbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(166, 53, 67, 0.22);
    background: rgba(12, 6, 10, 0.75);
}

.ig-explore-searchbar__icon {
    font-size: 18px;
    opacity: 0.55;
    flex-shrink: 0;
}

.ig-explore-searchbar__input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: #f8eef2;
    font-family: inherit;
    font-size: 15px;
}

.ig-explore-searchbar__input::placeholder {
    color: rgba(209, 183, 191, 0.45);
}

.ig-explore-searchbar__input:focus {
    outline: none;
}

.ig-explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    margin: 0 -2px;
}

.ig-explore-cell-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #08050a;
}

.ig-explore-cell {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 0;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ig-explore-delete-form {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    margin: 0;
}

.ig-explore-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.45);
    background: rgba(8, 10, 16, 0.72);
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
    touch-action: manipulation;
}

.ig-explore-delete:hover {
    background: rgba(120, 40, 50, 0.88);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ig-explore-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
        transform 0.45s var(--ease-out-smooth),
        opacity 0.45s var(--ease-out-smooth);
}

.ig-explore-cell:hover img {
    transform: scale(1.03);
    opacity: 0.94;
}

.ig-explore-cell__likes {
    position: absolute;
    left: 6px;
    bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.ig-explore-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--bc-muted);
    font-size: 14px;
}

.ig-top-bar__ghost {
    font-size: 26px;
    line-height: 1;
    opacity: 0.45;
    cursor: default;
    user-select: none;
}

.ig-top-bar__icon-link {
    line-height: 0;
    border-radius: 50%;
    border: 1px solid rgba(196, 151, 78, 0.4);
    text-decoration: none;
    display: block;
}

.ig-top-bar__mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.ig-top-bar__mini-avatar--placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
}

/* — Stories row — */
.ig-stories {
    /* No negative side margin: body uses overflow-x:hidden and clips gradient rings into vertical strips */
    margin: 0 0 12px;
    padding: 10px 0 20px;
    border-bottom: 1px solid rgba(166, 53, 67, 0.15);
    overflow-x: auto;
    overflow-y: visible;
    min-height: 104px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ig-stories::-webkit-scrollbar {
    display: none;
}

.ig-stories__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 8px;
    width: max-content;
}

.ig-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 72px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* Ring: conic gradient on outer disc + inner cutout (avoids linear-gradient “two bars” artifacts) */
.ig-story__ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    box-sizing: border-box;
    flex-shrink: 0;
    isolation: isolate;
    background: conic-gradient(
        from 210deg,
        #e8c078 0deg,
        #d06078 100deg,
        #7a4ec4 200deg,
        #e8c078 360deg
    );
}

.ig-story__ring--self {
    background: conic-gradient(
        from 210deg,
        rgba(232, 192, 120, 0.92) 0deg,
        rgba(200, 90, 110, 0.85) 110deg,
        rgba(110, 80, 170, 0.78) 220deg,
        rgba(232, 192, 120, 0.92) 360deg
    );
}

.ig-story__ring-cutout {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #0c0609;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ig-story__ring-cutout > .ig-story__img,
.ig-story__ring-cutout > img.ig-story__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    border: none;
    display: block;
    box-sizing: border-box;
}

.ig-story__ring-cutout > .ig-story__img--placeholder {
    border: none;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
}

/* Stack: avatar ring + “+” badge (badge sits outside gradient ring, not inside) */
.ig-story__ring-stack {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
}

.ig-story__ring-stack .ig-story__plus {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 2;
}

/* Your story: latest post thumbnail + add button */
.ig-story--self-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 72px;
    flex-shrink: 0;
}

.ig-story__self-view {
    display: block;
    width: 68px;
    height: 68px;
    text-decoration: none;
    color: inherit;
}

.ig-story__ring--has-post {
    width: 68px;
    height: 68px;
}

/* Fallback when conic-gradient unsupported */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .ig-story__ring {
        background: linear-gradient(145deg, #e8c078, #c44a6b 45%, #7a4ec4 75%, #e8c078);
    }

    .ig-story__ring--self {
        background: linear-gradient(145deg, rgba(232, 192, 120, 0.9), rgba(196, 74, 107, 0.82));
    }
}

.ig-story__img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #0c0609;
    box-sizing: border-box;
}

.ig-story__img--placeholder {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
    border: 2px solid #0c0609;
}

.ig-story__plus {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #edd088, #b88238);
    color: #120508;
    border: 2px solid #0c0609;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    font: inherit;
    line-height: 0;
    -webkit-font-smoothing: antialiased;
}

button.ig-story__plus {
    cursor: pointer;
}

button.ig-story__plus:focus-visible {
    outline: 2px solid rgba(232, 200, 140, 0.7);
    outline-offset: 2px;
}

.ig-story__plus-icon {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-0.5px);
}

.ig-story__label {
    font-size: 11px;
    color: var(--bc-muted);
    text-align: center;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* — Search strip — */
.ig-search-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 14px;
    margin: 0 0 8px;
    border-radius: 12px;
    border: 1px solid rgba(166, 53, 67, 0.22);
    background: rgba(12, 6, 10, 0.75);
}

.ig-search-strip__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--bc-muted);
    flex-shrink: 0;
}

.ig-search-strip__input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(166, 53, 67, 0.25);
    background: rgba(6, 3, 6, 0.65);
    color: #f8eef2;
    font-family: inherit;
    font-size: 15px;
}

.ig-search-strip__input::placeholder {
    color: rgba(209, 183, 191, 0.45);
}

.ig-search-strip__input:focus {
    outline: none;
    border-color: rgba(196, 151, 78, 0.45);
}

/* — Compose bottom sheet — */
.ig-compose-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 180;
    backdrop-filter: blur(4px);
}

.ig-compose-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 100%);
    width: min(480px, 100%);
    max-height: min(92vh, 720px);
    z-index: 190;
    background: linear-gradient(180deg, rgba(18, 22, 32, 0.98), rgba(10, 12, 18, 0.99));
    border: 1px solid var(--bc-line);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.45);
    transition: transform 0.42s var(--ease-out-smooth);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
    visibility: hidden;
}

.ig-compose-sheet--open {
    transform: translate(-50%, 0);
    pointer-events: auto;
    visibility: visible;
}

body.ig-modal-open {
    overflow: hidden;
}

.ig-compose-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px 8px;
    border-bottom: 1px solid var(--bc-line);
}

.ig-compose-sheet__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.ig-sheet-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--bc-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 10px;
    transition:
        color var(--t-fast) var(--ease-out-smooth),
        background var(--t-fast) var(--ease-out-smooth);
}

.ig-sheet-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.ig-sheet-spacer {
    width: 40px;
}

.ig-compose--sheet {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

/* — More menu sheet — */
.ig-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
}

/* [hidden] must win: author display:flex would otherwise ignore HTML hidden */
.ig-more-backdrop[hidden],
.ig-more-sheet[hidden] {
    display: none !important;
}

.ig-more-sheet {
    position: fixed;
    right: max(10px, calc((100vw - min(480px, 100vw)) / 2 + 6px));
    left: auto;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    transform: none;
    width: auto;
    min-width: 132px;
    max-width: min(200px, calc(100vw - 24px));
    z-index: 210;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--bc-line);
    background: var(--bc-surface-2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    flex-direction: column;
    gap: 0;
    display: flex;
}

.ig-more-sheet__link {
    display: block;
    padding: 7px 11px;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(248, 236, 240, 0.95);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    transition: background var(--t-fast) var(--ease-out-smooth);
}

.ig-more-sheet__link:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* — Bottom nav — */
.ig-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(480px, 100%);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 170;
    background: rgba(11, 14, 20, 0.82);
    border-top: 1px solid var(--bc-line);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.ig-bottom-nav__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: rgba(209, 183, 191, 0.75);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    text-decoration: none;
    box-sizing: border-box;
    transition:
        color var(--t-fast) var(--ease-out-smooth),
        background var(--t-fast) var(--ease-out-smooth),
        transform var(--t-fast) var(--ease-out-smooth);
}

.ig-bottom-nav__btn:hover {
    color: #f0e4e8;
    background: rgba(255, 255, 255, 0.05);
}

.ig-bottom-nav__btn:active {
    transform: scale(0.97);
}

.ig-bottom-nav__btn--active {
    color: #f0c888;
}

.ig-bottom-nav__icon {
    font-size: 22px;
    line-height: 1;
    opacity: 0.95;
}

.ig-bottom-nav__icon--plus {
    font-size: 28px;
    font-weight: 300;
    line-height: 0.85;
}

.ig-bottom-nav__btn--accent .ig-bottom-nav__icon--plus {
    color: #f0c888;
}

.ig-bottom-nav__text {
    letter-spacing: 0.02em;
}

/* — Legacy app bar (unused on new shell) — */
.ig-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 16px;
    border-bottom: 1px solid rgba(166, 53, 67, 0.22);
    margin-bottom: 14px;
}

.ig-app-bar__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ig-app-bar__name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff8fa;
}

.ig-app-bar__sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--bc-muted);
}

.ig-app-bar__profile {
    flex-shrink: 0;
    line-height: 0;
    border-radius: 50%;
    text-decoration: none;
    border: 1px solid rgba(196, 151, 78, 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ig-app-bar__profile:hover {
    border-color: var(--bc-line-strong);
    box-shadow: 0 0 0 2px rgba(240, 200, 136, 0.15);
}

.ig-app-bar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.ig-app-bar__avatar--placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
}

/* — Create post (composer) — */
.ig-compose {
    margin-bottom: 22px;
    border: 1px solid rgba(166, 53, 67, 0.22);
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(22, 10, 14, 0.92), rgba(12, 6, 10, 0.88));
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.ig-create-form {
    display: flex;
    flex-direction: column;
}

.ig-create__top {
    display: flex;
    gap: 12px;
    padding: 14px 14px 10px;
    align-items: flex-start;
}

.ig-create__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(196, 151, 78, 0.35);
    display: block;
}

.ig-create__avatar--placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
    border: 1px solid rgba(196, 151, 78, 0.35);
}

.ig-create__fields {
    flex: 1;
    min-width: 0;
}

.ig-create__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bc-muted);
    margin-bottom: 6px;
}

.ig-create__caption {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(166, 53, 67, 0.25);
    background: rgba(6, 3, 6, 0.65);
    color: #f8eef2;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    min-height: 52px;
}

.ig-create__caption::placeholder {
    color: rgba(209, 183, 191, 0.55);
}

.ig-create__caption:focus {
    outline: none;
    border-color: rgba(196, 151, 78, 0.45);
    box-shadow: 0 0 0 2px rgba(240, 200, 136, 0.12);
}

.ig-create__media {
    position: relative;
    margin: 0 14px;
}

.ig-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ig-file-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 140px;
    padding: 20px 16px;
    border-radius: 10px;
    border: 2px dashed rgba(196, 151, 78, 0.35);
    background: rgba(8, 4, 8, 0.5);
    cursor: pointer;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.ig-file-zone:hover {
    border-color: rgba(228, 198, 141, 0.55);
    background: rgba(14, 8, 12, 0.55);
}

.ig-file-zone--hidden {
    display: none;
}

.ig-file-zone__icon {
    font-size: 2rem;
    font-weight: 300;
    color: var(--bc-gold);
    line-height: 1;
    opacity: 0.9;
}

.ig-file-zone__text {
    font-size: 12px;
    color: var(--bc-muted);
    line-height: 1.45;
    max-width: 280px;
}

.ig-file-zone__text strong {
    color: #ecd4dc;
    font-weight: 700;
}

.ig-file-zone__cta {
    font-size: 13px;
    font-weight: 700;
    color: #c9a86a;
}

.ig-preview {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(166, 53, 67, 0.25);
    background: #050308;
}

.ig-preview__frame {
    aspect-ratio: 1;
    max-height: min(72vw, 420px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-preview__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ig-preview__hint {
    margin: 0;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--bc-muted);
    text-align: center;
    border-top: 1px solid rgba(166, 53, 67, 0.18);
    background: rgba(10, 5, 8, 0.9);
}

.ig-create__actions {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px 14px;
}

.ig-btn-share {
    margin: 0;
    padding: 10px 28px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #1a0a0e;
    background: linear-gradient(135deg, #f0d090, #c9a24a);
    box-shadow: 0 4px 16px rgba(201, 162, 74, 0.35);
    transition:
        transform var(--t-fast) var(--ease-out-smooth),
        box-shadow var(--t-base) var(--ease-out-smooth);
}

.ig-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(201, 162, 74, 0.42);
}

.ig-btn-share:active {
    transform: translateY(0);
}

.ig-feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ig-post {
    padding: 0;
    overflow: hidden;
}

.ig-post--feed.card {
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--bc-line);
    background: linear-gradient(180deg, rgba(16, 18, 26, 0.96), rgba(11, 13, 20, 0.98));
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
    transition:
        border-color var(--t-base) var(--ease-out-smooth),
        box-shadow var(--t-base) var(--ease-out-smooth);
}

/* Avoid gold inset line / edge artifact on feed cards */
.ig-post--feed.card::before {
    display: none;
}

.ig-post--feed.card:hover {
    border-color: var(--bc-line-strong);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
    transform: translateZ(0);
}

.ig-post--feed {
    scroll-margin-top: 88px;
}

.ig-post__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--bc-line);
}

.ig-post__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid var(--bc-line);
    display: block;
    transition: border-color var(--t-fast) var(--ease-out-smooth);
}

.ig-post__avatar--placeholder {
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
    font-weight: 800;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.ig-post__avatar-link {
    flex-shrink: 0;
    line-height: 0;
    border-radius: 50%;
    text-decoration: none;
}

.ig-post__avatar-link:hover .ig-post__avatar {
    border-color: rgba(240, 200, 136, 0.65);
}

.ig-post__meta {
    flex: 1;
    min-width: 0;
}

.ig-post__follow {
    flex-shrink: 0;
    margin-left: 4px;
}

.ig-post__delete-wrap {
    flex-shrink: 0;
    margin-left: auto;
}

.ig-delete-form {
    margin: 0;
}

.ig-post-delete {
    margin: 0;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--bc-muted-2);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        color var(--t-fast) var(--ease-out-smooth),
        background var(--t-fast) var(--ease-out-smooth);
    touch-action: manipulation;
}

.ig-post-delete:hover {
    color: #f0a0a8;
    background: rgba(90, 35, 42, 0.25);
}

.ig-follow-form {
    margin: 0;
}

.ig-follow-btn {
    margin: 0;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(196, 151, 78, 0.55);
    background: linear-gradient(135deg, rgba(200, 155, 85, 0.35), rgba(120, 70, 40, 0.25));
    color: #ffe8c8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background var(--t-fast) var(--ease-out-smooth),
        border-color var(--t-fast) var(--ease-out-smooth),
        color var(--t-fast) var(--ease-out-smooth),
        transform var(--t-fast) var(--ease-out-smooth);
    touch-action: manipulation;
}

.ig-follow-btn:hover:not(:disabled) {
    border-color: rgba(240, 200, 136, 0.75);
    color: #fff8f0;
}

.ig-follow-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.ig-follow-btn--following {
    background: rgba(18, 10, 14, 0.75);
    border-color: rgba(166, 53, 67, 0.35);
    color: var(--bc-muted);
    font-weight: 600;
}

.ig-follow-btn--following:hover:not(:disabled) {
    border-color: rgba(196, 151, 78, 0.4);
    color: #f0e4e8;
}

.ig-post__user {
    display: block;
    font-size: 14px;
    color: #fdf0f4;
}

.ig-post__user-link {
    font-weight: 700;
    text-decoration: none;
    color: #fdf0f4;
}

.ig-post__user-link:hover {
    text-decoration: underline;
    color: #fff;
}

.ig-post__time {
    font-size: 11px;
    color: var(--bc-muted);
}

.ig-post__media {
    background: #050308;
    aspect-ratio: 1;
    max-height: min(92vw, 480px);
}

.ig-post__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ig-post__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 8px 14px 10px;
    flex-wrap: nowrap;
    position: relative;
    z-index: 1;
    background: rgba(8, 5, 9, 0.65);
}

.ig-actions__icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ig-actions__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 44px;
}

/* Like + comment: same chrome as typical IG-style row */
.ig-action-btn {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #f2dce6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    vertical-align: middle;
    touch-action: manipulation;
}

label.ig-action-btn {
    cursor: pointer;
}

.ig-action-btn__inner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid transparent;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.12s ease;
}

.ig-action-btn:hover .ig-action-btn__inner {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

.ig-action-btn:active .ig-action-btn__inner {
    transform: scale(0.94);
}

.ig-action-btn:focus {
    outline: none;
}

.ig-action-btn:focus-visible .ig-action-btn__inner {
    outline: 2px solid rgba(232, 200, 140, 0.55);
    outline-offset: 2px;
}

/* Not display:grid from global `form` — avoids stray gaps / layout glitches */
form.ig-like-form {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0 !important;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: none;
}

.ig-like-form {
    margin: 0;
}

/* Global `button[type="submit"]` purple pill must never apply; like uses type="button" + this reset */
.ig-post .ig-like-form button.ig-action-btn.ig-like-btn {
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    font-size: inherit !important;
    font-weight: 500 !important;
    color: #e8d0da;
}

.ig-post .ig-like-form button.ig-action-btn.ig-like-btn:hover,
.ig-post .ig-like-form button.ig-action-btn.ig-like-btn:active {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-image: none !important;
}

.ig-like-btn {
    color: #e8d0da;
}

.ig-like-btn:hover {
    color: #ffc2d4;
}

.ig-like-btn:disabled {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.ig-like-btn--on {
    color: #ff5c8a;
}

/* Like: sirf heart — bahir wala circle / tint hata diya (touch area padding se) */
.ig-like-btn .ig-action-btn__inner {
    width: auto !important;
    height: auto !important;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    margin: -10px;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ig-like-btn:hover .ig-action-btn__inner,
.ig-like-btn--on .ig-action-btn__inner,
.ig-like-btn--on:hover .ig-action-btn__inner {
    background: transparent !important;
    border: none !important;
}

.ig-like-btn:active .ig-action-btn__inner {
    transform: none !important;
}

.ig-like-btn:focus-visible .ig-action-btn__inner {
    border-radius: 8px;
    outline: 2px solid rgba(232, 200, 140, 0.45);
    outline-offset: 2px;
}

/* Stack hearts so liked/unliked swap does not shift layout or jump size */
.ig-heart--stack {
    position: relative;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: inherit;
}

.ig-heart--stack .ig-heart-svg {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 24px;
    margin: 0;
    display: block;
    overflow: visible;
    shape-rendering: geometricPrecision;
}

.ig-heart--stack .ig-heart-svg--line {
    transform: translate(-50%, -50%);
}

/* Slightly smaller so filled heart matches outline optically */
.ig-heart--stack .ig-heart-svg--solid {
    transform: translate(-50%, -50%) scale(0.9);
}

.ig-heart-svg--hide {
    display: none !important;
}

.ig-action-comment:hover .ig-icon-svg {
    transform: scale(1.05);
}

.ig-icon-svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
    color: inherit;
    shape-rendering: geometricPrecision;
    transition: transform 0.15s ease;
    transform-origin: center center;
}

.ig-like-count {
    font-size: 13px;
    font-weight: 600;
    color: #e8d4dc;
    line-height: 1.25;
    min-height: 1.25em;
    text-align: right;
    white-space: nowrap;
}

.ig-like-count__text--muted {
    color: rgba(209, 183, 191, 0.42);
    font-weight: 500;
}

.ig-post__caption {
    padding: 0 14px 10px;
    font-size: 14px;
    line-height: 1.45;
    color: #f0e4e8;
}

.ig-post__caption strong,
.ig-caption-user {
    margin-right: 6px;
    color: #fff5f8;
    font-weight: 700;
}

.ig-caption-user {
    text-decoration: none;
}

.ig-caption-user:hover {
    text-decoration: underline;
}

.ig-comments-block {
    padding: 0 4px;
    border-top: 1px solid rgba(166, 53, 67, 0.12);
    background: linear-gradient(180deg, rgba(10, 5, 10, 0.35), transparent 48px);
}

.ig-comments-block--bare {
    border-top: none;
    background: none;
    padding: 0;
}

.ig-comments__heading {
    margin: 10px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(209, 183, 191, 0.65);
}

.ig-comments {
    list-style: none;
    margin: 0;
    padding: 4px 10px 10px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--bc-scrollbar-thumb) transparent;
}

.ig-comments::-webkit-scrollbar {
    width: 6px;
}

.ig-comments::-webkit-scrollbar-thumb {
    background: var(--bc-scrollbar-thumb);
    border-radius: 100px;
}

.ig-comments::-webkit-scrollbar-thumb:hover {
    background: var(--bc-scrollbar-thumb-hover);
}

.ig-comment {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 10px;
    color: #e8dce0;
}

.ig-comment:last-child {
    margin-bottom: 4px;
}

.ig-comment__bubble {
    padding: 8px 11px;
    border-radius: 12px;
    background: rgba(22, 12, 18, 0.72);
    border: 1px solid rgba(166, 53, 67, 0.15);
}

.ig-comment__user {
    margin-right: 6px;
    color: #fff5f8;
    font-weight: 700;
    text-decoration: none;
}

.ig-comment__user:hover {
    text-decoration: underline;
}

.ig-comment__text {
    color: #e5d8de;
    word-break: break-word;
}

.ig-comment__time {
    display: block;
    font-size: 10px;
    color: rgba(209, 183, 191, 0.55);
    margin: 5px 4px 0 6px;
}

.ig-comment-compose {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(166, 53, 67, 0.2);
    background: rgba(6, 3, 8, 0.45);
}

.ig-comment-compose__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(196, 151, 78, 0.3);
    display: block;
}

.ig-comment-compose__avatar--placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
    border: 1px solid rgba(196, 151, 78, 0.3);
}

.ig-comment-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
    align-items: center;
    padding: 4px 12px;
    border-radius: 22px;
    border: 1px solid rgba(166, 53, 67, 0.22);
    background: rgba(8, 4, 10, 0.75);
}

.ig-comment-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: #f0e6ea;
    font-family: inherit;
    font-size: 14px;
}

.ig-comment-input::placeholder {
    color: rgba(209, 183, 191, 0.45);
}

.ig-comment-input:focus {
    outline: none;
}

.ig-comment-post {
    flex-shrink: 0;
    padding: 6px 4px 6px 8px;
    margin: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #d4a84a;
    cursor: pointer;
    opacity: 0.95;
    touch-action: manipulation;
}

.ig-comment-post:hover:not(:disabled) {
    color: #f0c888;
}

.ig-comment-post:disabled {
    opacity: 0.45;
    cursor: wait;
}

.ig-empty {
    text-align: center;
    padding: 48px 20px 32px;
    border: 1px dashed rgba(196, 151, 78, 0.28);
    border-radius: 12px;
    background: rgba(8, 4, 8, 0.35);
}

.ig-empty__title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff5f8;
}

.ig-empty__hint {
    margin: 0;
    font-size: 14px;
    color: var(--bc-muted);
    line-height: 1.5;
}

/* —— Profile (Instagram-style) —— */
.profile-page {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.profile-hero {
    margin-bottom: 20px;
}

.profile-hero__row {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-hero__avatar-wrap {
    flex-shrink: 0;
}

.profile-hero__avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(196, 151, 78, 0.45);
    display: block;
}

.profile-hero__avatar--placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(145deg, #4a2840, #2a1820);
    color: var(--bc-gold);
    border: 2px solid rgba(196, 151, 78, 0.45);
}

.profile-hero__info {
    flex: 1;
    min-width: 200px;
}

.profile-hero__name {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 22px;
    margin-bottom: 14px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.profile-stat strong {
    font-size: 1.1rem;
    color: #fff5f8;
}

.profile-stat span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bc-muted);
}

.profile-follow-form {
    margin: 0;
}

.btn-secondary-profile {
    background: linear-gradient(140deg, rgba(60, 40, 50, 0.95), rgba(35, 22, 30, 0.92)) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(196, 151, 78, 0.35) !important;
}

.profile-you {
    margin: 0;
}

.profile-grid-title {
    font-size: 1rem;
    margin: 18px 0 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bc-muted);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.profile-grid__cell-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--bc-line);
    background: #08050a;
}

.profile-grid__cell {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 0;
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-grid__cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
        transform 0.45s var(--ease-out-smooth),
        opacity 0.45s var(--ease-out-smooth);
}

.profile-grid__cell:hover img {
    transform: scale(1.03);
    opacity: 0.94;
}

.profile-grid__delete-form {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    margin: 0;
}

.profile-grid__delete {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.45);
    background: rgba(8, 10, 16, 0.72);
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
    touch-action: manipulation;
}

.profile-grid__delete:hover {
    background: rgba(120, 40, 50, 0.88);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

@media (prefers-reduced-motion: reduce) {
    body.theme-blood-crown::after,
    .bg-crown,
    .intro-card,
    .topbar::after,
    .topbar::before,
    .spark-layer::after,
    .portal-footer::before,
    .portal-spark-rise,
    .portal-spark-fall,
    .hero-banner__bg,
    .hero-banner__glow {
        animation: none !important;
    }

    .reveal-pending {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .card:hover {
        transform: none;
    }

    .ig-explore-cell:hover img,
    .profile-grid__cell:hover img {
        transform: none;
    }

    .ig-bottom-nav__btn:active {
        transform: none;
    }
}

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

    .rank-sidebar {
        position: static;
        max-height: none;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand-block {
        max-width: 100%;
    }

    .topbar > nav {
        width: 100%;
    }

    .portal-footer,
    footer {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .bg-crown {
        opacity: 0.14;
        right: -100px;
        width: min(70vw, 380px);
    }
}

/* —— Police Ranks page (professional roster UI) —— */

@keyframes ranks-ambient-shift {
    0%,
    100% {
        opacity: 0.85;
        transform: translate(-50%, 0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.03);
    }
}

@keyframes ranks-gold-line {
    0%,
    100% {
        opacity: 0.5;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.08);
    }
}

@keyframes ranks-hero-bg-drift {
    0%,
    100% {
        transform: scale(1.06) translate(0, 0);
    }
    50% {
        transform: scale(1.09) translate(-0.6%, 0.4%);
    }
}

@keyframes ranks-row-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.ranks-page {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.ranks-page::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Live roster: must scroll inside sticky column (overflow was hidden on .ranks-roster-panel) */
.ranks-page aside.rank-sidebar.ranks-roster-panel {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--bc-scrollbar-thumb) var(--bc-scrollbar-track);
}

.ranks-page aside.rank-sidebar.ranks-roster-panel::-webkit-scrollbar {
    width: 8px;
}

.ranks-page aside.rank-sidebar.ranks-roster-panel::-webkit-scrollbar-thumb {
    background: var(--bc-scrollbar-thumb);
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.ranks-page aside.rank-sidebar.ranks-roster-panel::-webkit-scrollbar-thumb:hover {
    background: var(--bc-scrollbar-thumb-hover);
    background-clip: padding-box;
    border: 2px solid transparent;
}

.ranks-page aside.rank-sidebar.ranks-roster-panel::-webkit-scrollbar-track {
    background: var(--bc-scrollbar-track);
    border-radius: 6px;
}

.ranks-page.container {
    position: relative;
    padding-bottom: 2.5rem;
}

.ranks-page__ambient {
    pointer-events: none;
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: min(920px, 120%);
    height: 420px;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(145, 28, 48, 0.22), transparent 72%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(90, 40, 140, 0.12), transparent 65%);
    animation: ranks-ambient-shift 14s ease-in-out infinite;
}

.ranks-page .ranks-hero,
.ranks-page .ranks-page__grid {
    position: relative;
    z-index: 1;
}

.ranks-hero {
    min-height: 220px;
    margin-bottom: 24px;
    border: 1px solid var(--bc-line-strong);
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(240, 200, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ranks-page .ranks-hero .page-banner__bg {
    animation: ranks-hero-bg-drift 28s ease-in-out infinite;
}

.ranks-hero__scrim {
    background: linear-gradient(
        115deg,
        rgba(6, 3, 8, 0.94) 0%,
        rgba(18, 8, 14, 0.72) 42%,
        rgba(40, 14, 28, 0.55) 72%,
        rgba(8, 4, 10, 0.65) 100%
    );
}

.ranks-hero__inner {
    padding: 26px 28px 24px;
}

.ranks-hero__eyebrow {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bc-gold);
    opacity: 0.92;
}

.ranks-hero__eyebrow::after {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin-top: 12px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--bc-gold), rgba(240, 200, 136, 0.15), transparent);
    transform-origin: left center;
    animation: ranks-gold-line 4s ease-in-out infinite;
}

.ranks-hero__title {
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: #fdf7f2;
    text-shadow:
        0 0 48px rgba(200, 120, 70, 0.28),
        0 2px 24px rgba(0, 0, 0, 0.55);
}

.ranks-hero__meta {
    margin-top: 4px;
    font-size: 0.95rem;
    color: rgba(252, 238, 244, 0.88);
}

.ranks-hero__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(240, 200, 136, 0.22);
}

.ranks-hero__pill {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 16px 12px;
    border-radius: 12px;
    border: 1px solid rgba(240, 200, 136, 0.22);
    background: linear-gradient(160deg, rgba(240, 200, 136, 0.1), rgba(20, 8, 14, 0.65));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ranks-hero__pill--dim {
    border-color: rgba(196, 151, 78, 0.12);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(12, 6, 10, 0.55));
}

.ranks-hero__pill-k {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--bc-gold);
    line-height: 1.1;
}

.ranks-hero__pill--dim .ranks-hero__pill-k {
    font-size: 1.1rem;
    color: #e8c896;
}

.ranks-hero__pill-v {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bc-muted);
}

.ranks-page__grid {
    gap: 22px;
    align-items: start;
}

.ranks-roster-panel {
    padding: 0;
    /* overflow-y set on .ranks-page aside.rank-sidebar.ranks-roster-panel — do not clip here */
    border: 1px solid var(--bc-line-strong);
    background: linear-gradient(165deg, rgba(22, 10, 16, 0.95), rgba(12, 6, 10, 0.92));
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
}

.ranks-roster-panel__head {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(196, 151, 78, 0.18);
    background: linear-gradient(180deg, rgba(240, 200, 136, 0.08), transparent);
    position: relative;
    overflow: hidden;
}

.ranks-roster-panel__head::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 100% 0%, rgba(138, 84, 222, 0.12), transparent 70%);
    pointer-events: none;
}

.ranks-roster-panel__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--bc-text);
    letter-spacing: 0.02em;
}

.ranks-roster-panel__sub {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--bc-muted);
}

.ranks-roster-panel .ranks-details,
.ranks-roster-panel details {
    margin: 0 12px 10px;
    border: 1px solid rgba(196, 151, 78, 0.16);
    border-radius: 12px;
    background: rgba(8, 4, 8, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ranks-roster-panel .ranks-details:first-of-type,
.ranks-roster-panel details:first-of-type {
    margin-top: 12px;
}

.ranks-roster-panel summary {
    padding: 12px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #f5ebe8;
    position: relative;
    padding-right: 36px;
    border-radius: 11px 11px 0 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.ranks-roster-panel summary:hover {
    background: rgba(240, 200, 136, 0.05);
}

.ranks-roster-panel summary:focus-visible {
    outline: 2px solid var(--bc-gold);
    outline-offset: 2px;
}

.ranks-roster-panel summary::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--bc-gold-dim);
    border-bottom: 2px solid var(--bc-gold-dim);
    transform: rotate(45deg);
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.ranks-roster-panel details[open] summary::after {
    transform: rotate(-135deg);
    margin-top: -2px;
}

.ranks-roster-panel .rank-list {
    border-top: 1px solid rgba(196, 151, 78, 0.12);
    padding: 10px 10px 12px;
    background: rgba(0, 0, 0, 0.12);
}

.ranks-roster-panel .rank-row {
    border: 1px solid rgba(138, 84, 222, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: linear-gradient(145deg, rgba(20, 12, 22, 0.9), rgba(10, 6, 12, 0.88));
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.ranks-roster-panel .rank-row:last-child {
    margin-bottom: 0;
}

.ranks-roster-panel .rank-row--person {
    animation: ranks-row-in 0.45s ease backwards;
}

.ranks-roster-panel .rank-row--person:nth-child(1) {
    animation-delay: 0.03s;
}

.ranks-roster-panel .rank-row--person:nth-child(2) {
    animation-delay: 0.07s;
}

.ranks-roster-panel .rank-row--person:nth-child(3) {
    animation-delay: 0.11s;
}

.ranks-roster-panel .rank-row--person:nth-child(4) {
    animation-delay: 0.15s;
}

.ranks-roster-panel .rank-row--person:nth-child(5) {
    animation-delay: 0.19s;
}

.ranks-roster-panel .rank-row--person:nth-child(6) {
    animation-delay: 0.23s;
}

.ranks-roster-panel .rank-row--person:nth-child(7) {
    animation-delay: 0.27s;
}

.ranks-roster-panel .rank-row--person:nth-child(8) {
    animation-delay: 0.31s;
}

.ranks-roster-panel .rank-row--person:hover {
    border-color: rgba(240, 200, 136, 0.32);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(240, 200, 136, 0.08);
    transform: translateY(-2px);
}

.ranks-roster-panel .rank-row--empty {
    border-style: dashed;
    opacity: 0.85;
}

.ranks-roster-panel .rank-row--empty span {
    color: var(--bc-muted);
    font-style: italic;
    font-size: 0.82rem;
}

.ranks-roster-panel .rank-row__body strong {
    color: var(--bc-gold);
    font-size: 0.9rem;
    font-weight: 700;
}

.ranks-roster-panel .rank-row__body span {
    color: #dcc8d8;
    font-size: 0.84rem;
}

.ranks-roster-panel .rank-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.rank-badge-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--bc-gold);
    background: rgba(240, 200, 136, 0.12);
    border: 1px solid rgba(240, 200, 136, 0.28);
}

.rank-row__ranktag {
    font-size: 0.8rem !important;
    color: #cbb8d0 !important;
    font-weight: 500;
}

.ranks-roster-panel .rank-avatar,
.ranks-roster-panel .rank-avatar--placeholder {
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.ranks-roster-panel__foot {
    margin: 0;
    padding: 14px 18px 18px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--bc-muted);
    border-top: 1px solid rgba(196, 151, 78, 0.1);
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ranks-roster-panel__foot-icon {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--bc-gold-dim);
    box-shadow: 0 0 12px rgba(240, 200, 136, 0.45);
}

.ranks-ladder-card {
    border: 1px solid var(--bc-line-strong);
    padding: 0;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(26, 12, 20, 0.96), rgba(14, 8, 12, 0.93));
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ranks-ladder-card__head {
    display: flex;
    gap: 16px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(196, 151, 78, 0.12);
    background: linear-gradient(180deg, rgba(138, 84, 222, 0.06), transparent);
}

.ranks-ladder-card__accent {
    width: 4px;
    min-height: 72px;
    border-radius: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bc-gold), rgba(138, 84, 222, 0.75), rgba(91, 47, 155, 0.5));
    box-shadow: 0 0 20px rgba(240, 200, 136, 0.2);
}

.ranks-ladder-card__title {
    margin: 0 0 8px;
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ranks-ladder-card__lead {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--bc-muted);
}

.ranks-ladder-wrap {
    position: relative;
    padding: 18px 20px 8px 24px;
}

.ranks-ladder-wrap::before {
    content: "";
    position: absolute;
    left: 39px;
    top: 24px;
    bottom: 28px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(
        180deg,
        rgba(240, 200, 136, 0.45),
        rgba(138, 84, 222, 0.35) 45%,
        rgba(240, 200, 136, 0.15) 100%
    );
    opacity: 0.85;
}

.ranks-ladder {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    counter-reset: ranks-step;
    position: relative;
    z-index: 1;
}

.ranks-ladder li {
    counter-increment: ranks-step;
    position: relative;
    padding: 12px 14px 12px 52px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid rgba(196, 151, 78, 0.14);
    background: linear-gradient(125deg, rgba(12, 8, 16, 0.9), rgba(20, 10, 18, 0.75));
    font-size: 0.86rem;
    line-height: 1.45;
    color: #e8dce4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.ranks-ladder li:hover {
    border-color: rgba(240, 200, 136, 0.22);
    transform: translateX(3px);
}

.ranks-ladder li::before {
    content: counter(ranks-step, decimal-leading-zero);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--bc-gold);
    background: linear-gradient(145deg, rgba(40, 18, 28, 0.95), rgba(20, 10, 16, 0.98));
    border: 1px solid rgba(240, 200, 136, 0.35);
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    z-index: 2;
}

.ranks-ladder__step {
    display: block;
    font-weight: 700;
    color: var(--bc-gold);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ranks-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    max-width: 340px;
    margin: 0;
    flex: 1 1 220px;
    text-decoration: none;
    padding: 14px 22px;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(240, 200, 136, 0.26), rgba(91, 47, 155, 0.38));
    border: 1px solid var(--bc-line-strong);
    color: var(--bc-gold) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        gap 0.2s ease;
}

.ranks-cta__arrow {
    font-size: 1.1rem;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ranks-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(40, 12, 24, 0.48);
    gap: 16px;
}

.ranks-cta:hover .ranks-cta__arrow {
    transform: translateX(4px);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .ranks-page__ambient,
    .ranks-page .ranks-hero .page-banner__bg,
    .ranks-hero__eyebrow::after {
        animation: none;
    }

    .ranks-roster-panel .rank-row--person {
        animation: none;
    }

    .ranks-roster-panel .rank-row--person:hover,
    .ranks-ladder li:hover,
    .ranks-cta:hover {
        transform: none;
    }

    .ranks-cta:hover .ranks-cta__arrow {
        transform: none;
    }
}

@media (max-width: 840px) {
    .ranks-hero__inner {
        padding: 20px 18px 18px;
    }

    .ranks-hero__stats {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ranks-ladder-wrap::before {
        left: 36px;
    }

    .ranks-ladder-card__head {
        flex-direction: column;
        gap: 12px;
    }

    .ranks-ladder-card__accent {
        min-height: 4px;
        width: 48px;
    }

    .ranks-cta-row {
        margin: 0 16px 18px;
    }

    .ranks-cta-row .ranks-cta {
        width: 100%;
        max-width: none;
    }
}

/* —— Ranks “bento” refresh (calmer, editorial) —— */
.ranks-page--bento .ranks-page__ambient {
    display: none;
}

.ranks-page--bento .ranks-hero {
    border-radius: 18px;
    border: 1px solid rgba(94, 196, 196, 0.22);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ranks-page--bento .ranks-hero__scrim {
    background: linear-gradient(
        125deg,
        rgba(4, 18, 22, 0.93) 0%,
        rgba(12, 8, 20, 0.78) 50%,
        rgba(20, 8, 14, 0.72) 100%
    );
}

.ranks-page--bento .ranks-hero__eyebrow {
    color: #7fd4d4;
}

.ranks-page--bento .ranks-hero__eyebrow::after {
    background: linear-gradient(90deg, #5ec4c4, rgba(240, 200, 136, 0.35), transparent);
    animation: none;
}

.ranks-page--bento .page-banner__bg {
    animation: none;
}

.ranks-page--bento .ranks-hero__pill-k {
    color: #e8f4f4;
}

.ranks-page--bento .ranks-roster-panel {
    border-color: rgba(94, 196, 196, 0.2);
}

.ranks-page--bento .ranks-ladder-card__accent {
    background: linear-gradient(180deg, #5ec4c4, rgba(138, 84, 222, 0.65));
}

.ranks-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 22px 22px;
    align-items: center;
}

.ranks-cta--secondary {
    max-width: none;
    margin: 0;
    width: auto;
    flex: 1 1 200px;
    justify-content: center;
    background: transparent !important;
    border-color: rgba(94, 196, 196, 0.35) !important;
    color: #aee8e8 !important;
    box-shadow: none !important;
}

.ranks-cta--secondary:hover {
    border-color: rgba(240, 200, 136, 0.45) !important;
    color: var(--bc-gold) !important;
}

@media (max-width: 840px) {
    .ranks-cta-row {
        margin: 0 16px 18px;
        flex-direction: column;
    }

    .ranks-cta--secondary {
        width: 100%;
    }
}

/* —— PD Rules page —— */
.rules-page .topbar {
    border-bottom-color: var(--bc-line);
}

.rules-shell {
    max-width: 920px;
    margin-bottom: 2.5rem;
}

.rules-hero {
    display: grid;
    gap: 20px;
    padding: 28px 26px;
    margin-bottom: 24px;
    border-radius: 18px;
    border: 1px solid rgba(94, 196, 196, 0.25);
    background: linear-gradient(145deg, rgba(12, 22, 28, 0.92), rgba(18, 10, 18, 0.94));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

@media (min-width: 640px) {
    .rules-hero {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }
}

.rules-hero__badge {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #0a1214;
    background: linear-gradient(145deg, #7fd4d4, #5ec4c4);
    box-shadow: 0 8px 28px rgba(94, 196, 196, 0.25);
}

.rules-hero__eyebrow {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7fd4d4;
}

.rules-hero__title {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    font-weight: 800;
    line-height: 1.15;
}

.rules-hero__lead {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--bc-muted);
    max-width: 46ch;
}

.rules-hero__cta {
    align-self: center;
    white-space: nowrap;
}

.rules-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 800px) {
    .rules-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* One column + centered (overrides two-column .rules-grid on wide screens) */
.rules-grid.rules-grid--single {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.rules-card--brpd-full {
    max-width: none;
}

.rules-card {
    border-radius: 16px;
    padding: 22px 22px 20px;
    border: 1px solid var(--bc-line);
    background: linear-gradient(160deg, rgba(20, 12, 22, 0.92), rgba(10, 6, 12, 0.9));
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.rules-card--pd {
    border-color: rgba(94, 196, 196, 0.22);
}

.rules-card--rp {
    border-color: rgba(196, 151, 78, 0.22);
}

.rules-card__title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rules-card__icon {
    opacity: 0.65;
    color: #5ec4c4;
}

.rules-card--rp .rules-card__icon {
    color: var(--bc-gold);
}

.rules-card__intro {
    margin: 0 0 18px;
    font-size: 0.86rem;
    color: var(--bc-muted);
    line-height: 1.45;
}

.rules-block {
    margin-bottom: 18px;
}

.rules-block:last-child {
    margin-bottom: 0;
}

.rules-block__h {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bc-gold);
}

.rules-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #e4d8e0;
    font-size: 0.88rem;
    line-height: 1.55;
}

.rules-list li {
    margin-bottom: 8px;
}

.rules-list li:last-child {
    margin-bottom: 0;
}

/* Short “CODE — one line” rule rows (BRPD rules page) */
.rules-short-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rules-short {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(94, 196, 196, 0.14);
    background: rgba(8, 5, 12, 0.45);
    font-size: 0.86rem;
    line-height: 1.45;
    color: #e8dce2;
}

.rules-short:last-child {
    margin-bottom: 0;
}

.rules-short__code {
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #7fd4d4;
    flex: 0 0 auto;
}

.rules-short__sep {
    color: rgba(196, 151, 78, 0.55);
    flex: 0 0 auto;
    user-select: none;
}

.rules-short__text {
    flex: 1 1 12rem;
    min-width: 0;
    color: rgba(240, 228, 234, 0.92);
}

.rules-block--short .rules-block__h {
    margin-top: 4px;
}

.rules-block--short:first-of-type .rules-block__h {
    margin-top: 0;
}

.rules-list--check {
    list-style: none;
    padding-left: 0;
}

.rules-list--check li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
}

.rules-list--check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #5ec4c4;
    font-weight: 800;
}

.rules-notice {
    border-radius: 16px;
    padding: 22px 24px;
    border: 1px solid rgba(240, 200, 136, 0.22);
    background: linear-gradient(145deg, rgba(40, 18, 28, 0.5), rgba(12, 8, 14, 0.88));
}

.rules-notice__title {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.rules-notice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.btn-ghost-rules {
    background: transparent !important;
    border: 1px solid var(--bc-line-strong) !important;
    color: var(--bc-muted) !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0.03em !important;
}

.btn-ghost-rules:hover {
    border-color: rgba(201, 168, 122, 0.45) !important;
    color: var(--bc-text) !important;
}

/* —— Join BRPD application (recruitment UI) —— */
.join-page .join-shell {
    max-width: 720px;
    margin-bottom: 2.5rem;
}

.join-hero {
    margin-bottom: 20px;
    padding: 22px 22px 20px;
    border-radius: 16px;
    border: 1px solid rgba(94, 196, 196, 0.22);
    background: linear-gradient(145deg, rgba(14, 22, 26, 0.9), rgba(16, 10, 18, 0.92));
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

.join-hero__eyebrow {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7fd4d4;
}

.join-hero__title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 800;
}

.join-hero__lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--bc-muted);
}

.join-hero__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.join-hero__btn {
    margin: 0;
}

.join-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    counter-reset: joinstep;
}

.join-steps__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bc-muted);
    border: 1px solid var(--bc-line);
    background: rgba(0, 0, 0, 0.2);
}

.join-steps__item span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.06);
    color: var(--bc-muted);
}

.join-steps__item--on {
    border-color: rgba(94, 196, 196, 0.4);
    color: #c8f0f0;
}

.join-steps__item--on span {
    background: rgba(94, 196, 196, 0.25);
    color: #e8fffe;
}

.join-notice {
    margin-bottom: 16px;
}

.join-notice--ok {
    border: 1px solid rgba(100, 180, 120, 0.45);
    background: rgba(30, 60, 40, 0.35);
    padding: 12px 16px;
    border-radius: 12px;
}

.join-notice--err {
    border: 1px solid rgba(200, 90, 90, 0.45);
    background: rgba(60, 20, 28, 0.35);
    padding: 12px 16px;
    border-radius: 12px;
}

.join-error-list {
    margin: 8px 0 0;
    padding-left: 1.2rem;
}

.join-card {
    padding: 0;
    overflow: hidden;
}

.join-section {
    padding: 22px 22px 20px;
    border-bottom: 1px solid rgba(196, 151, 78, 0.12);
}

.join-section:last-of-type {
    border-bottom: none;
}

.join-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.join-section__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
}

.join-section__hint {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: var(--bc-muted);
    line-height: 1.45;
}

.join-newq {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7fd4d4;
    text-decoration: none;
    white-space: nowrap;
}

.join-newq:hover {
    text-decoration: underline;
}

.join-rules {
    display: grid;
    gap: 10px;
}

.join-rule-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(94, 196, 196, 0.15);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.join-rule-row:hover {
    border-color: rgba(94, 196, 196, 0.3);
}

.join-rule-row input {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #5ec4c4;
}

.join-rule-row__text {
    font-size: 0.86rem;
    line-height: 1.45;
    color: #eadde4;
}

.join-quiz-item {
    margin-bottom: 16px;
}

.join-quiz-item:last-child {
    margin-bottom: 0;
}

.join-quiz-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.45;
    color: #f0e4ea;
}

.join-quiz-item textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
}

.join-fields {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

.join-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.join-field--narrow {
    max-width: 140px;
}

.join-field--full {
    grid-column: 1 / -1;
}

.join-field__l {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bc-muted);
}

.join-submit-row {
    padding: 18px 22px 22px;
    background: rgba(0, 0, 0, 0.18);
}

.join-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 800;
}

@media (max-width: 560px) {
    .join-fields {
        grid-template-columns: 1fr;
    }

    .join-field--narrow {
        max-width: none;
    }
}
