 :root {
            --primary-color: #4361ee;
            --secondary-color: #3a0ca3;
            --accent-color: #f72585;
            --background-dark: #0b132b;
            --background-light: #1c2541;
            --text-light: #f8f9fa;
            --text-muted: #adb5bd;
        }

        body {
            background: linear-gradient(135deg, var(--background-dark), var(--background-light));
            color: var(--text-light);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            min-height: 100vh;
            padding-bottom: 70px;
            /* Space for bottom nav */
        }

        .app-header {
            background-color: rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 15px 0;
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .profile-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 15px;
        }

        .profile-info {
            display: flex;
            align-items: center;
        }

        .profile-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: var(--accent-color);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            font-weight: bold;
        }

        .profile-details h5 {
            margin: 0;
            font-size: 16px;
        }

        .profile-details p {
            margin: 0;
            font-size: 12px;
            color: var(--text-muted);
        }

        .profile-actions {
            display: flex;
            gap: 15px;
        }

        .profile-actions button {
            background: none;
            border: none;
            color: var(--text-light);
            font-size: 20px;
        }

        .section-title {
            margin: 20px 15px 15px;
            font-size: 22px;
            font-weight: 600;
        }

        .featured-game {
            background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)), url('https://via.placeholder.com/800x400');
            background-size: cover;
            background-position: center;
            border-radius: 15px;
            height: 180px;
            margin: 15px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            position: relative;
            overflow: hidden;
            transition: transform 0.3s;
        }

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

        .featured-game::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
            pointer-events: none;
        }

        .featured-game h3 {
            margin: 0;
            font-size: 24px;
            font-weight: bold;
            position: relative;
            z-index: 1;
        }

        .featured-game p {
            margin: 5px 0 0;
            font-size: 14px;
            color: var(--text-muted);
            position: relative;
            z-index: 1;
        }

        .featured-game .play-button {
            position: absolute;
            top: 15px;
            right: 15px;
            background-color: var(--accent-color);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            z-index: 2;
            transition: transform 0.2s;
        }

        .featured-game .play-button:hover {
            transform: scale(1.1);
        }

        .games-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
            padding: 0 15px;
        }

        .game-card {
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            overflow: hidden;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .game-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        .game-card-image {
            height: 100px;
            background-size: cover;
            background-position: center;
        }

        .game-card-content {
            padding: 12px;
        }

        .game-card-title {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
        }

        .game-card-info {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 12px;
            color: var(--text-muted);
        }

        /*        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            display: flex;
            justify-content: space-around;
            padding: 10px 0;
            z-index: 1000;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 12px;
        }

            .nav-item.active {
                color: var(--primary-color);
            }

            .nav-item i {
                font-size: 20px;
                margin-bottom: 3px;
            }*/
        /* Base mobile (bottom) nav styles */
        .nav-container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            display: flex;
            justify-content: space-around;
            padding: 10px 0;
            z-index: 1000;
            flex-direction: row;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 12px;
        }

        .nav-item.active {
            color: var(--primary-color);
        }

        .nav-item i {
            font-size: 20px;
            margin-bottom: 3px;
        }

        /* Desktop: Switch to vertical left nav */
        @media screen and (min-width: 768px) {
            .nav-container {
                top: 0;
                bottom: 0;
                left: 0;
                width: 70px;
                flex-direction: column;
                align-items: center;
                padding: 20px 0;
                border-right: 0.5px solid #4350ee;
                /* 👈 red vertical line */
            }

            .nav-item {
                margin: 20px 0;
            }
        }

        /* Desktop left nav width */
        :root {
            --nav-width: 70px;
        }

        @media screen and (min-width: 768px) {
            .main-content {
                margin-left: var(--nav-width);
            }
        }

        /* Animation for cards */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

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

        .game-card {
            animation: fadeIn 0.5s ease-out forwards;
        }

        .game-card:nth-child(2) {
            animation-delay: 0.1s;
        }

        .game-card:nth-child(3) {
            animation-delay: 0.2s;
        }

        .game-card:nth-child(4) {
            animation-delay: 0.3s;
        }

        .game-card:nth-child(5) {
            animation-delay: 0.4s;
        }

        .game-card:nth-child(6) {
            animation-delay: 0.5s;
        }

        /* Common Tab Styles */
        .app-tab {
            padding-bottom: 70px;
            /* Space for bottom nav */
        }

        /* Leaderboard Tab */
        .leaderboard-filters {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .filter-buttons {
            display: flex;
            gap: 10px;
        }

        .filter-button {
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-light);
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-button.active {
            background-color: var(--primary-color);
            color: white;
        }

        .game-selector select {
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-light);
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
        }

        .leaderboard-list {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            overflow: hidden;
        }

        .leaderboard-item {
            display: flex;
            align-items: center;
            padding: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            transition: background-color 0.2s;
        }

        .leaderboard-item:last-child {
            border-bottom: none;
        }

        .leaderboard-item:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .leaderboard-item.top-player {
            background-color: rgba(67, 97, 238, 0.1);
        }

        .leaderboard-item.current-player {
            background-color: rgba(247, 37, 133, 0.1);
        }

        .rank {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 18px;
            margin-right: 15px;
        }

        .top-player:nth-child(1) .rank {
            background-color: #FFD700;
            color: #000;
        }

        .top-player:nth-child(2) .rank {
            background-color: #C0C0C0;
            color: #000;
        }

        .top-player:nth-child(3) .rank {
            background-color: #CD7F32;
            color: #000;
        }

        .player-info {
            display: flex;
            align-items: center;
            flex: 1;
        }

        .player-details {
            display: flex;
            flex-direction: column;
        }

        .player-name {
            font-weight: 600;
            font-size: 16px;
        }

        .player-stats {
            font-size: 12px;
            color: var(--text-muted);
        }

        .player-score {
            font-weight: bold;
            font-size: 18px;
            color: var(--primary-color);
        }

        /* Profile Tab */
        .profile-header {
            position: relative;
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            padding-bottom: 20px;
            margin-bottom: 20px;
            text-align: center;
        }

        .profile-cover {
            height: 150px;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            border-radius: 15px 15px 0 0;
            margin-bottom: 60px;
        }

        .profile-avatar-large {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: var(--accent-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            font-weight: bold;
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid rgba(0, 0, 0, 0.2);
        }

        .profile-username {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .profile-tagline {
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 20px;
        }

        .profile-stats {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-bottom: 20px;
        }

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

        .stat-value {
            font-size: 24px;
            font-weight: bold;
            color: var(--primary-color);
        }

        .stat-label {
            font-size: 12px;
            color: var(--text-muted);
        }

        .edit-profile-button {
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-light);
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .edit-profile-button:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .profile-sections {
            padding: 0 10px;
        }

        .activity-list {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            overflow: hidden;
            margin-bottom: 30px;
        }

        .activity-item {
            display: flex;
            align-items: center;
            padding: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            color: var(--primary-color);
        }

        .activity-details {
            flex: 1;
        }

        .activity-title {
            font-weight: 600;
            font-size: 16px;
        }

        .activity-time {
            font-size: 12px;
            color: var(--text-muted);
        }

        .activity-points {
            font-weight: bold;
            color: var(--accent-color);
        }

        .achievements-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }

        .achievement-item {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            padding: 15px;
            text-align: center;
            transition: transform 0.2s;
        }

        .achievement-item:hover {
            transform: translateY(-5px);
        }

        .achievement-item.locked {
            opacity: 0.5;
        }

        .achievement-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
            font-size: 20px;
            color: var(--primary-color);
        }

        .achievement-name {
            font-weight: 600;
            font-size: 16px;
            margin-bottom: 5px;
        }

        .achievement-desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* Store Tab */
        .store-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .player-currency {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .currency-item {
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            padding: 5px 15px;
            display: flex;
            align-items: center;
            gap: 5px;
            font-weight: 600;
        }

        .currency-item.premium {
            background-color: rgba(247, 37, 133, 0.2);
            color: var(--accent-color);
        }

        .add-currency-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-light);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .store-categories {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            overflow-x: auto;
            padding-bottom: 10px;
        }

        .category-button {
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-light);
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
            white-space: nowrap;
        }

        .category-button.active {
            background-color: var(--primary-color);
            color: white;
        }

        .featured-offer {
            background: linear-gradient(135deg, rgba(67, 97, 238, 0.3) 0%, rgba(76, 201, 240, 0.3) 100%);
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .offer-content {
            flex: 1;
        }

        .offer-label {
            display: inline-block;
            background-color: var(--accent-color);
            color: white;
            font-size: 12px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 10px;
            margin-bottom: 10px;
        }

        .offer-title {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .offer-desc {
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 15px;
        }

        .offer-price {
            margin-bottom: 15px;
        }

        .original-price {
            text-decoration: line-through;
            color: var(--text-muted);
            margin-right: 10px;
        }

        .sale-price {
            font-size: 24px;
            font-weight: bold;
            color: var(--accent-color);
        }

        .buy-button {
            background-color: var(--accent-color);
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .buy-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(247, 37, 133, 0.3);
        }

        .store-items-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }

        .store-item {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            overflow: hidden;
            transition: transform 0.2s;
        }

        .store-item:hover {
            transform: translateY(-5px);
        }

        .item-image {
            height: 120px;
            background-size: cover;
            background-position: center;
        }

        .item-name {
            padding: 10px;
            font-weight: 600;
            text-align: center;
        }

        .item-price {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 0 10px 10px;
            font-weight: 600;
        }

        .premium-item .item-price {
            color: var(--accent-color);
        }

        .item-buy-button {
            width: 100%;
            padding: 8px;
            border: none;
            background-color: rgba(255, 255, 255, 0.1);
            color: var(--text-light);
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .item-buy-button:hover {
            background-color: var(--primary-color);
            color: white;
        }

        /* Settings Tab */
        .settings-section {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .settings-heading {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--primary-color);
        }

        .settings-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .settings-item:last-child {
            border-bottom: none;
        }

        .settings-label {
            font-size: 16px;
        }

        .settings-value {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .settings-edit-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
        }

        .settings-edit-btn:hover {
            color: var(--text-light);
        }

        .connected-accounts {
            display: flex;
            gap: 10px;
        }

        .account-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .account-btn.connected {
            background-color: var(--primary-color);
            color: white;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255, 255, 255, 0.2);
            transition: .4s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.toggle-slider {
            background-color: var(--primary-color);
        }

        input:checked+.toggle-slider:before {
            transform: translateX(26px);
        }

        .settings-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }

        .settings-button {
            padding: 10px 20px;
            border: none;
            border-radius: 20px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .settings-button.primary {
            background-color: var(--primary-color);
            color: white;
        }

        .settings-button.secondary {
            background-color: rgba(255, 255, 255, 0.1);
            color: var(--text-light);
        }

        .settings-button.danger {
            background-color: rgba(220, 53, 69, 0.2);
            color: #dc3545;
        }

        .settings-button:hover {
            transform: translateY(-2px);
        }

        /* Responsive Adjustments */
        @media (min-width: 768px) {
            .games-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }

            .featured-game {
                height: 250px;
            }
        }

        @media (min-width: 992px) {
            .container {
                max-width: 960px;
            }

            .games-grid {
                grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            }
        }

        @media (max-width: 768px) {
            .featured-offer {
                flex-direction: column;
            }

            .offer-image {
                margin-top: 20px;
            }

            .settings-item {
                flex-direction: column;
                align-items: flex-start;
            }

            .settings-value {
                margin-top: 10px;
                width: 100%;
                justify-content: space-between;
            }
        }

        /* Fix for landscape mode */
        @media (orientation: landscape) {

            /* More specific selector to override other styles */
            .game-modes .mode-card {
                width: calc(50% - 20px) !important;
                max-width: 600px !important;
                display: inline-block !important;
                margin: 10px !important;
                box-sizing: border-box !important;
            }

            /* Make the game modes container a flex container */
            .game-modes {
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: wrap !important;
                justify-content: center !important;
                align-items: stretch !important;
                width: 100% !important;
                max-width: 1200px !important;
                margin: 0 auto !important;
            }

            /* Adjust the game menu content for landscape */
            .game-menu-content {
                padding: 10px 20px !important;
            }

            /* Make sure the mode info doesn't overflow */
            .mode-info {
                width: calc(100% - 70px) !important;
                /* Account for icon width */
            }
        }

        .toast {
            background-color: #323232;
            color: #fff;
            padding: 12px 18px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
            margin-top: 10px;
            animation: fadein 0.3s, fadeout 0.3s 2.7s;
            transition: opacity 0.3s ease;
            opacity: 1;
        }

        @keyframes fadein {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

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

        @keyframes fadeout {
            from {
                opacity: 1;
                transform: translateY(0);
            }

            to {
                opacity: 0;
                transform: translateY(10px);
            }
        }

/*        body {
            opacity: 0;
            transition: opacity 0.1s ease;
        }

        body.page-loaded {
            opacity: 1;
        }*/

        .progress-bar {
            height: 4px;
            background-color: rgba(5, 114, 206, 0.2);
            width: 100%;
            overflow: hidden;
        }

        .progress-bar-value {
            width: 100%;
            height: 100%;
            background-color: rgb(5, 114, 206);
            animation: indeterminateAnimation 1s infinite linear;
            transform-origin: 0% 50%;
        }

        @keyframes indeterminateAnimation {
            0% {
                transform: translateX(0) scaleX(0);
            }

            40% {
                transform: translateX(0) scaleX(0.4);
            }

            100% {
                transform: translateX(100%) scaleX(0.5);
            }
        }




.credits-cards-container .credits-card {
    margin-right: 18px;
}
.credits-cards-container .credits-card:last-child {
    margin-right: 0;
}
/* Responsive tweaks for landscape and portrait */
@media (orientation: landscape) {
    .credits-cards-container {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }
}
@media (orientation: portrait) {
    .credits-cards-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}
/* Make large numbers visually balanced */
.credits-card .credits-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 6px;
}
.credits-card.big .credits-value {
    font-size: 1.7rem;
    letter-spacing: -1px;
}

/*  */
.credits-cards-container .credits-card {
        margin-right: 18px;
    }
    .credits-cards-container .credits-card:last-child {
        margin-right: 0;
    }
    /* Responsive tweaks for landscape and portrait */
    @media (orientation: landscape) {
        .credits-cards-container {
            padding-left: 32px !important;
            padding-right: 32px !important;
        }
    }
    @media (orientation: portrait) {
        .credits-cards-container {
            padding-left: 16px !important;
            padding-right: 16px !important;
        }
    }
    /* Make large numbers visually balanced */
    .credits-card .credits-value {
        font-size: 2rem;
        font-weight: bold;
        margin-bottom: 6px;
    }
    .credits-card.big .credits-value {
        font-size: 1.7rem;
        letter-spacing: -1px;
    }