/* ==========================================
   Solid Liquid - Custom Styles
   Space Theme with Neon Accents
   ========================================== */

/* Base Styles */
* {
    scrollbar-width: thin;
    scrollbar-color: #00f5ff #12121a;
}

*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-track {
    background: #12121a;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f5ff, #00ff88);
    border-radius: 4px;
}

/* Avatars: custom sprites drop the default gradient so the parallax background shows through. */
.avatar-bg-transparent {
    background: transparent !important;
}

/* Player avatar shell: fav-color gradient ring + face + future overlay slot */
.player-avatar {
    --player-ring-a: #00F5FF;
    --player-ring-b: #FF00FF;
    --player-ring-width: 2.5px;
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    vertical-align: middle;
}

.player-avatar--xs {
    width: 22px;
    height: 22px;
    --player-ring-width: 1.5px;
}

.player-avatar--sm {
    width: 40px;
    height: 40px;
    --player-ring-width: 2px;
}

.player-avatar--md {
    width: 56px;
    height: 56px;
    --player-ring-width: 2.5px;
}

.player-avatar--lg {
    width: 64px;
    height: 64px;
    --player-ring-width: 3px;
}

.player-avatar--xl {
    width: 96px;
    height: 96px;
    --player-ring-width: 3.5px;
}

.player-avatar__shell {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: var(--player-ring-width);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--player-ring-a), var(--player-ring-b));
    box-shadow:
        0 0 8px color-mix(in srgb, var(--player-ring-a) 32%, transparent),
        0 0 14px color-mix(in srgb, var(--player-ring-b) 22%, transparent);
}

.player-avatar__face {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    background: #0a0a0f;
}

.player-avatar__fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #e8fbff;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--player-ring-a) 35%, #0a0a0f),
        color-mix(in srgb, var(--player-ring-b) 35%, #0a0a0f)
    );
    font-size: 0.85em;
    z-index: 1;
}

.player-avatar--xs .player-avatar__fallback {
    font-size: 0.55rem;
}

.player-avatar--sm .player-avatar__fallback {
    font-size: 0.75rem;
}

.player-avatar--md .player-avatar__fallback {
    font-size: 0.95rem;
}

.player-avatar--lg .player-avatar__fallback {
    font-size: 1.1rem;
}

.player-avatar--xl .player-avatar__fallback {
    font-size: 2rem;
}

.player-avatar__overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

/* Selection */
::selection {
    background: rgba(0, 245, 255, 0.3);
    color: #fff;
}

/* Performance: nav + footer sit on top of the animated starfield, so their
   Tailwind backdrop-blur forced a live re-blur of everything beneath them
   every frame. Disable it and lean on the semi-opaque background instead.
   (Modals keep their blur - they only exist while open.) */
nav.backdrop-blur-md,
footer.backdrop-blur-md {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(10, 10, 15, 0.92) !important;
}

/* Cosmic Card */
.cosmic-card {
    /* No backdrop-filter blur: with the animated starfield behind, every card
       forced a full re-blur each frame (major GPU drain even when visible).
       The near-opaque gradient makes the blur invisible anyway. */
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.93) 0%, rgba(10, 10, 15, 0.97) 100%);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 
        0 0 20px rgba(0, 245, 255, 0.05),
        inset 0 0 60px rgba(0, 245, 255, 0.02);
    transition: all 0.3s ease;
    pointer-events: auto; /* Allow clicks through parent's pointer-events-none */
}

.cosmic-card:hover {
    border-color: rgba(0, 245, 255, 0.4);
    box-shadow: 
        0 0 30px rgba(0, 245, 255, 0.1),
        inset 0 0 60px rgba(0, 245, 255, 0.03);
}

