@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #8b5cf6;
    /* Modern Violet */
    --primary-hover: #a78bfa;
    /* Light Violet */
    --secondary: #0f172a;
    /* Slate 900 */
    --accent: #d946ef;
    /* Pink/Fuchsia Highlight */
    --success: #10b981;
    /* Premium Emerald */
    --danger: #ef4444;
    /* Coral Red */
    --bg-dark: #0f0b26;
    /* Deep Space Dark */
    --card-bg: rgba(30, 27, 75, 0.45);
    /* Transparent Indigo Glass */
    --card-border: rgba(139, 92, 246, 0.18);
    /* Soft Purple Border */
    --text-primary: #f8fafc;
    /* Off-white */
    --text-secondary: #94a3b8;
    /* Slate 400 */
}

/* Global resets for the Deep Space Theme */
body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top, #1c1543 0%, #0f0728 50%, #05020c 100%) !important;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Text utility overrides */
.text-dark {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Glassmorphic Cards */
.card,
.hero-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1.25rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

.hero-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(217, 70, 239, 0.05)) !important;
    padding: 3rem 2rem;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
}

/* Form elements styling */
.form-control,
.form-select {
    background-color: rgba(15, 11, 38, 0.6) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    color: var(--text-primary) !important;
    border-radius: 0.75rem !important;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(15, 11, 38, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3) !important;
    color: var(--text-primary) !important;
}

/* Category cards */
.category-card {
    background: rgba(30, 27, 75, 0.3) !important;
    border: 1px solid rgba(139, 92, 246, 0.12) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease !important;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent) !important;
    box-shadow: 0 15px 35px rgba(217, 70, 239, 0.25) !important;
}

/* Premium buttons */
.btn-primary,
.btn-guest {
    background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 0.75rem !important;
    padding: 0.6rem 1.5rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}

.btn-primary:hover,
.btn-guest:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5) !important;
    filter: brightness(1.1);
}

.btn-outline-light {
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s ease !important;
}

.btn-outline-light:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Announcement Bar */
.announcement-bar {
    background: var(--accent) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.7rem 0;
    box-shadow: 0 2px 10px rgba(217, 70, 239, 0.3);
}

/* Premium Quiz Option Buttons */
.quiz-option {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(15, 11, 38, 0.4);
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateX(4px);
}

/* Correct Answer Highlights */
.quiz-option.option-correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

/* Wrong Answer Highlights */
.quiz-option.option-wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--danger) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

.locked-button {
    opacity: 0.65;
    box-shadow: none;
}

.quiz-card,
#resultCard {
    background: var(--card-bg) !important;
    border-radius: 1.25rem;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3) !important;
}

.progress {
    height: 0.85rem !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    overflow: hidden !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #8b5cf6, #ec4899) !important;
    border-radius: 1rem !important;
    transition: width 0.4s ease !important;
}

/* Navbar styles */
.bg-dark {
    background-color: rgba(15, 7, 40, 0.8) !important;
}

.navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.navbar-brand {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Navbar nav items stay HORIZONTAL in a single line on Desktop */
.navbar-expand-lg .navbar-nav {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.25rem 0.75rem;
}

@media (max-width: 991.98px) {
    .navbar-collapse .navbar-nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
        padding-top: 0.75rem;
    }
}

/* Table styles */
.table-dark {
    --bs-table-bg: rgba(30, 27, 75, 0.3) !important;
    --bs-table-color: var(--text-primary) !important;
    --bs-table-striped-bg: rgba(30, 27, 75, 0.45) !important;
    --bs-table-striped-color: var(--text-primary) !important;
    --bs-table-border-color: rgba(139, 92, 246, 0.12) !important;
    background-color: transparent !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
}

.table-dark th {
    background: rgba(139, 92, 246, 0.15) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3) !important;
    font-weight: 700;
}

.table-dark td {
    color: var(--text-secondary) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08) !important;
}

.bg-light {
    background-color: rgba(30, 27, 75, 0.2) !important;
}

/* Landing Page theme overrides */
.landing-page .welcome-card,
.landing-page .categories-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
}

