/* Modern Tech Theme - Professional Interface Styles */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', 'Orbitron', monospace;
    color: #e0e6ed;
    background: radial-gradient(ellipse at center, #0c1445 0%, #000000 100%);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

:root {
    --hero-background: url('./images/background/1.webp');
    --primary-blue: #00d4ff;
    --secondary-blue: #0099cc;
    --accent-cyan: #00ffff;
    --empire-red: #ff0040;
    --tech-green: #00ff41;
    --warning-yellow: #ffff00;
    --dark-space: #0a0a0a;
    --light-grey: #e0e6ed;
    --hologram-blue: rgba(0, 212, 255, 0.3);
    --glass-dark: rgba(10, 20, 40, 0.4);
    --glow-intensity: 0 0 20px;
}

/* Typography */
.main-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--primary-blue);
    /* stronger centering: use column flex so each line is truly centered
       regardless of its intrinsic width */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.title-line {
    display: block;
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.name-line {
    display: inline-block;
    font-size: 2.5rem;
    letter-spacing: 2px;
    color: var(--light-grey);
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Hero Section */
header .hero {
    position: relative;
    background-image: var(--hero-background) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.modern-card {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.1) 0%, 
        rgba(10, 20, 40, 0.4) 50%, 
        rgba(0, 255, 255, 0.1) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    margin: 2rem;
    box-shadow: 
        var(--glow-intensity) rgba(0, 212, 255, 0.4),
        inset 0 0 50px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    perspective: 2000px;
    max-width: 600px;
    animation: modernPulse 4s ease-in-out infinite alternate;
    will-change: transform;
    transform-origin: center center;
    /* ensure content (badges/description) is never clipped by the card */
    overflow: visible;
}

@keyframes modernPulse {
    0% { box-shadow: var(--glow-intensity) rgba(0, 212, 255, 0.4); }
    100% { box-shadow: var(--glow-intensity) rgba(0, 255, 255, 0.6); }
}

/* Profile Image Styling */
.image-container {
    width: 200px;
    max-width: 200px;
    margin: 0 auto 2rem auto;
    position: relative;
}

.profile-portrait {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-blue);
    box-shadow: 
        0 0 30px rgba(0, 212, 255, 0.6),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    transition: all 0.5s ease;
}

.profile-portrait:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.8),
        inset 0 0 30px rgba(0, 212, 255, 0.3);
}

.profile-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        transparent 60%, 
        rgba(0, 255, 255, 0.3) 70%, 
        transparent 80%);
    opacity: 0.7;
    animation: profilePulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes profilePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 20, 40, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(0, 30, 60, 0.4);
    border-radius: 8px;
    border-left: 3px solid var(--primary-blue);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 40, 80, 0.6);
    border-left-color: var(--accent-cyan);
    transform: translateX(5px);
}

.stat-item i {
    color: var(--primary-blue);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.stat-label {
    font-weight: 600;
    color: var(--accent-cyan);
    min-width: 80px;
}

/* Fix: prevent stat-item children from overflowing their container */
.stat-item {
    min-width: 0; /* allow flex children to shrink */
}

.stat-value {
    min-width: 0; /* allow value to shrink instead of overflowing */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* allow stat-value to take remaining horizontal space so inline widgets (like the ticker) are visible */
.stat-value { flex: 1 1 auto; }

.stat-unit {
    margin-left: 0.4rem;
}

.stat-value {
    font-weight: 700;
    color: var(--light-grey);
}


.languages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--light-grey);
    transition: all 0.3s ease;
}

.language-item:hover {
    background: rgba(0, 212, 255, 0.2);
    /* no transform: keep language icons stable on hover */
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.language-item i {
    color: var(--primary-blue);
    font-size: 1rem;
    width: auto;
}

.stat-unit {
    font-size: 0.9rem;
    color: rgba(224, 230, 237, 0.7);
}

/* Description */
.profile-description {
    margin-top: 2rem;
}

/* Make sure the description and badges are always visible and readable */
.profile-description,
.specialty-badges,
.main-description {
    display: block;
    visibility: visible;
}

.main-description {
    max-width: 92%;
    margin-left: auto;
    margin-right: auto;
    word-break: break-word;
}

.main-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: rgba(224, 230, 237, 0.9);
    text-align: center;
}

