:root {
    --bg: #101713;
    --panel: rgba(24, 33, 27, 0.88);
    --panel-strong: rgba(18, 24, 20, 0.94);
    --panel-border: rgba(173, 196, 164, 0.18);
    --text: #e6efe6;
    --muted: #a4b4a3;
    --accent: #93c572;
    --accent-dark: #5d8a47;
    --danger: #cb6b63;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Rajdhani", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(110, 148, 78, 0.12), transparent 25%),
        linear-gradient(180deg, #162019 0%, #0d120f 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.45;
}

body::before {
    width: 320px;
    height: 320px;
    top: 8%;
    left: -80px;
    background: rgba(147, 197, 114, 0.18);
    animation: floatOrbA 16s ease-in-out infinite;
}

body::after {
    width: 420px;
    height: 420px;
    right: -140px;
    bottom: 8%;
    background: rgba(96, 132, 77, 0.16);
    animation: floatOrbB 20s ease-in-out infinite;
}

body.lightbox-open {
    overflow: hidden;
}

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

img {
    max-width: 100%;
    display: block;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5vw;
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(11, 16, 13, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 20;
    animation: slideDown 700ms ease;
}

.logo,
h1,
h2,
h3 {
    font-family: "Cinzel", serif;
}

.logo {
    font-size: 1.35rem;
    letter-spacing: 0.08em;
}

.nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.page {
    padding: 28px 5vw 64px;
}

.hero,
.two-column,
.admin-grid,
.build-hero,
.profile-columns,
.profile-main {
    display: grid;
    gap: 24px;
}

.hero {
    grid-template-columns: 1.4fr 0.9fr;
    align-items: center;
    min-height: 68vh;
    position: relative;
    --hero-shift-x: 0px;
    --hero-shift-y: 0px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 8% 18% 10% -4%;
    border-radius: 34px;
    background:
        radial-gradient(circle at 18% 22%, rgba(147, 197, 114, 0.12) 0%, transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(147, 197, 114, 0.05));
    transform: translate(var(--hero-shift-x), var(--hero-shift-y));
    transition: transform 240ms ease-out;
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 1.05;
    margin: 0 0 16px;
    animation: heroTitleIn 950ms cubic-bezier(.16,.84,.32,1) both;
}

.hero-copy p,
.panel p {
    color: var(--muted);
}

.hero-card,
.panel,
.build-card,
.profile-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
    transform-style: preserve-3d;
}

.hero-card,
.panel,
.profile-card {
    padding: 24px;
}

.feature-list,
.detail-list,
.profile-meta,
.profile-stat-grid,
.tag-list,
.table-list {
    display: grid;
    gap: 10px;
}

.hero-actions,
.section-heading,
.build-card-topline,
.build-card-actions,
.profile-actions,
.admin-inline-actions,
.comment-head,
.comment-author,
.comment-score,
.inline-badges {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.button-link,
.like-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.primary-button,
.button-link {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #0d120f;
}

.secondary-button,
.like-button {
    background: transparent;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.16);
}

.primary-button:hover,
.secondary-button:hover,
.button-link:hover,
.like-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
}

.danger-button {
    background: rgba(203, 107, 99, 0.16);
    color: #ffd8d5;
    border-color: rgba(203, 107, 99, 0.4);
}

.like-button.liked {
    background: rgba(147, 197, 114, 0.18);
    border-color: rgba(147, 197, 114, 0.42);
}

.text-link {
    color: var(--accent);
    font-weight: 700;
}

.section-heading {
    margin: 24px 0 18px;
}

.eyebrow,
.meta {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
    color: #b8c8b5;
}

.card-grid,
.gallery-grid,
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 420px));
    gap: 22px;
    align-items: start;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.profile-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
}

.build-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(24, 33, 27, 0.95) 0%, rgba(19, 27, 22, 0.95) 100%);
    will-change: transform;
}

