/* ============================================================
   AETHER CHRONICLES - PREMIUM MAIN MENU V2
   Fixed layout with proper sidebar containment
   ============================================================ */

/* === CSS Variables (referencing shared theme where possible) === */
:root {
    /* Menu-specific aliases referencing theme tokens from style.css */
    --menu-bg-deep: var(--theme-bg-deep, #080b12);
    --menu-bg-primary: var(--theme-bg-primary, #0d1117);
    --menu-bg-secondary: var(--theme-bg-secondary, #161b22);
    --menu-bg-tertiary: var(--theme-bg-tertiary, #21262d);
    --accent-gold: var(--theme-gold, #d4a857);
    --accent-gold-bright: var(--theme-gold-bright, #f0c860);
    --accent-cyan: var(--theme-cyan, #00d4ff);
    --accent-purple: var(--theme-purple, #a855f7);
    --text-primary: var(--theme-text-primary, #ffffff);
    --text-secondary: var(--theme-text-secondary, #8b949e);
    --text-muted: var(--theme-text-muted, #484f58);
    --border-subtle: 1px solid rgba(255, 255, 255, 0.1);
    --transition-fast: 0.15s ease;
}

/* === Premium Header === */
.premium-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, #0d1117 0%, #080b12 100%);
    border-bottom: 1px solid rgba(212, 168, 87, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.home-btn:hover {
    background: rgba(212, 168, 87, 0.15);
    color: var(--accent-gold);
}

.home-btn svg {
    width: 18px;
    height: 18px;
}

.player-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-frame {
    width: 36px;
    height: 36px;
    position: relative;
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
}

.avatar-ring {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    opacity: 0.5;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.player-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Center Logo */
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-flourish {
    color: var(--accent-gold);
    font-size: 14px;
    opacity: 0.7;
}

.game-logo {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-aether {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #d4a857, #f0c860, #d4a857);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-chronicles {
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--text-secondary);
}

/* Right - Currencies */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.currency-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 4px 10px;
}

.currency-pill .currency-icon {
    font-size: 16px;
}

.currency-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-add {
    width: 18px;
    height: 18px;
    background: rgba(212, 168, 87, 0.2);
    border: 1px solid rgba(212, 168, 87, 0.4);
    border-radius: 50%;
    color: var(--accent-gold);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.currency-add:hover {
    background: var(--accent-gold);
    color: #000;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* === Main Menu Screen === */
/* Hide by default - only show when .active */
#screen-main-menu {
    display: none !important;
}

#screen-main-menu.active {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--menu-bg-deep);
    overflow: hidden;
    display: flex !important;
}

.main-menu-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* === Left Sidebar === */
.main-menu-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: 100%;
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.98) 0%, rgba(8, 11, 18, 0.98) 100%);
    border-right: 1px solid rgba(212, 168, 87, 0.15);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 1.5px;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 168, 87, 0.3) 0%, transparent 100%);
}

/* === PLAY Section - Prominent Grid Buttons === */
.main-menu-sidebar .nav-section:first-child .nav-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.main-menu-sidebar .nav-section:first-child .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    aspect-ratio: 1;
    padding: 16px 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(212, 168, 87, 0.2);
    border-radius: 12px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.main-menu-sidebar .nav-section:first-child .nav-btn:hover {
    background: linear-gradient(135deg, rgba(212, 168, 87, 0.2) 0%, rgba(212, 168, 87, 0.1) 100%);
    border-color: rgba(212, 168, 87, 0.5);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 168, 87, 0.25);
}

.nav-section:first-child .nav-icon {
    width: 36px;
    height: 36px;
}

.nav-section:first-child .nav-icon svg {
    width: 32px;
    height: 32px;
}

.nav-section:first-child .nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* === Other Sections - Compact Text Links === */
.main-menu-sidebar .nav-section:not(:first-child) .nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.main-menu-sidebar .nav-section:not(:first-child) .nav-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    width: auto;
    aspect-ratio: unset;
}

.main-menu-sidebar .nav-section:not(:first-child) .nav-btn:hover {
    background: rgba(212, 168, 87, 0.1);
    color: var(--accent-gold);
    transform: none;
    box-shadow: none;
}

.nav-section:not(:first-child) .nav-icon {
    width: 18px;
    height: 18px;
}

.nav-section:not(:first-child) .nav-icon svg {
    width: 16px;
    height: 16px;
}

.nav-section:not(:first-child) .nav-label {
    font-size: 13px;
    white-space: nowrap;
}

/* === General Nav Elements === */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: inherit;
}

.nav-label {
    line-height: 1.2;
}

.nav-section-dev {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn-dev {
    opacity: 0.5;
    font-size: 11px;
}

/* === Right Content Area === */
.news-carousel-container {
    position: absolute;
    top: 0;
    left: 280px;
    right: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 100%);
    z-index: 10;
}

.carousel-nav {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: rgba(212, 168, 87, 0.2);
    color: var(--accent-gold);
}

.carousel-nav svg {
    width: 16px;
    height: 16px;
}

.news-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}

.news-carousel-track::-webkit-scrollbar {
    display: none;
}

.news-card {
    flex-shrink: 0;
    width: 180px;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 168, 87, 0.3);
    box-shadow: 0 4px 20px rgba(212, 168, 87, 0.15);
}

.news-card-image {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-icon {
    font-size: 28px;
}

.news-card-content {
    padding: 10px;
}

.news-card-content h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.news-card-content p {
    font-size: 10px;
    color: var(--text-muted);
    margin: 0;
}

/* === Hero Area === */
.hero-artwork-area {
    position: absolute;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(212, 168, 87, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #080b12 0%, #0d1117 50%, #080b12 100%);
}

/* === Hero Banner Image === */
.hero-banner-image {
    position: absolute;
    bottom: 100px;
    right: 0;
    width: 85%;
    max-width: 1200px;
    height: auto;
    opacity: 0.9;
    pointer-events: none;
    z-index: 1;
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
}

/* Magical particles */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(0,212,255,0.5), transparent),
        radial-gradient(2px 2px at 60% 20%, rgba(212,168,87,0.4), transparent),
        radial-gradient(2px 2px at 80% 50%, rgba(168,85,247,0.4), transparent),
        radial-gradient(3px 3px at 15% 80%, rgba(255,255,255,0.3), transparent),
        radial-gradient(3px 3px at 85% 40%, rgba(0,212,255,0.4), transparent);
    background-size: 250px 250px;
    animation: drift 15s linear infinite;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, -15px); }
}