.landing-page .gradient-text {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.landing-page .alert-premium {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    color: #c084fc !important;
    font-size: 0.95rem;
}

.landing-page .btn-login {
    background: transparent !important;
    border: 2px solid var(--primary) !important;
    color: #e2e8f0 !important;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.landing-page .btn-login:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4) !important;
}

.landing-page .btn-register {
    color: #94a3b8 !important;
    transition: color 0.2s ease;
}

.landing-page .btn-register:hover {
    color: var(--accent) !important;
}

/* Level Selection Container (Deep Space Dark Glass Theme) */
.level-selection-container {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.75), rgba(15, 11, 38, 0.9)) !important;
    border-radius: 2rem !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4) !important;
    padding: 2.5rem 2rem !important;
    position: relative;
    overflow: hidden;
}

.level-selection-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(217, 70, 239, 0.1), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.level-selection-title {
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(217, 70, 239, 0.3);
    letter-spacing: 1.5px;
    position: relative;
    z-index: 2;
}

/* Highly Rounded Glossy Level Card Button */
.level-card {
    aspect-ratio: 1 / 1;
    width: 64px;
    height: 64px;
    border-radius: 1.1rem !important;
    border: 2.5px solid #ffffff !important;
    background: linear-gradient(135deg, #ffbe1a 0%, #f97316 100%) !important;
    /* Glossy Orange */
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 6px 12px rgba(249, 115, 22, 0.35) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease !important;
    cursor: pointer;
    margin: 0;
}

.level-card:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 10px 16px rgba(249, 115, 22, 0.45) !important;
}

.level-card .level-number {
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    line-height: 1.1;
}

.level-card .level-label {
    font-size: 0.52rem !important;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.75);
    margin-top: -2px;
    letter-spacing: 0.4px;
}

/* Active current level with selection border glow */
.level-current {
    transform: scale(1.1);
    border: 4px solid #ffffff !important;
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.5), 0 0 25px rgba(255, 255, 255, 0.85), 0 12px 24px rgba(249, 115, 22, 0.5) !important;
    animation: bounce-current 2s infinite ease-in-out;
}

@keyframes bounce-current {

    0%,
    100% {
        transform: scale(1.1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-5px);
    }
}

/* Locked Stage (Semi-transparent, greyed out) */
.level-locked {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f0b26 100%) !important;
    /* Deep dark indigo */
    opacity: 0.5;
    border: 3px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.level-locked:hover {
    transform: none !important;
    box-shadow: none !important;
}

.level-locked .level-number {
    color: rgba(255, 255, 255, 0.25) !important;
}

.level-locked .level-label {
    color: rgba(255, 255, 255, 0.18) !important;
}

/* Completed stage - Green Glossy */
.level-completed {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
    border: 3.5px solid #ffffff !important;
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.4), 0 8px 16px rgba(5, 150, 105, 0.3) !important;
}

.level-completed .level-number {
    color: #022c22 !important;
}

.level-completed .level-label {
    color: rgba(2, 44, 34, 0.7);
}

/* Category Page Specific Elements */
.category-icon-circle {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(217, 70, 239, 0.1));
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    font-size: 1.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-card:hover .category-icon-circle {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(217, 70, 239, 0.35);
}

/* Level Badges */
.level-badge {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.level-locked .level-badge {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.level-completed .level-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.level-current .level-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.level-card:hover .level-badge {
    transform: scale(1.08);
}

/* Circular Medals Grid (Foursquare style) */
.achievement-medal {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.achievement-medal:hover {
    transform: scale(1.12);
}

/* Unlocked Medals styling */
.achievement-medal.unlocked {
    border: 2.5px solid #ffffff !important;
    background: linear-gradient(135deg, #ffbe1a 0%, #f97316 100%);
    /* Gold/Orange */
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 5px 12px rgba(249, 115, 22, 0.45), 0 0 8px rgba(255, 190, 26, 0.25) !important;
}

.achievement-medal.unlocked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    pointer-events: none;
}

.achievement-medal.unlocked .medal-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
    line-height: 1;
}

/* Locked Medals styling */
.achievement-medal.locked {
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f0b26 100%) !important;
    opacity: 0.6;
    box-shadow: none !important;
}

.achievement-medal.locked .medal-icon {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
}

/* Text styles below medal */
.medal-name {
    text-transform: capitalize;
    letter-spacing: 0.3px;
    line-height: 1.25;
    word-break: break-word;
    text-align: center;
}

/* Specific gradients for unlocked achievements depending on their type / icon to make it colorful like Foursquare */
.achievement-medal.unlocked[data-icon="star"] {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%) !important;
    /* Blue */
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.4), 0 6px 15px rgba(0, 114, 255, 0.45) !important;
}