/* Navigation Link Hover Effects */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00f5ff, #00ff88);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Stars Animation */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    overflow: visible;
    animation: twinkle var(--duration, 2s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.sparkle-name {
    position: absolute;
    left: 50%;
    top: var(--sparkle-name-shift, -12px);
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(8px, 0.58vw, 11px);
    line-height: 1;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 8px currentColor;
    opacity: 0;
    animation: sparkleNameFade var(--sparkle-name-duration, 16s) ease-in-out infinite;
    animation-delay: var(--sparkle-name-delay, 0s);
}

.sparkle-name-patreon {
    font-size: clamp(9px, 0.64vw, 12px);
    text-shadow:
        0 0 10px currentColor,
        0 0 16px rgba(255, 255, 255, 0.45);
}

/* Opacity-only twinkle: no scale() so the browser never has to repaint,
   just composite - way cheaper with ~185 stars on screen. */
@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes sparkleNameFade {
    0%, 22%, 100% { opacity: 0; }
    30%, 52% { opacity: 0.95; }
    62% { opacity: 0; }
}

/* Floating Mail Styles */
/* z-index is set dynamically by JS based on depth layer (5, 10, or 15) */
.floating-mail {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    transition: filter 0.2s ease;
}

.floating-mail:hover {
    cursor: grab;
}

/* Common Mail (Gray) */
.mail-common {
    filter: drop-shadow(0 0 8px #9ca3af);
}

.mail-common:hover {
    filter: drop-shadow(0 0 15px #9ca3af) brightness(1.2);
}

/* Golden Mail (Rare - Gold) */
.mail-rare {
    filter: drop-shadow(0 0 10px #f59e0b);
    animation: goldenPulse 2.5s ease-in-out infinite;
}

.mail-rare:hover {
    filter: drop-shadow(0 0 20px #f59e0b) brightness(1.3);
}

@keyframes goldenPulse {
    0%, 100% { filter: drop-shadow(0 0 10px #f59e0b); }
    50% { filter: drop-shadow(0 0 18px #f59e0b) drop-shadow(0 0 25px rgba(245, 158, 11, 0.5)); }
}

/* Diamond Mail (Super Rare - Cyan) */
.mail-superRare {
    filter: drop-shadow(0 0 12px #00f5ff);
    animation: diamondGlow 2s ease-in-out infinite;
}

.mail-superRare:hover {
    filter: drop-shadow(0 0 25px #00f5ff) drop-shadow(0 0 40px rgba(0, 245, 255, 0.4)) brightness(1.3);
}

@keyframes diamondGlow {
    0%, 100% { filter: drop-shadow(0 0 12px #00f5ff) drop-shadow(0 0 20px rgba(0, 245, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px #00f5ff) drop-shadow(0 0 35px rgba(0, 245, 255, 0.5)); }
}

/* Loot Item Display */
.loot-item {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
    text-align: center;
    min-width: 100px;
}

.loot-item.common {
    border-color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
}

.loot-item.rare {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.loot-item.epic {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.loot-item.superRare {
    border-color: #00f5ff;
    background: rgba(0, 245, 255, 0.1);
    animation: superRarePulse 2s ease-in-out infinite;
}

.loot-item.legendary {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.7); }
}

@keyframes superRarePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 245, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(0, 245, 255, 0.5); }
}

/* Leaderboard Styles */
.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.06);
}

.leaderboard-entry.rank-1 {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, transparent 100%);
    border-left: 3px solid #f59e0b;
}

.leaderboard-entry.rank-2 {
    background: linear-gradient(90deg, rgba(156, 163, 175, 0.2) 0%, transparent 100%);
    border-left: 3px solid #9ca3af;
}

.leaderboard-entry.rank-3 {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.2) 0%, transparent 100%);
    border-left: 3px solid #b45309;
}

.leaderboard-entry.viewer-rank-row {
    margin-top: 0.5rem;
    border: 1px dashed rgba(0, 245, 255, 0.35);
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.1) 0%, rgba(0, 255, 136, 0.05) 100%);
}

.rank-number {
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    min-width: 2rem;
}

.rank-number.gold { color: #f59e0b; }
.rank-number.silver { color: #9ca3af; }
.rank-number.bronze { color: #b45309; }
.rank-number.default { color: #00f5ff; }

/* Homepage Game Mode — fade Latest News for Cosmic Mailske focus */
#homepage-news-panel {
    transition: opacity 0.7s ease, visibility 0s linear 0s;
    opacity: 1;
    visibility: visible;
}

body.game-mode-active #homepage-news-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}

.game-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(0, 245, 255, 0.28);
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.92) 0%, rgba(10, 10, 15, 0.96) 100%);
    box-shadow:
        0 0 18px rgba(0, 245, 255, 0.08),
        inset 0 0 40px rgba(0, 245, 255, 0.03);
    color: #e5e7eb;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.game-mode-toggle:hover {
    border-color: rgba(0, 255, 136, 0.45);
    box-shadow:
        0 0 24px rgba(0, 255, 136, 0.12),
        inset 0 0 40px rgba(0, 245, 255, 0.04);
    transform: translateY(-1px);
}

.game-mode-toggle.is-on {
    border-color: rgba(0, 255, 136, 0.55);
    box-shadow:
        0 0 28px rgba(0, 255, 136, 0.18),
        inset 0 0 50px rgba(0, 255, 136, 0.06);
}

.game-mode-toggle__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.game-mode-toggle__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: #00f5ff;
}

.game-mode-toggle.is-on .game-mode-toggle__title {
    color: #00ff88;
}

.game-mode-toggle__hint {
    font-size: 0.7rem;
    color: #9ca3af;
}

.game-mode-toggle__switch {
    position: relative;
    width: 2.6rem;
    height: 1.35rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(156, 163, 175, 0.35);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.game-mode-toggle.is-on .game-mode-toggle__switch {
    background: rgba(0, 255, 136, 0.25);
    border-color: rgba(0, 255, 136, 0.55);
}

.game-mode-toggle__knob {
    position: absolute;
    top: 50%;
    left: 0.15rem;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    background: #9ca3af;
    transform: translateY(-50%);
    transition: left 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.game-mode-toggle.is-on .game-mode-toggle__knob {
    left: calc(100% - 1.1rem);
    background: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.65);
}

.game-mode-toggle__status {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    min-width: 1.75rem;
    text-align: right;
}

.game-mode-toggle.is-on .game-mode-toggle__status {
    color: #00ff88;
}

/* News Card */
.news-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    pointer-events: auto;
}

.news-card:hover {
    border-color: rgba(0, 255, 136, 0.3);
    transform: translateY(-4px);
}

.news-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: linear-gradient(45deg, #1e40af, #8b5cf6);
}

/* Game Card */
.game-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
    border: 1px solid rgba(0, 245, 255, 0.2);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.game-card:hover {
    border-color: rgba(0, 255, 136, 0.5);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.1);
}

.game-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, transparent 60%);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #00f5ff 0%, #00ff88 100%);
    color: #0a0a0f;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid #00f5ff;
    color: #00f5ff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.btn-secondary:hover {
    background: rgba(0, 245, 255, 0.1);
}