.build-card:hover,
.panel:hover,
.profile-card:hover,
.hero-card:hover {
    transform: translateY(-4px);
    border-color: rgba(147, 197, 114, 0.24);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.hero-copy,
.hero-card {
    position: relative;
    z-index: 1;
}

.hero-copy .eyebrow,
.hero-copy p,
.hero-actions {
    animation: heroFadeUp 900ms cubic-bezier(.16,.84,.32,1) both;
}

.hero-copy p {
    animation-delay: 80ms;
}

.hero-actions {
    animation-delay: 160ms;
}

.hero-card {
    animation: heroCardIn 1s cubic-bezier(.16,.84,.32,1) both;
    animation-delay: 120ms;
}

.build-card-media img,
.build-card img {
    height: 260px;
    width: 100%;
    object-fit: cover;
    transition: transform 320ms ease, filter 320ms ease;
}

.build-card:hover .build-card-media img {
    transform: scale(1.045);
    filter: saturate(1.06) contrast(1.04);
}

.gallery-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 9, 0.72);
    box-shadow: var(--shadow);
    padding: 0;
    cursor: zoom-in;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 240ms ease;
}

.gallery-card:hover img {
    transform: scale(1.03);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background: rgba(3, 6, 4, 0.88);
    backdrop-filter: blur(8px);
}

.lightbox.is-open {
    display: flex;
    animation: fadeLift 220ms ease forwards;
}

.lightbox-image {
    max-width: min(92vw, 1400px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(10, 14, 11, 0.84);
    color: var(--text);
    cursor: pointer;
}

.build-card-content {
    padding: 18px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.build-card h3,
.profile-mini-card h2,
.profile-mini-card h3,
.admin-record-card h3 {
    margin: 0;
}

.chip,
.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(147, 197, 114, 0.12);
    border: 1px solid rgba(147, 197, 114, 0.24);
    color: #dce9d7;
    font-size: 0.88rem;
}

.chip.feature {
    background: rgba(255, 210, 92, 0.14);
    border-color: rgba(255, 210, 92, 0.34);
    color: #ffe4a6;
}

.chip.warning {
    background: rgba(203, 107, 99, 0.14);
    border-color: rgba(203, 107, 99, 0.34);
    color: #ffd8d5;
}

.tag-list {
    grid-template-columns: repeat(auto-fit, minmax(90px, max-content));
}

.build-cover {
    width: min(100%, 780px);
    height: 100%;
    min-height: 420px;
    border-radius: 22px;
    object-fit: cover;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.build-hero {
    align-items: stretch;
}

.build-hero.detailed {
    grid-template-columns: 1.15fr 0.85fr;
}

.build-overview h1 {
    margin-bottom: 10px;
}

.detail-list.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-shell {
    max-width: 960px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(8, 12, 9, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cover-preview-shell {
    display: grid;
    gap: 12px;
}

.cover-preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 9, 0.72);
}

.cover-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.cover-preview-image.is-visible {
    display: block;
}

.cover-preview-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    padding: 20px;
    text-align: center;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

input[type="range"] {
    padding: 0;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    background: rgba(8, 12, 9, 0.72);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.flash {
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.flash.success {
    background: rgba(103, 159, 86, 0.18);
    border: 1px solid rgba(147, 197, 114, 0.4);
}

.flash.error {
    background: rgba(162, 78, 78, 0.18);
    border: 1px solid rgba(203, 107, 99, 0.4);
}

.profile-shell {
    position: relative;
    margin-bottom: 32px;
}

.profile-banner {
    height: 220px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--banner), white 8%) 0%, var(--banner) 100%);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: bannerGlow 9s ease-in-out infinite alternate;
}

.profile-card {
    margin: -70px auto 0;
    width: min(100%, 1120px);
    position: relative;
    display: grid;
    gap: 20px;
}

.profile-main {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.avatar {
    width: 132px;
    height: 132px;
    border-radius: 24px;
    object-fit: cover;
    border: 4px solid var(--accent);
}

.avatar.small {
    width: 84px;
    height: 84px;
    border-radius: 18px;
}

.avatar.tiny {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border-width: 2px;
}

.profile-title {
    color: var(--accent);
    font-size: 1.15rem;
    margin: 0;
}

.profile-headline {
    color: #dfe8df;
    font-size: 1.04rem;
    margin-top: 4px;
}

.profile-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.profile-stat-grid span {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(8, 12, 9, 0.45);
}

.quote-box {
    margin: 18px 0 0;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    background: rgba(8, 12, 9, 0.45);
    color: #d8e7d4;
}

.profile-mini-card {
    display: grid;
    gap: 12px;
}

.admin-hero,
.admin-dashboard,
.admin-column,
.admin-kpi-grid,
.admin-card-list,
.admin-form-stack,
.admin-log-list {
    display: grid;
    gap: 18px;
}

.admin-hero {
    grid-template-columns: 1.2fr auto;
    align-items: end;
    padding: 8px 0 18px;
}

.admin-hero h1 {
    margin: 6px 0 10px;
}

.admin-hero p:not(.eyebrow) {
    max-width: 760px;
}

.admin-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 24px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: auto -30% -40% auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(147, 197, 114, 0.16) 0%, transparent 68%);
    pointer-events: none;
}