.achievement-medal.unlocked[data-icon="gamepad"] {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
    /* Green */
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.4), 0 6px 15px rgba(5, 150, 105, 0.45) !important;
}

.achievement-medal.unlocked[data-icon="crown"] {
    background: linear-gradient(135deg, #d946ef 0%, #8b5cf6 100%) !important;
    /* Purple/Magenta */
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.4), 0 6px 15px rgba(139, 92, 246, 0.45) !important;
}

/* Responsive Overrides (Solves the "too big on mobile" issue) */
@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
    }

    h1,
    .display-5 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.6rem !important;
    }

    h3 {
        font-size: 1.35rem !important;
    }

    h4 {
        font-size: 1.15rem !important;
    }

    h5 {
        font-size: 1rem !important;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    main {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .card,
    .hero-card {
        padding: 1.25rem !important;
    }

    .hero-card {
        padding: 1.75rem 1.25rem !important;
    }

    .quiz-option {
        padding: 0.75rem 1rem;
        margin-bottom: 0.6rem;
        font-size: 0.95rem;
    }

    .navbar {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .table {
        font-size: 0.85rem;
    }

    .table td,
    .table th {
        padding: 0.5rem 0.4rem !important;
    }

    .d-grid {
        width: 100% !important;
    }

    .row {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    /* Responsive margins */
    .mt-5,
    .my-5 {
        margin-top: 2rem !important;
    }

    .mb-4,
    .my-4 {
        margin-bottom: 1.25rem !important;
    }
}

/* ==========================================
   FUTURISTIC SCI-FI QUIZ GAMEPLAY LAYOUT
   ========================================== */

/* Main container and Row for centering and side lines */
.sci-fi-question-wrapper {
    width: 100%;
    margin: 2rem 0;
}

.sci-fi-question-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Connecting side lines to edges */
.sci-fi-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(217, 70, 239, 0.02), rgba(139, 92, 246, 0.45));
    position: relative;
    z-index: 1;
}

.sci-fi-line-right {
    background: linear-gradient(270deg, rgba(217, 70, 239, 0.02), rgba(139, 92, 246, 0.45));
}

/* Glow lines above & below containers */
.sci-fi-glow-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.sci-fi-glow-line.top {
    width: 160px;
    margin-bottom: -1px;
}

.sci-fi-glow-line.bottom {
    width: 160px;
    margin-top: -1px;
}

/* Question Box Outer */
.sci-fi-question-box-outer {
    flex: 0 1 660px;
    width: 100%;
    position: relative;
    z-index: 2;
    margin: 0 1rem;
}

/* Question Stretched Hexagon Box (Border) */
.sci-fi-question-box {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(217, 70, 239, 0.8) 50%, rgba(139, 92, 246, 0.15) 100%);
    padding: 2px;
    /* Represents the border width */
    clip-path: polygon(35px 0%, calc(100% - 35px) 0%, 100% 50%, calc(100% - 35px) 100%, 35px 100%, 0% 50%);
    width: 100%;
    position: relative;
}

/* Question Stretched Hexagon Box Inner */
.sci-fi-question-box-inner {
    background: rgba(15, 7, 40, 0.95);
    color: #ffffff;
    padding: 1.2rem 2.4rem;
    clip-path: polygon(34px 0%, calc(100% - 34px) 0%, 100% 50%, calc(100% - 34px) 100%, 34px 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 90px;
}

.sci-fi-question-box-inner h4 {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    font-size: 1.15rem;
    line-height: 1.4;
}

/* Options 2x2 Grid Layout */
#quizOptions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3.5rem;
    row-gap: 1.8rem;
    margin-top: 2rem;
    position: relative;
}

/* Option container for connection lines */
.sci-fi-option-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
}

/* Horizontal outer connectors for left options (A & C) */
#quizOptions .sci-fi-option-wrapper:nth-child(odd)::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, rgba(217, 70, 239, 0.02), rgba(139, 92, 246, 0.35));
    z-index: 1;
}

/* Horizontal connector between left and right options */
#quizOptions .sci-fi-option-wrapper:nth-child(odd)::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 3.5rem;
    /* Matches column-gap exactly */
    height: 2px;
    background: rgba(139, 92, 246, 0.35);
    z-index: 1;
}

/* Horizontal outer connectors for right options (B & D) */
#quizOptions .sci-fi-option-wrapper:nth-child(even)::before {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 200px;
    height: 2px;
    background: linear-gradient(270deg, rgba(217, 70, 239, 0.02), rgba(139, 92, 246, 0.35));
    z-index: 1;
}