/* Form Styles */
.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    transition: all 0.3s ease;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: #00f5ff;
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Parallax Layers - promoted to their own compositor layers so
   whole-layer transforms don't trigger repaints of the page */
#stars-layer-1,
#stars-layer-2,
#stars-layer-3 {
    will-change: transform;
}

#stars-layer-1 .star {
    width: 1px;
    height: 1px;
}

#stars-layer-2 .star {
    width: 2px;
    height: 2px;
}

#stars-layer-3 .star {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.5);
}

/* Nebula Clouds */
.nebula-cloud {
    position: absolute;
    border-radius: 50%;
    /* No filter: blur() here! A 60px blur re-rendered while the cloud
       drifts was the biggest GPU hog on the page. The soft look now
       comes from the radial-gradient itself (set in parallax.js). */
    opacity: 0.35;
    pointer-events: none;
    will-change: transform;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 245, 255, 0.2);
    border-top-color: #00f5ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Asceltial Crucible gain rate (very slow 360deg rotating gradient) */
@property --asceltial-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.asceltial-rate-value {
    --asceltial-angle: 0deg;
    display: inline-block;
    background-image: conic-gradient(
        from var(--asceltial-angle) at 50% 50%,
        #00ff88 0deg,
        #00f5ff 120deg,
        #ff00ff 240deg,
        #00ff88 360deg
    );
    background-size: 180% 180%;
    background-position: 50% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 7px rgba(0, 245, 255, 0.4));
    animation:
        asceltialRatePrismSpin 60s linear infinite,
        asceltialRateAuraPulse 14s ease-in-out infinite;
}

