:root {
    --neon-pink: #ff2a7a;
    --neon-blue: #00e5ff;
}

/* Header styles */
.site-header {
    padding: 8px 5%; /* Thinner header for better 1-line fit */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.9); /* Slightly more opaque */
    border-bottom: 1px solid rgba(255, 42, 122, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    flex-wrap: nowrap !important; /* ABSOLUTELY NO WRAP */
    height: 60px; /* Fixed height to ensure 1 line */
    overflow: hidden; /* Prevent overflow of wrapping items */
}



.brand-logo {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-pink);
    letter-spacing: 1px;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    z-index: 1005;
    transition: 0.3s;
}

@media screen and (max-width: 480px) {
    .brand-logo {
        font-size: 18px;
        max-width: 150px; /* Limit logo width to keep items in 1 line */
        overflow: hidden;
        text-overflow: ellipsis;
    }
}



.brand-logo:hover {
    text-shadow: 0 0 15px var(--neon-pink), 0 0 30px var(--neon-pink);
}

.nav-links-desktop {
    display: flex;
    gap: 30px;
    align-items: center;
    margin: 0 40px;
}

.nav-item {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-pink);
    transition: 0.3s;
}

.nav-item:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--neon-pink);
}

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

@media screen and (max-width: 1024px) { /* Increased breakpoint to also include tablets */
    .nav-links-desktop {
        margin: 0 10px;
        gap: 15px; /* Tighter gap for tablet */
    }
}

@media screen and (max-width: 768px) {
    .nav-text {
        display: none !important; /* Hide text, keep emoji */
    }
    
    .nav-links-desktop {
        margin: 0 5px;
        gap: 10px; /* Even tighter for phone */
    }
    
    .nav-item {
        font-size: 20px; /* Larger emoji for easier tapping */
        padding: 0;
    }
}

@media screen and (max-width: 480px) {
    .brand-logo {
        font-size: 16px;
        max-width: 120px;
    }
    
    .nav-links-desktop {
        gap: 8px;
    }
    
    .menu-text {
        font-size: 10px;
    }
}


.nav-links {
    display: none; /* Default for desktop in some contexts, but usually handled by media queries */
}


@media screen and (max-width: 1024px) {
    .nav-links-desktop {
        margin: 0;
        gap: 12px;
        display: flex !important;
    }
    
    .nav-links, .menu-btn, .close-btn {
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    .site-header {
        padding: 0 2%;
        gap: 5px;
    }

    .brand-logo {
        font-size: 15px;
        flex-shrink: 0;
        margin-right: 5px;
    }

    .nav-links-desktop {
        gap: 8px;
        justify-content: flex-end;
        flex: 1;
    }
    
    .nav-item {
        font-size: 18px; /* Emoji size */
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        min-width: 35px;
    }

    .nav-text {
        font-size: 8px !important;
        letter-spacing: 0;
        font-weight: 900;
        display: block !important;
        text-transform: uppercase;
        margin-top: -2px;
    }
}

@media screen and (max-width: 380px) {
    .brand-logo {
        font-size: 13px;
    }
    .nav-links-desktop {
        gap: 5px;
    }
    .nav-item {
        font-size: 16px;
        min-width: 30px;
    }
    .nav-text {
        font-size: 7px !important;
    }
}

.nav-links a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 16px 20px;
    width: 100%;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a:active {
    background: rgba(255, 42, 122, 0.15);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    transform: translateX(5px);
}


.header-social {
    color: var(--neon-blue);
    font-weight: bold;
    font-size: 14px;
    border: 1px solid var(--neon-blue);
    padding: 5px 15px;
    border-radius: 20px;
    transition: 0.3s;
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
}

@media screen and (max-width: 900px) {
    .header-social {
        display: none;
    }
}

.menu-btn {
    padding: 6px 16px; /* Slightly wider for better text fit */
    height: 38px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Desktop default */
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* More modern squared pill */
    background: rgba(255, 255, 255, 0.08); /* Brighter for mobile focus */
    border: 1px solid rgba(252, 42, 122, 0.4); /* Neon border */
    z-index: 1005; /* Above header but below menu */
    gap: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.menu-btn .menu-text {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.menu-btn:hover {
    background: rgba(255, 42, 122, 0.3);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 42, 122, 0.3);
}

.menu-btn.active {
    background: var(--neon-pink);
    border-color: #fff;
}
/* Simple MENU Button - No extra lines */
.menu-btn {
    display: none; /* Hidden on desktop */
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--neon-pink);
    border-radius: 8px;
    cursor: pointer;
    z-index: 10001;
    transition: 0.3s;
}

.menu-btn .menu-text {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
}

.menu-btn.active {
    background: var(--neon-pink);
}

@media screen and (max-width: 1024px) {
    .menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Ensure mobile menu is ALWAYS visible when active */
.nav-links.active {
    visibility: visible !important;
    pointer-events: auto !important;
    right: 0 !important;
    display: flex !important;
    z-index: 999999 !important;
}


.mobile-social {
    display: inline-block;
    margin: 30px auto 0;
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    text-align: center;
}

@media screen and (max-width: 900px) {
    .site-header {
        padding: 10px 5%;
    }
    .header-social {
        display: none;
    }

    .mobile-social {
        display: inline-block;
        margin: 30px auto 0;
        border-color: var(--neon-blue);
        color: var(--neon-blue);
        text-align: center;
    }
}

/* --- ARTICLE UTILITIES (Flashcards, Grids, etc.) --- */
.flashcard-grid, .catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.flashcard-item, .catalog-card, .flashcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
}

.flashcard-item:hover, .catalog-card:hover, .flashcard:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: var(--neon-pink);
}

.flashcard-item::before, .catalog-card::after, .flashcard::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
}

.fc-jp, .jp-text, .flash-jp {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    display: block;
    margin-bottom: 8px;
    font-family: 'Noto Serif JP', serif;
}

.fc-reading, .jp-reading, .flash-reading {
    font-size: 1rem;
    color: #64748b;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fc-th, .th-text, .flash-th {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-pink);
    display: block;
}

.share-badge {
    position: absolute;
    bottom: 10px;
    width: 100%;
    left: 0;
    font-size: 0.7rem;
    color: #94a3b8;
    opacity: 0.5;
    font-style: italic;
}

/* Footer styles */
.site-footer {
    background: #000;
    padding: 60px 5%;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    position: relative;
    z-index: 10;
}

.footer-links {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 0.85rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: 0.3s;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-copy {
    color: #555;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-top: 25px;
}
