/* Valorant-Inspired Gaming UI Design System */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Valorant Color Palette */
    --primary-teal: #0F1419;
    --teal-light: #1E2328;
    --teal-bright: #53FDFD;
    --teal-muted: #0D1B2A;
    --red-primary: #FF4655;
    --red-dark: #BD3944;
    --red-bright: #FF6B6B;
    --yellow-accent: #FFCC02;
    --yellow-bright: #FFD700;
    --purple-accent: #7B68EE;
    --purple-light: #9370DB;

    /* Neutral Colors */
    --neutral-darkest: #0A0E13;
    --neutral-dark: #1C2025;
    --neutral-medium: #2D3238;
    --neutral-light: #3E4651;
    --neutral-lighter: #5A6169;
    --neutral-lightest: #7C8187;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #FFFBF5;
    --text-muted: #C9AA71;
    --text-accent: #53FDFD;
    --text-warning: #FF4655;

    /* Backgrounds */
    --bg-primary: linear-gradient(135deg, #0F1419 0%, #1E2328 100%);
    --bg-secondary: linear-gradient(180deg, #1C2025 0%, #0A0E13 100%);
    --bg-card: linear-gradient(135deg, #2D3238 0%, #1C2025 100%);
    --bg-overlay: rgba(15, 20, 25, 0.9);

    /* Fonts */
    --font-primary: 'Rajdhani', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Loading Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.loader-logo {
    animation: fadeInUp 1s ease-out;
}

.loader-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loader-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    animation: fadeIn 1s ease-out 0.5s both;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--red-primary);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: var(--teal-bright);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: var(--yellow-accent);
    animation-duration: 1s;
}

.loader-text {
    font-size: 16px;
    color: var(--text-muted);
    letter-spacing: 1px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Valorant-Inspired Top Navigation */
.valorant-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--neutral-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-left,
.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-right {
    justify-content: flex-end;
}

.nav-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-brand {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.nav-btn:hover {
    background: var(--neutral-medium);
    color: var(--text-primary);
}

.nav-btn-icon {
    font-size: 16px;
}

.nav-btn-text {
    font-size: 12px;
    font-weight: 600;
}

/* Modal Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    display: flex;
}

.modal-panel {
    background: var(--bg-card);
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-light);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.modal-content {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--neutral-light);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.leaderboard-entry:hover {
    border-color: var(--teal-bright);
    background: var(--neutral-medium);
}

.leaderboard-rank {
    font-size: 18px;
    font-weight: 600;
    color: var(--yellow-accent);
    min-width: 40px;
    text-align: center;
}

.leaderboard-info {
    flex: 1;
    margin-left: 16px;
}

.leaderboard-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.leaderboard-details {
    font-size: 14px;
    color: var(--text-muted);
}

.leaderboard-score {
    font-size: 18px;
    font-weight: 600;
    color: var(--teal-bright);
    text-align: right;
}

.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

/* Settings Panel */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.settings-overlay.active {
    display: flex;
}

.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-light);
}

.settings-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--neutral-medium);
    color: var(--text-primary);
}

.settings-content {
    padding: 24px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: var(--neutral-light);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--red-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--red-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-value {
    color: var(--text-accent);
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* Main Container */
.main-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.step-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.step-container.active {
    display: flex;
}

/* Home Screen */
.home-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.game-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 3px;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.game-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.5;
}

.play-button {
    background: var(--red-primary);
    border: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 20px 60px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(255, 70, 85, 0.4);
}

.play-button:hover {
    background: var(--red-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 70, 85, 0.5);
}

.play-button:active {
    transform: translateY(0);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    display: block;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-accent);
    display: block;
}

/* Step Content */
.step-content {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.step-header {
    margin-bottom: 40px;
}

.step-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

/* Carousel - Fixed hover overflow issues */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 30px 80px;
    /* Added padding to prevent hover clipping and accommodate nav buttons */
    overflow: visible;
    /* Ensure glow effects are visible */
}

