body {
    background-color: #070709;
    color: #e2e8f0;
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
}

.clip-corner {
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.clip-corner-lg {
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.clip-btn {
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.glass-panel {
    background: rgba(20, 23, 34, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 42, 42, 0.25);
}

.gradient-red-text {
    background: linear-gradient(135deg, #ffffff 0%, #ff2a2a 55%, #b21818 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-silver-text {
    background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mission-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 18px 18px;
}

::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #070709;
}

::-webkit-scrollbar-thumb {
    background: #b21818;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff2a2a;
}

#home-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

#history-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@keyframes pulseGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 15px rgba(255, 42, 42, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 35px rgba(255, 42, 42, 0.9));
    }
}

.glow-pulse {
    animation: pulseGlow 3s infinite ease-in-out;
}

.roster-rank-section {
    padding: 1.5rem;
    border: 1px solid rgba(255, 42, 42, 0.28);
    background: linear-gradient(135deg, rgba(20, 23, 34, 0.92), rgba(7, 7, 9, 0.88));
    box-shadow: inset 0 0 32px rgba(255, 42, 42, 0.035);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.roster-rank-header {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: stretch;
    gap: 1.5rem;
}

.roster-rank-sidebar {
    display: grid;
    min-height: 352px;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
}

.rank-insignia-frame {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.rank-insignia-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.rank-description {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 1rem 0.85rem;
    border: 1px solid rgba(142, 154, 176, 0.18);
    background: rgba(7, 7, 9, 0.45);
    color: #cbd5e1;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    letter-spacing: normal;
    line-height: 1.45;
    text-align: center;
    text-transform: none;
}

.roster-rank-content {
    min-width: 0;
}

.member-card {
    position: relative;
    display: block;
    flex: 0 0 230px;
    height: 276px;
    padding: 0;
    border: 0;
    perspective: 1000px;
    appearance: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.member-card:focus-visible {
    outline: 2px solid #ff2a2a;
    outline-offset: 4px;
}

.member-card-inner {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transition: transform 550ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.member-card.is-flipped .member-card-inner {
    transform: rotateY(180deg);
}

.member-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(255, 42, 42, 0.32);
    background: linear-gradient(145deg, rgba(20, 23, 34, 0.98), rgba(7, 7, 9, 0.98));
    box-shadow: inset 0 0 30px rgba(255, 42, 42, 0.05);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.member-card:hover .member-card-face,
.member-card:focus-visible .member-card-face {
    border-color: rgba(255, 42, 42, 0.8);
    box-shadow: inset 0 0 35px rgba(255, 42, 42, 0.1), 0 0 18px rgba(255, 42, 42, 0.12);
}

.member-card-front {
    align-items: center;
    text-align: center;
}

.member-card-back {
    transform: rotateY(180deg);
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: #b21818 #070709;
    scrollbar-width: thin;
    touch-action: pan-y;
}

.member-card-back > * {
    flex-shrink: 0;
}

.member-username,
.member-back-username {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.member-card-hint {
    margin-top: 1rem;
    color: #8e9ab0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.member-back-username {
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(255, 42, 42, 0.35);
    font-size: 0.9rem;
}

.member-details {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.member-detail dt {
    color: #ff2a2a;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.member-detail dd {
    margin-top: 0.15rem;
    color: #cbd5e1;
    font-size: 0.85rem;
    line-height: 1.25;
}

.member-card-track {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.35rem 0.25rem 1rem;
    cursor: grab;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.25rem;
    scrollbar-color: #b21818 #070709;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}

.member-card-track .member-card {
    scroll-snap-align: start;
}

.member-card-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.member-card-track.is-dragging .member-card {
    pointer-events: none;
}

@media (max-width: 767px) {
    .roster-rank-section {
        padding: 1rem;
    }

    .roster-rank-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .roster-rank-sidebar {
        min-height: 0;
        grid-template-rows: 108px auto;
    }

    .rank-insignia-frame {
        min-height: auto;
        height: 108px;
    }

    .member-card {
        flex-basis: 210px;
        height: 260px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-side-nav,
    .home-side-nav .home-nav-label,
    .member-card-inner,
    .member-card-face {
        transition-duration: 0.01ms;
    }
}