.kpi-card h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.admin-dashboard {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    align-items: start;
}

.admin-column.wide {
    min-width: 0;
}

.admin-panel {
    background:
        linear-gradient(180deg, rgba(25, 35, 28, 0.94) 0%, rgba(18, 25, 20, 0.94) 100%);
}

.admin-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-record-card,
.admin-log-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(8, 12, 9, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.admin-record-card:hover,
.admin-log-card:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 197, 114, 0.22);
    background: rgba(10, 14, 11, 0.62);
}

.admin-record-card.compact {
    gap: 12px;
}

.admin-record-top,
.admin-record-badges,
.admin-inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.admin-inline-form select {
    max-width: 280px;
}

.admin-form-stack {
    gap: 12px;
    margin-top: 14px;
}

.admin-content-preview {
    margin: 0;
}

.admin-log-list,
.admin-card-list {
    gap: 14px;
}

.reveal,
.stagger-item {
    opacity: 0;
    transform: translateY(22px);
}

.js-ready .reveal.is-visible {
    animation: fadeLift 700ms cubic-bezier(.18, .84, .32, 1) forwards;
}

.js-ready .stagger-item.is-visible {
    animation: fadeLift 700ms cubic-bezier(.18, .84, .32, 1) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

@keyframes fadeLift {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatOrbA {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(45px, 30px, 0); }
}

@keyframes floatOrbB {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-40px, -35px, 0); }
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.985);
        letter-spacing: 0.02em;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: 0;
    }
}

@keyframes heroCardIn {
    from {
        opacity: 0;
        transform: translateY(26px) rotateX(7deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes bannerGlow {
    from {
        box-shadow: inset 0 0 0 rgba(147, 197, 114, 0), 0 0 0 rgba(147, 197, 114, 0);
    }
    to {
        box-shadow: inset 0 0 50px rgba(147, 197, 114, 0.06), 0 0 30px rgba(147, 197, 114, 0.04);
    }
}

.search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-grid {
    grid-template-columns: 1.3fr 1fr;
}

.admin-row,
.admin-subrow {
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-row {
    grid-template-columns: 1fr 220px auto;
}

.admin-build-stack {
    display: grid;
    gap: 8px;
}

.admin-comment-card,
.admin-log-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.comment-list {
    display: grid;
    gap: 16px;
}

.comment-card {
    display: grid;
    gap: 14px;
}

.comment-hidden {
    opacity: 0.75;
    border-color: rgba(203, 107, 99, 0.35);
}

.comment-form-panel {
    margin-bottom: 18px;
}

.admin-inline-actions {
    justify-content: flex-start;
}

.admin-stats .panel h2 {
    margin: 0;
    font-size: 2rem;
}

@media (max-width: 980px) {
    .hero,
    .two-column,
    .admin-grid,
    .build-hero.detailed,
    .profile-columns,
    .admin-hero,
    .admin-dashboard {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-row,
    .profile-main {
        grid-template-columns: 1fr;
    }

    .admin-hero-actions {
        justify-content: flex-start;
    }

    .focus-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
    }

    .nav {
        justify-content: flex-start;
    }
}
