:root {
    --bg-dark-overlay: rgba(18, 16, 26, 0.90); /* Deep magical purple-black overlay */
    --brand-primary: #ff5964; /* Vibrant coral red */
    --brand-secondary: #00f2fe; /* Bright glowing neon blue */
    --accent-yellow: #ffe156; /* Sunny gold */
    --accent-green: #39ff14; /* Level-up neon green */
    --text-light: #f4f9ff;
    --text-muted: #a3a8cc;
    --card-shadow: 0 8px 0px rgba(0, 0, 0, 0.4);
    --btn-shadow-primary: 0 6px 0px #b21e29;
    --btn-shadow-secondary: 0 6px 0px #0072ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    color: var(--text-light);
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    
    /* Full screen pixel image background fixed in place */
    background: linear-gradient(var(--bg-dark-overlay), var(--bg-dark-overlay)), 
                url('frontendasset/previewgame.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

h1, h2, h3, .btn-playful {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

/* Semi-transparent Glass Header Navigation */
header {
    background-color: rgba(25, 22, 38, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid rgba(255, 255, 255, 0.1);
    padding: 12px 40px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Container designed specifically for logo.jpg asset */
.logo-container {
    display: flex;
    align-items: center;
    z-index: 1010;
}

.logo-img {
    height: 54px; 
    width: auto;
    display: block;
    object-fit: contain;
}

/* Responsive Navigation Architecture */
.nav-menu-toggle {
    display: none;
}

#menu-checkbox {
    display: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 10px;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--brand-secondary);
}

/* Nav link icon formatting */
.nav-icon {
    font-size: 1.15rem;
    display: inline-block;
}

.nav-divider {
    width: 2px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-auth a {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    display: inline-flex;
}

.nav-auth a:hover {
    background-color: var(--brand-primary);
    color: #fff;
}

/* ── Info Dropdown in Navigation ─────────────────────────────────── */
.nav-info-dropdown {
    position: relative;
}

.nav-info-trigger {
    cursor: pointer;
}

.nav-info-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(25, 22, 38, 0.98);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px 0;
    min-width: 240px;
    list-style: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    flex-direction: column;
}

.nav-info-menu li {
    width: 100%;
}

.nav-info-menu a {
    display: flex;
    width: 100%;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0;
    white-space: nowrap;
    gap: 10px;
}

.nav-info-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--brand-secondary);
}

/* Show dropdown on hover (desktop) */
.nav-info-dropdown:hover .nav-info-menu {
    display: flex;
}

/* Keep open after click (mobile tap toggle) */
.nav-info-dropdown.open .nav-info-menu {
    display: flex;
}

@media (max-width: 1050px) and (min-width: 901px) {
    nav a {
        font-size: 0.85rem;
        padding: 6px 8px;
        gap: 5px;
    }
    nav { gap: 15px; }
}

@media (max-width: 900px) {
    header {
        padding: 12px 20px;
    }

    .nav-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1010;
    }

    .nav-menu-toggle span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: var(--text-light);
        border-radius: 3px;
        transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 280px;
        height: 100vh;
        background-color: rgba(25, 22, 38, 0.98);
        backdrop-filter: blur(20px);
        border-left: 3px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 30px 40px;
        gap: 25px;
        transition: right 0.3s ease-in-out;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    nav a {
        display: flex;
        width: 100%;
        font-size: 1.15rem;
        padding: 12px 16px;
    }

    .nav-divider {
        width: 100%;
        height: 2px;
        margin: 5px 0;
    }

    .nav-auth {
        width: 100%;
    }
    
    .nav-auth a {
        width: 100%;
        justify-content: center;
    }

    #menu-checkbox:checked ~ nav {
        right: 0; 
    }

    #menu-checkbox:checked ~ .nav-menu-toggle span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--brand-primary);
    }

    #menu-checkbox:checked ~ .nav-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    #menu-checkbox:checked ~ .nav-menu-toggle span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--brand-primary);
    }

    /* ── Info Dropdown — Mobile ──────────────────────────────── */
    .nav-info-menu {
        position: static;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        margin-top: 4px;
        min-width: 0;
        box-shadow: none;
    }

    .nav-info-menu a {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
}

/* Hero Panel Layout */
.hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 80px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 20vh;
}

.hero-section h1 {
    font-size: 4rem;
    line-height: 1.1;
    color: var(--text-light);
    margin-bottom: 24px;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .hero-section p {
        font-size: 1.1rem;
    }
}

.hero-section h1 span {
    color: var(--brand-secondary);
}

.hero-section p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 600;
    max-width: 900px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Search Utility Block — dropdown + input + button row */
.search-row {
    width: 100%;
    max-width: 720px;
    margin-top: 10px;
    display: flex;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 6px 0px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
}