/* Glow lines above and below option boxes */
.sci-fi-glow-line.option-glow-top {
    width: 80px;
    height: 2px;
    margin-bottom: 5px;
}

.sci-fi-glow-line.option-glow-bottom {
    width: 80px;
    height: 2px;
    margin-top: 5px;
}

/* Option Hexagon Card (Border Container) */
.quiz-option.sci-fi-option {
    display: block;
    width: 100%;
    padding: 2.2px !important;
    /* Represents border width */
    margin-bottom: 0 !important;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(217, 70, 239, 0.5) 50%, rgba(139, 92, 246, 0.15) 100%);
    clip-path: polygon(25px 0%, calc(100% - 25px) 0%, 100% 50%, calc(100% - 25px) 100%, 25px 100%, 0% 50%);
    border: none !important;
    border-radius: 0 !important;
    position: relative;
    z-index: 3;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Option Hexagon Card Inner */
.quiz-option.sci-fi-option .option-inner {
    background: rgba(12, 6, 32, 0.95);
    color: var(--text-primary);
    padding: 0.9rem 2.2rem;
    clip-path: polygon(24px 0%, calc(100% - 24px) 0%, 100% 50%, calc(100% - 24px) 100%, 24px 100%, 0% 50%);
    display: flex;
    align-items: center;
    text-align: left;
    width: 100%;
    height: 100%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Option Hover Effect */
.quiz-option.sci-fi-option:hover {
    transform: scale(1.03);
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.4) 0%, var(--accent) 50%, rgba(139, 92, 246, 0.4) 100%) !important;
}

.quiz-option.sci-fi-option:hover .option-inner {
    background: rgba(139, 92, 246, 0.25);
    color: #ffffff;
}

/* Correct Option Highlight */
.quiz-option.sci-fi-option.option-correct {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3) 0%, var(--success) 50%, rgba(16, 185, 129, 0.3) 100%) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25) !important;
}

.quiz-option.sci-fi-option.option-correct .option-inner {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Wrong Option Highlight */
.quiz-option.sci-fi-option.option-wrong {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.3) 0%, var(--danger) 50%, rgba(239, 68, 68, 0.3) 100%) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25) !important;
}

.quiz-option.sci-fi-option.option-wrong .option-inner {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
    .sci-fi-line {
        display: none !important;
    }

    .sci-fi-question-box-outer {
        margin: 0 !important;
    }

    .sci-fi-question-box {
        clip-path: polygon(20px 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 20px 100%, 0% 50%);
    }

    .sci-fi-question-box-inner {
        clip-path: polygon(19px 0%, calc(100% - 19px) 0%, 100% 50%, calc(100% - 19px) 100%, 19px 100%, 0% 50%);
        padding: 1.5rem 1.8rem;
        min-height: 100px;
    }

    #quizOptions {
        grid-template-columns: 1fr;
        row-gap: 1.2rem;
        column-gap: 0;
    }

    #quizOptions .sci-fi-option-wrapper::before,
    #quizOptions .sci-fi-option-wrapper::after {
        display: none !important;
    }

    .quiz-option.sci-fi-option {
        clip-path: polygon(15px 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0% 50%);
    }

    .quiz-option.sci-fi-option .option-inner {
        clip-path: polygon(14px 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0% 50%);
        padding: 0.8rem 1.4rem;
    }
}

/* ==========================================
   LEADERBOARD PODIUM LAYOUT STYLING
   ========================================== */
.podium-container {
    padding-top: 1rem;
    position: relative;
    z-index: 5;
}

.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Rank 1 podium settings (Gold, center, tall) */
.podium-card.rank-1 .podium-avatar-wrapper {
    width: 92px;
    height: 92px;
    border: 4px solid #f59e0b !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
}

/* Rank 2 podium settings (Violet, left, medium) */
.podium-card.rank-2 .podium-avatar-wrapper {
    width: 78px;
    height: 78px;
    border: 3.5px solid #a78bfa !important;
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.35);
}

/* Rank 3 podium settings (Cyan, right, slightly smaller) */
.podium-card.rank-3 .podium-avatar-wrapper {
    width: 74px;
    height: 74px;
    border: 3.5px solid #00c6ff !important;
    box-shadow: 0 0 12px rgba(0, 198, 255, 0.3);
}

.podium-avatar-wrapper {
    border-radius: 50%;
    position: relative;
    background: rgba(30, 27, 75, 0.6);
}

