/* Upgraded Cyberpunk Glassmorphism Design System */
:root {
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.4);
    --secondary: #ff003c;
    --secondary-glow: rgba(255, 0, 60, 0.4);
    --violet: #a855f7;
    --orange: #f59e0b;
    --blue: #3b82f6;
    
    --bg-color: #030308;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-glow: rgba(255, 255, 255, 0.02);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --text-glow: rgba(255, 255, 255, 0.1);
}

/* Reset and Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

/* Background canvas */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.gaming-font {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.12em;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(3, 3, 8, 0.6);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-orb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Search bar */
.search-container {
    position: relative;
    width: 320px;
}

#game-search {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

#game-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Portal Container */
.portal-container {
    width: 100%;
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    text-align: center;
    padding: 4rem 1rem;
    border-radius: 24px;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 150px;
    background: radial-gradient(ellipse, rgba(0, 240, 255, 0.08) 0%, transparent 60%);
    filter: blur(40px);
    pointer-events: none;
}

.glitch-text {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.05em;
    background: linear-gradient(180deg, #fff 50%, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4), 0 0 40px rgba(168, 85, 247, 0.2);
    margin-bottom: 1.5rem;
}

.hero-desc {
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
}

@media(max-width: 768px) {
    .glitch-text {
        font-size: 2.5rem;
    }
    .hero-desc {
        font-size: 1rem;
    }
}

/* Portal Main Content Grid Layout */
.portal-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
}

/* Catalog section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
}

.filter-btn:hover, .filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Game Card Style */
.game-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--card-theme);
    box-shadow: 0 12px 40px var(--card-glow-theme);
}

.card-status {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    z-index: 10;
}

.card-status.active {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.card-status.locked {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--orange);
    color: var(--orange);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--card-glow-theme) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.game-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 2;
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.card-icon {
    width: 30px;
    height: 30px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-weight: 300;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.play-btn-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.play-btn-link.locked {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Card Themes mapping */
.border-pink {
    --card-theme: var(--secondary);
    --card-glow-theme: var(--secondary-glow);
}
.border-orange {
    --card-theme: var(--orange);
    --card-glow-theme: rgba(245, 158, 11, 0.2);
}
.border-blue {
    --card-theme: var(--blue);
    --card-glow-theme: rgba(59, 130, 246, 0.2);
}
.border-purple {
    --card-theme: var(--violet);
    --card-glow-theme: rgba(168, 85, 247, 0.2);
}
.border-green {
    --card-theme: #10b981;
    --card-glow-theme: rgba(16, 185, 129, 0.2);
}

.bg-pink-glow { background: rgba(255, 0, 60, 0.08); }
.text-pink { color: var(--secondary); }
.border-pink-btn {
    border: 2px solid var(--secondary);
}
.border-pink-btn:hover:not(.locked) {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 15px var(--secondary);
}

.bg-orange-glow { background: rgba(245, 158, 11, 0.08); }
.text-orange { color: var(--orange); }
.border-orange-btn {
    border: 2px solid var(--orange);
}
.border-orange-btn:hover:not(.locked) {
    background: var(--orange);
    color: #000;
    box-shadow: 0 0 15px var(--orange);
}

.bg-blue-glow { background: rgba(59, 130, 246, 0.08); }
.text-blue { color: var(--blue); }
.border-blue-btn {
    border: 2px solid var(--blue);
}
.border-blue-btn:hover:not(.locked) {
    background: var(--blue);
    color: #000;
    box-shadow: 0 0 15px var(--blue);
}

.bg-purple-glow { background: rgba(168, 85, 247, 0.08); }
.text-purple { color: var(--violet); }
.border-purple-btn {
    border: 2px solid var(--violet);
}
.border-purple-btn:hover:not(.locked) {
    background: var(--violet);
    color: #000;
    box-shadow: 0 0 15px var(--violet);
}

.bg-green-glow { background: rgba(16, 185, 129, 0.08); }
.text-green { color: #10b981; }
.border-green-btn {
    border: 2px solid #10b981;
}
.border-green-btn:hover:not(.locked) {
    background: #10b981;
    color: #000;
    box-shadow: 0 0 15px #10b981;
}

/* Glass Panels Sidebar cards */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Profile Card Styling */
.profile-card {
    border-top: 4px solid var(--primary);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-ring {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    background: rgba(0, 240, 255, 0.05);
    padding: 0.25rem;
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.avatar-svg {
    width: 100%;
    height: 100%;
}

.username {
    font-size: 0.95rem;
    font-weight: 900;
    display: block;
    text-shadow: 0 0 5px var(--primary-glow);
}

.player-status {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: flashLED 1.2s infinite alternate;
}

/* Level Grid */
.level-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-tag {
    color: var(--primary);
}

.exp-counter {
    color: var(--text-muted);
}

.exp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--primary));
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Achievements Grid */
.achievements-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.box-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.achievement-item {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    position: relative;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: rgba(168, 85, 247, 0.08);
    border-color: var(--violet);
    color: var(--violet);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
}

.achievement-item.locked {
    background: rgba(0,0,0,0.3);
    color: var(--text-muted);
    opacity: 0.4;
}

.ach-icon {
    width: 22px;
    height: 22px;
}

/* Tooltip on hover */
.ach-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(3,3,8,0.95);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.5rem;
    width: 140px;
    font-size: 0.7rem;
    color: #fff;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 100;
    line-height: 1.3;
}

.achievement-item:hover .ach-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Updates logs panel */
.updates-card {
    border-top: 4px solid var(--secondary);
}

.news-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.update-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feed-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feed-date {
    font-size: 0.7rem;
    color: var(--secondary);
    font-weight: 700;
}

.feed-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.feed-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Footer */
.portal-footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Animations keyframes */
@keyframes flashLED {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}