/* Category dropdown (left side) */
.search-dropdown {
    flex-shrink: 0;
    width: 110px;
    padding: 0 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background-color: rgba(25, 22, 38, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-right: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 0 0 20px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3a8cc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-dropdown:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.search-dropdown:focus {
    border-color: var(--brand-secondary);
}

.search-dropdown option {
    background: #1a1726;
    color: #fff;
    font-weight: 600;
}

/* Text input (center) */
.search-input {
    flex: 1;
    min-width: 0;
    padding: 16px 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    background-color: rgba(18, 16, 26, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-right: none;
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--brand-secondary);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Search button (right side) */
.search-btn {
    flex-shrink: 0;
    padding: 0 26px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--brand-primary);
    border: 3px solid var(--brand-primary);
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
    box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
}

.search-btn:hover {
    filter: brightness(1.15);
}

.search-btn:active {
    filter: brightness(0.9);
    transform: scale(0.97);
}

.search-btn-icon {
    font-size: 1.3rem;
    display: inline-block;
    pointer-events: none;
}

/* Responsive: stack layout on small screens */
@media (max-width: 600px) {
    .search-row {
        flex-wrap: wrap;
        box-shadow: none;
        gap: 8px;
        overflow: visible;
    }
    .search-dropdown {
        width: 100%;
        border-radius: 14px;
        border-right: 3px solid rgba(255, 255, 255, 0.15);
        padding: 12px 28px 12px 14px;
        background-position: right 14px center;
    }
    .search-input {
        flex: auto;
        width: 100%;
        border: 3px solid rgba(255, 255, 255, 0.15);
        border-radius: 14px;
        padding: 14px 16px;
    }
    .search-btn {
        width: 100%;
        border-radius: 14px;
        padding: 14px;
    }
}

/* Content Zones */
.game-zones-container {
    max-width: 1200px;
    margin: 0 auto 100px;
    padding: 0 20px;
}

.zone-section {
    margin-bottom: 80px;
}

.zone-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    border-bottom: 4px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.zone-header h2 {
    font-size: 2.4rem;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.4);
}

.zone-header .zone-icon {
    font-size: 2.5rem;
}

.quest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

/* Game Element Cards */
.game-card {
    background: rgba(30, 27, 46, 0.85);
    backdrop-filter: blur(8px);
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
}

.quest-card:hover { border-color: var(--accent-yellow); }
.training-card:hover { border-color: var(--brand-secondary); }
.practice-card:hover { border-color: #9d4edd; }

.game-card h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 25px;
    line-height: 1.3;
}

/* Practice Hall Segment Styles */
.practice-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.practice-left {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.practice-left h3 {
    font-size: 3.2rem;
    line-height: 1.1;
    color: var(--text-light);
    margin-bottom: 0;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.6);
}

.practice-left h3 span {
    color: var(--brand-secondary);
}

.practice-left p {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-playful {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 14px 28px;
    font-size: 1.1rem;
    border-radius: 16px;
    color: #fff;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-playful:active {
    transform: translateY(4px);
}

.btn-red {
    background-color: var(--brand-primary);
    box-shadow: var(--btn-shadow-primary);
}
.btn-red:active { box-shadow: 0 2px 0px #b21e29; }

.btn-blue {
    background-color: #0072ff;
    box-shadow: var(--btn-shadow-secondary);
}
.btn-blue:active { box-shadow: 0 2px 0px #0044aa; }

.game-frame {
    background-color: #231f33;
    border: 4px solid #3d355c;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 8px 0px #151221;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-frame-header {
    background-color: #1a1726;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #3d355c;
}

.frame-badge {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--accent-yellow);
}

.game-preview {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

@media (max-width: 950px) {
    .practice-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .practice-left {
        text-align: center;
        align-items: center;
    }
    .practice-left h3 {
        font-size: 2.5rem;
    }
    .btn-group {
        justify-content: center;
    }
}

/* Rewards HUD Indicators */
.rewards-hud {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(18, 16, 26, 0.7);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: fit-content;
}

.reward-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: 'Fredoka', sans-serif;
}

/* Pure CSS Pixel Elements */
.pixel-coin {
    width: 14px;
    height: 14px;
    background-color: #ffd166;
    border-radius: 3px;
    position: relative;
    box-shadow: inset -2px -2px 0px #f7b731, inset 2px 2px 0px #fff275, 0 0 0 2px #ffb300;
    display: inline-block;
    flex-shrink: 0;
}

.pixel-xp-bolt {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid var(--accent-green);
    position: relative;
    display: inline-block;
    transform: skewX(-15deg);
    flex-shrink: 0;
}
.pixel-xp-bolt::after {
    content: '';
    position: absolute;
    top: 6px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 10px solid var(--accent-green);
}

.reward-xp { color: var(--accent-green); }
.reward-coin { color: var(--accent-yellow); }

/* Library Section */
.library-section {
    min-height: calc(100vh - 130px);
    background: linear-gradient(var(--bg-dark-overlay), var(--bg-dark-overlay)),
                url('frontendasset/practiceroom.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.library-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 80px;
}

.user-welcome {
    text-align: center;
    margin-bottom: 40px;
}

.user-welcome p {
    font-size: 2rem;
    font-family: 'Fredoka', sans-serif;
    color: var(--text-light);
}

.user-welcome strong {
    color: var(--brand-secondary);
}

/* Footer */
footer {
    background-color: #0c0a12;
    color: var(--text-muted);
    text-align: center;
    padding: 50px 20px;
    font-weight: 600;
    border-top: 4px solid rgba(255, 255, 255, 0.05);
}