.podium-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 2rem;
    text-transform: uppercase;
}

.podium-card.rank-1 .podium-avatar {
    font-size: 2.4rem;
}

.podium-rank-badge {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #00c6ff;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.podium-card.rank-1 .podium-rank-badge {
    background: #f59e0b;
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
}

.podium-card.rank-2 .podium-rank-badge {
    background: #a78bfa;
}

.podium-card.rank-3 .podium-rank-badge {
    background: #00c6ff;
}

.crown-icon {
    font-size: 1.8rem;
    animation: crown-float 2.5s infinite ease-in-out;
}

@keyframes crown-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-4px) rotate(3deg);
    }
}

/* ==========================================
   HOMEPAGE CUSTOM COMPACT LAYOUT STYLING
   ========================================== */

/* Hiding horizontal scrollbars */
.scrollbar-hidden {
    scrollbar-width: none;
    /* Firefox */
}

.scrollbar-hidden::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

/* Category Small Square Cards styling */
.category-card-square {
    background: rgba(30, 27, 75, 0.3) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer;
}

.category-card-square:hover {
    transform: scale(1.05);
    border-color: var(--accent) !important;
    box-shadow: 0 5px 15px rgba(217, 70, 239, 0.25) !important;
}

.category-icon-circle-small {
    background: rgba(139, 92, 246, 0.1);
    transition: all 0.2s ease;
}

.category-card-square:hover .category-icon-circle-small {
    border-color: var(--accent) !important;
}

/* Circular accuracy gauge style */
.accuracy-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   ADVANCED MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================== */