/* Aether swirl */
.hero-aether-swirl {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        conic-gradient(from 0deg at 50% 70%, transparent 0deg, rgba(0,212,255,0.15) 45deg, transparent 90deg),
        conic-gradient(from 180deg at 40% 50%, transparent 0deg, rgba(168,85,247,0.1) 60deg, transparent 120deg);
    animation: swirl 25s linear infinite;
    opacity: 0.6;
}

@keyframes swirl {
    to { transform: rotate(360deg); }
}

/* Hero character area */
.hero-character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 80%;
    pointer-events: none;
}

.hero-silhouette {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Magic circle on ground */
.magic-circle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(0,212,255,0.4) 0%, rgba(0,212,255,0.1) 50%, transparent 70%);
    filter: blur(15px);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* Glow effect */
.hero-glow {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 350px;
    background:
        radial-gradient(ellipse at 50% 80%, rgba(0,212,255,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168,85,247,0.15) 0%, transparent 60%);
    animation: glow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Floating cards */
.floating-cards {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-card {
    position: absolute;
    width: 50px;
    height: 70px;
    background: linear-gradient(145deg, #1a1e2e, #0d1117);
    border: 1px solid rgba(212,168,87,0.3);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.floating-card.card-1 {
    top: 20%;
    right: 15%;
    transform: rotate(12deg);
    animation: float1 5s ease-in-out infinite;
}

.floating-card.card-2 {
    top: 30%;
    right: 22%;
    transform: rotate(-8deg);
    animation: float2 6s ease-in-out infinite 0.5s;
    opacity: 0.7;
}

.floating-card.card-3 {
    top: 15%;
    right: 28%;
    transform: rotate(5deg);
    animation: float3 4s ease-in-out infinite 1s;
    opacity: 0.5;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0) rotate(12deg); }
    50% { transform: translateY(-12px) rotate(15deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-10px) rotate(-5deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-8px) rotate(8deg); }
}

/* === Bottom News Banner === */
.hero-artwork-area .hero-news-banner {
    position: absolute;
    bottom: 24px;
    top: auto;
    right: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.95) 0%, rgba(22, 33, 62, 0.9) 100%);
    border: 1px solid rgba(212, 168, 87, 0.3);
    pointer-events: auto;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.news-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.news-banner-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.news-banner-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.news-banner-text p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.duel-live-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.duel-live-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
    background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 100%);
}

.duel-icon {
    font-size: 18px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .main-menu-sidebar {
        width: 60px;
        min-width: 60px;
        padding: 8px;
    }

    .nav-label {
        display: none;
    }

    .nav-btn {
        justify-content: center;
        padding: 12px 8px;
    }

    .nav-section-header {
        display: none;
    }

    .news-carousel-container,
    .hero-artwork-area {
        left: 60px;
    }

    .header-center {
        display: none;
    }
}

/* === Hide old styles === */
.main-content-area,
.left-navigation-panel,
.center-content-area,
.nav-button-group,
.nav-button-themed,
.featured-content-display,
.news-panel-styled,
.top-player-info-bar {
    display: none !important;
}