@keyframes asceltialRatePrismSpin {
    to { --asceltial-angle: 360deg; }
}

@keyframes asceltialRateAuraPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 245, 255, 0.32)); }
    50% { filter: drop-shadow(0 0 11px rgba(0, 245, 255, 0.5)); }
}

@media (prefers-reduced-motion: reduce) {
    .asceltial-rate-value {
        animation: none;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: rgba(18, 18, 26, 0.95);
    border: 1px solid rgba(0, 245, 255, 0.3);
    backdrop-filter: blur(10px);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: #00ff88;
}

.toast.error {
    border-color: #ff0055;
}

/* SternCore absorb notice — bottom-center, slides up then out */
.sterncore-absorb-popup {
    position: fixed;
    left: 50%;
    bottom: 1.75rem;
    z-index: 1100;
    width: min(92vw, 22rem);
    padding: 0.95rem 1.2rem;
    border-radius: 0.75rem;
    background: rgba(10, 14, 24, 0.94);
    border: 1px solid rgba(0, 255, 136, 0.45);
    box-shadow: 0 0 28px rgba(0, 255, 136, 0.18);
    backdrop-filter: blur(12px);
    color: #e5e7eb;
    pointer-events: none;
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform 420ms ease, opacity 420ms ease;
}

.sterncore-absorb-popup.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* Holodeck social action toast — bottom-center, slides up then out */
.social-toast {
    position: fixed;
    left: 50%;
    bottom: 1.75rem;
    z-index: 1100;
    width: min(92vw, 22rem);
    padding: 0.85rem 1.15rem;
    border-radius: 0.75rem;
    background: rgba(10, 14, 24, 0.94);
    border: 1px solid rgba(0, 245, 255, 0.4);
    box-shadow: 0 0 28px rgba(0, 245, 255, 0.14);
    backdrop-filter: blur(12px);
    color: #e5e7eb;
    pointer-events: none;
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform 420ms ease, opacity 420ms ease;
}

.social-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.social-toast--success {
    border-color: rgba(255, 0, 255, 0.5);
    box-shadow: 0 0 28px rgba(255, 0, 255, 0.16);
}

.social-toast--error {
    border-color: rgba(255, 0, 85, 0.55);
    box-shadow: 0 0 28px rgba(255, 0, 85, 0.14);
}

.social-toast--info {
    border-color: rgba(0, 245, 255, 0.4);
    box-shadow: 0 0 28px rgba(0, 245, 255, 0.14);
}

.social-toast__eyebrow {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00f5ff;
}

.social-toast--success .social-toast__eyebrow {
    color: #ff00ff;
}

.social-toast--error .social-toast__eyebrow {
    color: #ff6699;
}

.social-toast__message {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3f4f6;
    line-height: 1.35;
}

/* Astra XP progress fill — dark purple → fuchsia → aqua → white (hand-written so Tailwind purge cannot drop it) */
.astra-progress-fill {
    background-image: linear-gradient(90deg, #4c1d95 0%, #ff00ff 34%, #00f5ff 68%, #ffffff 100%);
}

/* Brand resource text — same Astra / Stellar Liquid ramps used in loot + Crucible */
.text-astra-gradient {
    display: inline-block;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #4c1d95 0%, #ff00ff 34%, #00f5ff 68%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.text-stellar-gradient {
    display: inline-block;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #00f5ff 0%, #facc15 50%, #ff00ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.text-growth-gradient {
    display: inline-block;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #00ff88 0%, #facc15 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Cosmic Mail progression rarity chrome. */
.cosmic-mail-rarity {
    --cosmic-mail-tone: #9ca3af;
    border-color: color-mix(in srgb, var(--cosmic-mail-tone) 45%, transparent);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--cosmic-mail-tone) 8%, transparent);
}

.cosmic-mail-rarity__label {
    color: var(--cosmic-mail-tone, #9ca3af);
    width: fit-content;
}

.cosmic-mail-rarity--lesser { --cosmic-mail-tone: #9ca3af; }
.cosmic-mail-rarity--normal { --cosmic-mail-tone: #39ff14; }
.cosmic-mail-rarity--superior { --cosmic-mail-tone: #3b82f6; }
.cosmic-mail-rarity--umbral { --cosmic-mail-tone: #a855f7; }
.cosmic-mail-rarity--mythical { --cosmic-mail-tone: #ef4444; }
.cosmic-mail-rarity--godix { --cosmic-mail-tone: #00f5ff; }

.cosmic-mail-rarity--mythical .cosmic-mail-rarity__label,
.cosmic-mail-rarity--godix .cosmic-mail-rarity__label,
.cosmic-mail-rarity__label.cosmic-mail-rarity--mythical,
.cosmic-mail-rarity__label.cosmic-mail-rarity--godix {
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
}

.cosmic-mail-rarity--mythical .cosmic-mail-rarity__label,
.cosmic-mail-rarity__label.cosmic-mail-rarity--mythical {
    background-image: linear-gradient(90deg, #ef4444, #facc15);
}

.cosmic-mail-rarity--godix .cosmic-mail-rarity__label,
.cosmic-mail-rarity__label.cosmic-mail-rarity--godix {
    background-image: linear-gradient(90deg, #00f5ff 0%, #facc15 50%, #ff00ff 100%);
}

/* Nebula Bag / shared loot-card chrome (Mailske popup parity). */
.nebula-loot-modal {
    z-index: 1200;
}

@keyframes lootReveal {
    0% { opacity: 0; transform: scale(0.4) translateY(14px); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.loot-rarity-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid;
    background: rgba(5, 8, 18, 0.92);
    white-space: nowrap;
    z-index: 12;
    pointer-events: none;
}

.loot-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
}

.loot-shine::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    width: 45%;
    height: 220%;
    transform: rotate(22deg);
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 35%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.05) 65%,
        transparent 100%
    );
    animation: lootShineSweep 3.2s ease-in-out infinite;
}

@keyframes lootShineSweep {
    0% { left: -80%; opacity: 0; }
    10% { opacity: 1; }
    45% { left: 130%; opacity: 1; }
    46%, 100% { left: 130%; opacity: 0; }
}

.sterncore-absorb-popup__eyebrow {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00ff88;
}

.sterncore-absorb-popup__amount {
    margin: 0.35rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #00f5ff;
}

.sterncore-absorb-popup__detail {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cosmic-card {
        padding: 1rem;
    }
    
    .floating-mail svg {
        width: 32px;
        height: 32px;
    }
}

/* Animations for page elements */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   Pointer Events - Allow clicks through 
   parent containers with pointer-events-none
   ========================================== */

/* All interactive elements should be clickable */
a, button, input, select, textarea, 
[role="button"], [onclick], [tabindex]:not([tabindex="-1"]) {
    pointer-events: auto;
}

/* Hero section text should be selectable */
h1, h2, h3, h4, h5, h6, p, span {
    pointer-events: auto;
}

/* Iframe widgets need pointer events */
iframe {
    pointer-events: auto;
}

/* ==========================================
   Email Reveal Modal Animation
   ========================================== */
   
#email-reveal-modal > div {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#email-reveal-modal.hidden > div {
    animation: modalSlideOut 0.2s ease-in;
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* ==========================================
   Site maintenance banner
   ========================================== */

.sl-maintenance-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 0.65rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fee2e2;
    background: rgba(153, 27, 27, 0.94);
    border-bottom: 1px solid rgba(248, 113, 113, 0.55);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.35);
    pointer-events: auto;
}

.sl-maintenance-banner.sl-maintenance-banner--below-nav {
    top: 4rem;
    z-index: 45;
}

.sl-maintenance-banner__note {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0;
    color: #fecaca;
    opacity: 0.95;
    overflow-wrap: anywhere;
}