/* Table Responsiveness Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
}

@media (max-width: 991.98px) {

    /* Mobile Navbar Improvements */
    .navbar-collapse {
        background: rgba(15, 7, 40, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 1.25rem 1rem;
        border-radius: 1rem;
        margin-top: 0.75rem;
        border: 1px solid rgba(139, 92, 246, 0.25);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    }

    .navbar-nav .nav-link {
        padding: 0.65rem 1rem !important;
        border-radius: 0.6rem;
        font-weight: 500;
        font-size: 0.95rem;
        transition: background 0.2s ease;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: rgba(139, 92, 246, 0.2);
    }

    .navbar-nav .nav-item {
        margin-bottom: 0.35rem;
    }

    .navbar-nav .btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.9rem !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .table {
        min-width: 520px;
    }

    .modal-dialog {
        margin: 0.5rem !important;
    }

    .hero-card {
        padding: 1.5rem 1.15rem !important;
    }

    .hero-card h2 {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    main.py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 1rem !important;
    }

    .card {
        padding: 1.15rem 0.9rem !important;
        border-radius: 1rem !important;
    }

    /* Category Header & Profile Bar on Mobile */
    .user-avatar-main {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.15rem !important;
    }

    .badge-gems {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.65rem !important;
    }

    .category-tile-item {
        min-width: 80px !important;
        width: 80px !important;
    }

    .category-card-square {
        padding: 0.4rem !important;
        border-radius: 0.9rem !important;
    }

    .category-icon-circle-small {
        width: 34px !important;
        height: 34px !important;
    }

    /* Level Selection Screen Mobile Rules */
    .level-selection-container {
        padding: 1.25rem 0.65rem !important;
        border-radius: 1.25rem !important;
    }

    .level-selection-title {
        font-size: 1.35rem !important;
        letter-spacing: 1px !important;
    }

    .level-card {
        width: 66px !important;
        height: 66px !important;
        border-radius: 1rem !important;
        border-width: 2.5px !important;
    }

    .level-card .level-number {
        font-size: 1.35rem !important;
    }

    .level-card .level-label {
        font-size: 0.55rem !important;
        margin-top: -3px !important;
    }

    .achievements-section-card {
        padding: 1.15rem 0.75rem !important;
    }

    .achievement-medal {
        width: 44px !important;
        height: 44px !important;
    }

    .achievement-medal.unlocked .medal-icon {
        font-size: 1.3rem !important;
    }

    .medal-name {
        font-size: 0.72rem !important;
    }

    /* Sci-Fi Gameplay Box on Mobile Phones */
    .sci-fi-question-wrapper {
        margin: 0.85rem 0 !important;
    }
    
    .sci-fi-glow-line.top,
    .sci-fi-glow-line.bottom {
        width: 90px !important;
    }
    
    .sci-fi-question-box {
        clip-path: polygon(14px 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0% 50%) !important;
    }
    
    .sci-fi-question-box-inner {
        clip-path: polygon(13px 0%, calc(100% - 13px) 0%, 100% 50%, calc(100% - 13px) 100%, 13px 100%, 0% 50%) !important;
        padding: 1.1rem 1rem !important;
        min-height: 85px !important;
    }
    
    .sci-fi-question-box-inner h4 {
        font-size: 0.98rem !important;
        line-height: 1.4 !important;
    }
    
    #quizOptions {
        grid-template-columns: 1fr !important;
        row-gap: 0.75rem !important;
        margin-top: 1rem !important;
    }
    
    .quiz-option.sci-fi-option {
        clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0% 50%) !important;
    }
    
    .quiz-option.sci-fi-option .option-inner {
        clip-path: polygon(11px 0%, calc(100% - 11px) 0%, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0% 50%) !important;
        padding: 0.7rem 1rem !important;
        font-size: 0.88rem !important;
    }
    
    .option-prefix {
        font-size: 0.95rem !important;
        margin-right: 0.5rem !important;
    }

    /* Result Summary Modal Cards on Mobile */
    #resultCard .row {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }

    #resultCard .card {
        padding: 0.75rem 0.5rem !important;
    }

    #resultCard .card h5 {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
    }

    #resultCard .card p {
        font-size: 1.05rem !important;
        margin-bottom: 0 !important;
    }

    /* Leaderboard Podium Mobile Layout */
    .podium-container {
        gap: 0.35rem !important;
        margin-top: 0.85rem !important;
        margin-bottom: 1.75rem !important;
    }

    .podium-card.rank-1 .podium-avatar-wrapper {
        width: 68px !important;
        height: 68px !important;
    }

    .podium-card.rank-1 .podium-avatar {
        font-size: 1.7rem !important;
    }

    .podium-card.rank-2 .podium-avatar-wrapper {
        width: 56px !important;
        height: 56px !important;
    }

    .podium-card.rank-2 .podium-avatar {
        font-size: 1.35rem !important;
    }

    .podium-card.rank-3 .podium-avatar-wrapper {
        width: 52px !important;
        height: 52px !important;
    }

    .podium-card.rank-3 .podium-avatar {
        font-size: 1.25rem !important;
    }

    .podium-name {
        font-size: 0.75rem !important;
        max-width: 70px !important;
    }

    .podium-score {
        font-size: 0.75rem !important;
    }

    .crown-icon {
        font-size: 1.3rem !important;
    }

    /* Achievement Toast Notifications on Mobile */
    #achievement-toast-container {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
    }

    .achievement-toast {
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 0.8rem 1rem !important;
    }

    /* Level Selection Screen Mobile Optimizations (5 cards per row!) */
    .level-selection-container {
        padding: 0.75rem 0.4rem !important;
    }

    .level-selection-title {
        font-size: 1.25rem !important;
        letter-spacing: 0.8px !important;
    }

    .level-card {
        width: 52px !important;
        height: 52px !important;
        border-radius: 0.85rem !important;
        border-width: 2px !important;
    }

    .level-card .level-number {
        font-size: 1.15rem !important;
    }

    .level-card .level-label {
        font-size: 0.44rem !important;
        margin-top: -3px !important;
        letter-spacing: 0.2px !important;
    }
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION (MOBILE ONLY)
   ========================================== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(15, 7, 40, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(139, 92, 246, 0.25);
        justify-content: space-around;
        align-items: center;
        padding: 0.45rem 0.25rem 0.55rem 0.25rem;
        z-index: 1050;
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
    }

    main {
        padding-bottom: 1rem !important;
    }

    body {
        padding-bottom: 5.5rem !important;
    }
}

.bottom-nav-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.25s ease;
    padding: 0.35rem 0.6rem;
    border-radius: 0.75rem;
    flex: 1;
    text-align: center;
}

.bottom-nav-link .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bottom-nav-link .nav-icon svg {
    width: 20px;
    height: 20px;
    transition: fill 0.2s ease, filter 0.2s ease;
}

.bottom-nav-link:hover {
    color: #ffffff;
}

.bottom-nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.25));
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.bottom-nav-link.active .nav-icon {
    transform: translateY(-2px) scale(1.12);
}

.bottom-nav-link.active .nav-icon svg {
    fill: #a78bfa;
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.8));
}

.bottom-nav-link.active .nav-text {
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 768px) {
    footer {
        margin-bottom: 75px !important;
    }
}