.specialty-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 40, 80, 0.6);
    border: 1px solid var(--primary-blue);
    color: var(--light-grey);
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(0, 60, 120, 0.8);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

/* Section Styling */
.modern-section {
    padding: 4rem 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, 
        rgba(10, 20, 40, 0.8) 0%, 
        rgba(5, 15, 30, 0.9) 100%);
    position: relative;
}

/* Remove the thick blue line pseudo-element */

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--light-grey);
    text-shadow: 0 0 15px var(--primary-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--accent-cyan);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(224, 230, 237, 0.7);
    font-family: 'Exo 2', sans-serif;
    letter-spacing: 1px;
}

/* Link Container */
.link-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.platform-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.modern-button {
    width: 200px;
    min-height: 120px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, 
        rgba(20, 40, 80, 0.8) 0%, 
        rgba(10, 30, 60, 0.9) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--light-grey);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.modern-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.modern-button:hover::before {
    left: 100%;
}

.modern-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 212, 255, 0.4);
    border-color: var(--accent-cyan);
}

.button-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    font-family: 'Orbitron', monospace;
}

/* Platform-specific colors */
.instagram:hover { border-color: #e4405f; box-shadow: 0 0 20px rgba(228, 64, 95, 0.5); }
.snapchat:hover { border-color: #fffc00; box-shadow: 0 0 20px rgba(255, 252, 0, 0.5); }
.facebook:hover { border-color: #1877f2; box-shadow: 0 0 20px rgba(24, 119, 242, 0.5); }
.discord:hover { border-color: #5865f2; box-shadow: 0 0 20px rgba(88, 101, 242, 0.5); }
.steam:hover { border-color: #66c0f4; box-shadow: 0 0 20px rgba(102, 192, 244, 0.5); }
.paypal:hover { border-color: #00457c; box-shadow: 0 0 20px rgba(0, 69, 124, 0.5); }
.github:hover { border-color: #8E24AA; box-shadow: 0 0 20px rgba(142, 36, 170, 0.5); }
.amazon:hover { border-color: #ff9900; box-shadow: 0 0 20px rgba(255, 153, 0, 0.5); }

/* Project Cards */
.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.imperial-card {
    background: linear-gradient(135deg, 
        rgba(20, 40, 80, 0.8) 0%, 
        rgba(10, 30, 60, 0.9) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-card {
    background: linear-gradient(135deg, 
        rgba(20, 40, 80, 0.8) 0%, 
        rgba(10, 30, 60, 0.9) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Remove the thick blue line from cards */

.imperial-card:hover,
.modern-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 212, 255, 0.3);
    border-color: var(--accent-cyan);
}

.project-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.project-icon i {
    font-size: 3rem;
    color: var(--primary-blue);
    text-shadow: 0 0 15px var(--primary-blue);
}

.project-content h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light-grey);
    margin-bottom: 1rem;
    text-align: center;
}

.project-content p {
    color: rgba(224, 230, 237, 0.8);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-blue);
    border-radius: 25px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.project-link:hover {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.project-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator.active {
    background: var(--tech-green);
    box-shadow: 0 0 10px var(--tech-green);
}

.status-indicator.experimental {
    background: var(--warning-yellow);
    box-shadow: 0 0 10px var(--warning-yellow);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(224, 230, 237, 0.7);
    font-family: 'Orbitron', monospace;
}

/* Footer */
.modern-footer {
    background: linear-gradient(135deg, 
        rgba(5, 15, 30, 0.95) 0%, 
        rgba(0, 10, 20, 0.98) 100%);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    padding: 2rem;
    text-align: center;
    position: relative;
    margin-top: 4rem;
}

.footer-content p {
    color: var(--light-grey);
    margin-bottom: 0.5rem;
}

.footer-subtitle {
    color: var(--primary-blue);
    font-family: 'Orbitron', monospace;
    font-style: italic;
    font-size: 0.9rem;
}

.modern-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-blue) 20%, 
        var(--accent-cyan) 50%, 
        var(--primary-blue) 80%, 
        transparent 100%);
    margin: 1rem auto;
    border-radius: 1px;
    animation: modernGlow 3s ease-in-out infinite alternate;
}

@keyframes modernGlow {
    0% { box-shadow: 0 0 5px var(--primary-blue); }
    100% { box-shadow: 0 0 15px var(--accent-cyan); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-card {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .name-line {
        font-size: 2rem;
    }
    
    .title-line {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .link-container {
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .modern-button {
        width: 150px;
        min-height: 100px;
        font-size: 1.5rem;
    }
    
    .project-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .languages-list {
        gap: 0.5rem;
    }
    
    .language-item {
        font-size: 0.8rem;
        padding: 0.15rem 0.4rem;
    }
    
    .specialty-badges {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .modern-section {
        padding: 2rem 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .link-container {
        gap: 0.8rem;
        padding: 1rem 0;
    }
    
    .modern-button {
        width: 120px;
        min-height: 80px;
        font-size: 1.2rem;
    }
    
    .button-label {
        font-size: 0.7rem;
    }
    
    .languages-list {
        gap: 0.3rem;
        justify-content: center;
    }
    
    .language-item {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Mobile-first adjustments for the hero card to match the stacked mobile layout */
@media (max-width: 600px) {
    /* Make the modern card the primary centered container on small screens
       so everything (pfp, name, stats, badges) lives inside one blue box. */
    .modern-card {
        width: calc(100% - 2rem);
        max-width: 520px;
        margin: 1rem auto;
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.06) 0%, rgba(10,20,40,0.85) 50%, rgba(0,255,255,0.03) 100%);
        border: 1px solid rgba(0,212,255,0.16);
        box-shadow: 0 12px 30px rgba(0,0,0,0.45), 0 0 30px rgba(0,212,255,0.06) inset;
    }

    .image-container {
        width: 140px;
        max-width: 140px;
        margin-bottom: 1rem;
    }

    .profile-portrait {
        height: 140px;
    }

    .name-line {
        font-size: 1.8rem;
    }

    .profile-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .stat-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        padding: 0.8rem;
    }

    .stat-item i { font-size: 1.05rem; width: 26px; }

    .stat-label { font-size: 0.9rem; }

    .stat-value { font-size: 1rem; }

    .languages-list { gap: 0.5rem; }

    .specialty-badges {
        flex-wrap: wrap;
        gap: 0.6rem;
        justify-content: center;
    }

    .badge { padding: 0.35rem 0.7rem; font-size: 0.84rem; }

    /* Make ticker items slightly smaller on mobile */
    .ticker-item { height: 30px; font-size: 0.86rem; }
    .ticker-flag { width: 24px; height: 16px; }

    /* Make the hero area less tall and keep the card visually centered */
    header .hero {
        min-height: auto;
        padding: 2rem 0 3rem 0;
        align-items: flex-start;
    }

    /* reduce background parallax oddities on mobile */
    header .hero { background-attachment: scroll; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Adventures dropdown & flags */
.dropdown {
    position: relative;
    display: inline-block;
    text-align: left;
}

.dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 30, 60, 0.5);
    border: 1px solid rgba(0,212,255,0.15);
    color: var(--light-grey);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.dropdown-arrow {
    transition: transform 0.25s ease;
    color: var(--accent-cyan);
}

.dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-list {
    /* inline flow dropdown: hidden by max-height so it expands the stat-item rectangle */
    position: relative;
    background: rgba(5, 15, 30, 0.95);
    border: 1px solid rgba(0,212,255,0.06);
    border-radius: 10px;
    padding: 0.5rem;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 0 30px rgba(0,212,255,0.02);
    z-index: 2;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform-origin: top center;
    transition: max-height 360ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease, transform 300ms ease;
}

.dropdown.open .dropdown-list {
    max-height: 520px; /* plenty to show the list */
    opacity: 1;
    transform: translateY(0) scaleY(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    color: var(--light-grey);
    font-weight: 600;
    border-radius: 6px;
}

.dropdown-item:hover {
    background: rgba(0,212,255,0.04);
}

.country-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* Star Wars themed background for the adventures list */
.sw-themed {
    background: linear-gradient(180deg, rgba(2,6,23,0.95) 0%, rgba(6,12,40,0.9) 60%);
    box-shadow: 0 12px 40px rgba(2,6,23,0.8), 0 0 40px rgba(0,212,255,0.03) inset;
    position: relative;
}

.sw-themed::before {
    content: '';
    position: absolute;
    left: -50%;
    top: -200%;
    width: 300%;
    height: 300%;
    background-image: radial-gradient(rgba(255,255,255,0.9) 0.6px, transparent 0px);
    background-size: 20px 20px;
    opacity: 0.06;
    animation: starDrift 18s linear infinite;
    pointer-events: none;
}

@keyframes starDrift {
    from { transform: translateY(0) rotate(0deg); }
    to { transform: translateY(40px) rotate(45deg); }
}

/* Expanded stat-item styling (enlarges the rectangle slightly and adds subtle glow) */
.stat-item.expanded {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.6), 0 0 30px rgba(0,212,255,0.06);
    border-radius: 12px;
}

/* Icon-only language items */
.languages-list {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.language-item {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 20, 40, 0.4);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 8px;
    color: var(--primary-blue);
    font-size: 1.05rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.language-item:hover {
    /* keep language tiles stable on hover; use subtle shadow only */
    box-shadow: 0 6px 12px rgba(0,212,255,0.08);
}

.language-text {
    font-family: 'Orbitron', monospace;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--light-grey);
    background: linear-gradient(90deg, rgba(0,212,255,0.06), rgba(0,212,255,0.02));
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(0,212,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
}

/* Adventures ticker */
.adventures-ticker {
    width: 100%;
    overflow: hidden;
    position: relative;
    /* remove left padding so the cloned track lines up exactly with the original
       (padding created a tiny visible seam when tracks were swapped) */
    padding: 0.2rem 0;
    /* let height be determined by the items; JS will set a stable height when available */
    min-height: 38px;
    display: flex;
    align-items: center; /* vertically center the track */
    box-sizing: border-box;
}
.ticker-track {
    display: flex;
    gap: 1rem;
    align-items: center;
    white-space: nowrap;
    position: relative; /* flow with the container for reliable clipping */
    will-change: transform;
    /* compositing hints to reduce flicker/jumps on some GPUs */
    backface-visibility: hidden;
    transform: translateZ(0);
}
.ticker-track.clone {
    position: relative;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.6rem;
    background: rgba(0,20,40,0.4);
    border-radius: 999px;
    border: 1px solid rgba(0,212,255,0.08);
    color: var(--light-grey);
    font-weight: 700;
    height: 34px; /* fixed item height so the track height is deterministic */
}
.ticker-item .country-flag { width: 28px; height: 20px; border-radius:3px; display:block; object-fit:cover; }
.ticker-name { font-size: 0.9rem; }

/* Namespaced flag class for ticker specifically to avoid cross-rule conflicts */
.ticker-flag { width: 30px; height: auto; display: block; object-fit: cover; border-radius: 3px; }

/* The ticker is driven by JS for pixel-perfect looping; keep a paused state class */
.adventures-ticker.paused .ticker-track,
.adventures-ticker.paused .ticker-track.clone { animation-play-state: paused; }

/* Ensure the stat row clips any overflowing children like the ticker
   and establish a containing block for absolute/translated children. */
.stat-item {
    /* preserve existing flex layout but prevent overflow */
    position: relative;
    overflow: hidden;
    min-width: 0; /* keep ability to shrink */
}

/* Make sure the ticker never forces the stat row wider than available */
.adventures-ticker {
    box-sizing: border-box;
    max-width: 100%;
}

/* Use inline-flex for each track so duplicated/cloned tracks stay in-flow
   and are reliably clipped by the parent container. */
.adventures-ticker .ticker-track,
.adventures-ticker .ticker-track.clone {
    display: inline-flex;
    align-items: center;
}

/* Align ticker with stat label and prevent overflow */
.stat-value {
    /* keep the numeric value and unit visually grouped
       inline-flex prevents the value from stretching to fill the whole row
       gap keeps a consistent small distance between the value and unit */
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    /* don't force this element to expand and push other inline bits away */
    flex: 0 0 auto;
    white-space: nowrap;
}
.stat-item { align-items: center; }

@media (prefers-reduced-motion: reduce) {
    .adventures-ticker .ticker-track,
    .adventures-ticker .ticker-track.clone { animation: none !important; }
}

/* Small tweak so dropdown aligns nicely inside stat-item */
.stat-value .dropdown {
    display: block;
}

/* Additional Modern Enhancements */
.glass-responsive {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(17, 25, 40, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 12px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-space);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-blue), var(--accent-cyan));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--accent-cyan), var(--primary-blue));
}

/* Star map styles */
.star-map {
    width: 100%;
    position: relative;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 420ms cubic-bezier(.2,.9,.2,1), opacity 260ms ease;
}
.star-map.open {
    max-height: 320px;
    opacity: 1;
}
.star-map .map-canvas {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
}
.star-chart {
    width: 100%;
    position: relative;
    overflow: visible;
    max-height: 0;
    opacity: 0;
    transition: max-height 420ms cubic-bezier(.2,.9,.2,1), opacity 260ms ease;
}
.star-chart.open {
    max-height: 360px;
    opacity: 1;
}
.star-chart .chart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}
.star-chart .map-markers {
    position: relative;
    padding: 0.6rem 0.6rem;
    height: 320px;
    z-index: 6;
}
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 7;
}
.map-marker::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0,212,255,1);
    filter: blur(6px);
    opacity: 0.65;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse { 0% { transform: translate(-50%,-50%) scale(0.85); opacity:0.6 } 50% { transform: translate(-50%,-50%) scale(1.15); opacity:1 } 100% { transform: translate(-50%,-50%) scale(0.85); opacity:0.6 } }
.map-marker .country-flag { width: 30px; height: 20px; border-radius:3px; }
.map-marker .marker-tooltip { margin-top:6px; background: rgba(2,6,23,0.9); color: var(--light-grey); padding: 4px 8px; border-radius:6px; font-size:0.8rem; opacity:0; transform: translateY(-6px); transition: opacity 160ms, transform 160ms; pointer-events:none; white-space:nowrap; }
.map-marker:hover .marker-tooltip { opacity:1; transform: translateY(0); }

/* Hyperspace paths (SVG path styles) */
.chart-svg path {
    stroke: rgba(0,212,255,0.18);
    stroke-width: 1.4;
    fill: none;
    filter: drop-shadow(0 0 6px rgba(0,212,255,0.06));
}
.chart-svg path.glow {
    stroke: rgba(0,212,255,0.5);
    stroke-width: 0.9;
    stroke-linecap: round;
    opacity: 0.8;
}

/* stronger Star Wars aesthetic: subtle scan line */
.star-chart .map-canvas.sw-themed::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0) 20%);
    mix-blend-mode: overlay;
    pointer-events: none;
}
.star-map .map-markers {
    position: relative;
    padding: 0.8rem 0.6rem;
    height: 240px;
    display: block;
}
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.map-marker .country-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.35);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 12px rgba(0,212,255,0.04);
}
.marker-tooltip {
    margin-top: 6px;
    background: rgba(2,6,23,0.9);
    color: var(--light-grey);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
    white-space: nowrap;
}
.marker-tooltip.visible { opacity: 1; transform: translateY(0); }

.map-toggle-btn {
    margin-top: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(0,212,255,0.12);
    background: linear-gradient(135deg, rgba(10,20,40,0.6), rgba(5,10,30,0.8));
    color: var(--light-grey);
    cursor: pointer;
    font-weight: 700;
}
.map-toggle-btn .dropdown-arrow { transition: transform 260ms ease; }
.map-toggle-btn[aria-expanded="true"] .dropdown-arrow { transform: rotate(180deg); }

@media (max-width: 480px) {
    .star-map.open { max-height: 280px; }
    .star-map .map-markers { height: 200px; }
}

/* Hero background (Ken Burns) and particle overlay */
.hero {
    position: relative; /* ensure positioning for overlay children */
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2; /* behind the particles and content */
    transform-origin: center;
    transition: opacity 300ms ease;
    will-change: transform;
    pointer-events: none;
    animation: kenburns 28s ease-in-out infinite alternate;
}

@keyframes kenburns {
    0% { transform: scale(1) translateZ(0); }
    100% { transform: scale(1.08) translateZ(0); }
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: -1; /* above hero-bg but behind content */
    pointer-events: none;
    opacity: 0.85;
}

/* Respect reduced motion and small devices */
@media (prefers-reduced-motion: reduce) {
    .hero-bg { animation: none; transform: none; }
    .hero-particles { display: none !important; }
}

@media (max-width: 600px) {
    .hero-bg { animation: none; }
    .hero-particles { display: none; }
}