.carousel-nav {
    background: var(--neutral-medium);
    border: 1px solid var(--neutral-light);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-nav:hover {
    background: var(--neutral-light);
    border-color: var(--teal-bright);
    color: var(--teal-bright);
}

.carousel-nav.prev {
    left: -60px;
}

.carousel-nav.next {
    right: -60px;
}

.carousel-viewport {
    width: 800px;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    /* Added padding to prevent hover clipping */
    margin: 0 20px;
    /* Add horizontal margin for glow effects */
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 20px;
}

/* Map Cards - Fixed hover overflow */
.map-card {
    flex: 0 0 240px;
    background: var(--bg-card);
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 10px 0;
    /* Added margin to prevent hover clipping */
}

.map-card:hover {
    border-color: var(--teal-bright);
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(83, 253, 253, 0.3);
}

.map-card.active {
    border-color: var(--yellow-accent);
    box-shadow: 0 0 20px rgba(255, 204, 2, 0.4);
}

.map-image {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.map-info {
    text-align: center;
}

.map-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.map-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Character Cards - Enhanced with overflow effects and pointer tracking */
.character-card {
    flex: 0 0 240px;
    background: var(--bg-card);
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin: 10px 0;
    /* Added margin to prevent hover clipping */
    position: relative;
    overflow: visible;
    /* Allow character image to overflow */
    transform-style: preserve-3d;
    perspective: 1000px;
}

.character-card:hover {
    border-color: var(--teal-bright);
    transform: translateY(-6px) rotateX(5deg);
    box-shadow: 0 12px 32px rgba(83, 253, 253, 0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--neutral-medium) 100%);
}

.character-card.active {
    border-color: var(--yellow-accent);
    box-shadow: 0 0 20px rgba(255, 204, 2, 0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 204, 2, 0.1) 100%);
}

.character-image {
    width: 140px;
    height: 160px;
    margin: -10px auto 16px;
    /* Negative margin to allow overflow */
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.character-card:hover .character-image {
    transform: translateY(-8px) scale(1.05);
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to contain to show full character */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.character-card:hover .character-image img {
    filter: drop-shadow(0 8px 16px rgba(83, 253, 253, 0.4));
}

.character-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.character-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Buttons */
.step-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.btn {
    background: transparent;
    border: 1px solid var(--neutral-light);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: var(--neutral-medium);
    border-color: var(--teal-bright);
    color: var(--teal-bright);
}

.btn-primary {
    background: var(--red-primary);
    border-color: var(--red-primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--red-bright);
    border-color: var(--red-bright);
    color: var(--text-primary);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
}

.btn-text {
    font-size: inherit;
    font-weight: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .valorant-nav {
        padding: 0 16px;
    }

    .nav-btn-text {
        display: none;
    }

    .nav-brand {
        font-size: 16px;
    }

    .game-title {
        font-size: 36px;
    }

    .carousel-container {
        padding: 40px 20px;
        /* Increased padding for mobile glow effects */
    }

    .carousel-viewport {
        width: 300px;
        padding: 25px 10px;
        /* Increased padding and reduced width for better fit */
        margin: 0 20px;
        /* Add horizontal margins for glow effects */
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
        /* Make buttons perfectly circular */
    }

    .carousel-nav.prev {
        left: -50px;
    }

    .carousel-nav.next {
        right: -50px;
    }

    .map-card,
    .character-card {
        margin: 25px 10px;
        /* Increased margin for mobile glow effects */
        max-width: 280px;
        /* Ensure cards don't exceed viewport */
        min-height: 220px;
        /* Ensure consistent card height */
    }

    .character-card:hover {
        /* Reduce glow intensity on mobile to prevent overflow */
        box-shadow: 0 8px 20px rgba(83, 253, 253, 0.2);
        transform: translateY(-5px);
    }

    .map-card:hover {
        /* Reduce glow intensity on mobile to prevent overflow */
        box-shadow: 0 6px 16px rgba(83, 253, 253, 0.2);
        transform: translateY(-3px);
    }

    .game-stats {
        flex-direction: column;
        gap: 20px;
    }

    .step-actions {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        margin-top: 30px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 16px 24px;
        font-size: 16px;
    }

    .play-button {
        width: 100%;
        max-width: 280px;
        padding: 18px 40px;
        font-size: 20px;
        margin-bottom: 30px;
    }

    .modal-panel {
        width: 90vw;
        margin: 20px;
    }
}

/* Additional mobile styles for very small screens */
@media (max-width: 400px) {
    .carousel-container {
        padding: 50px 15px;
        /* Even more padding for very small screens */
    }

    .carousel-viewport {
        width: 280px;
        padding: 30px 5px;
        margin: 0 15px;
    }

    .carousel-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .carousel-nav.prev {
        left: -45px;
    }

    .carousel-nav.next {
        right: -45px;
    }

    .map-card,
    .character-card {
        margin: 30px 5px;
        max-width: 260px;
        padding: 18px;
        /* Slightly reduced padding */
        min-height: 200px;
    }

    .character-card:hover,
    .map-card:hover {
        /* Minimal glow on very small screens */
        box-shadow: 0 4px 12px rgba(83, 253, 253, 0.15);
        transform: translateY(-2px);
        /* Reduced transform */
    }

    .btn {
        max-width: 260px;
        padding: 14px 20px;
        font-size: 15px;
    }

    .play-button {
        max-width: 260px;
        padding: 16px 36px;
        font-size: 18px;
        margin-bottom: 25px;
    }

    .game-title {
        font-size: 32px;
    }
}