:root {
    /* Light mode colors */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: white;
    --card-text: #333;
    --header-bg: rgba(255, 255, 255, 1);
    --stat-color: #667eea;
    --stat-label-color: #666;
    --placeholder-color: #ccc;
    --image-bg-start: #f5f7fa;
    --image-bg-end: #c3cfe2;
    --text-primary: white;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode colors */
        --bg-gradient-start: #1a1a2e;
        --bg-gradient-end: #16213e;
        --card-bg: #2a2a3e;
        --card-text: #e0e0e0;
        --header-bg: rgba(42, 42, 62, 1);
        --stat-color: #8b9cf9;
        --stat-label-color: #b0b0b0;
        --placeholder-color: #555;
        --image-bg-start: #2a2a3e;
        --image-bg-end: #1a1a2e;
        --text-primary: #e0e0e0;
    }
}


body {
    background: var(--bg-gradient-start);
    /* background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%); */
    min-height: 100vh;
    padding: 20px 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection only in input fields */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.header {
    background: var(--header-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: var(--card-text);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.search-container {
    margin-bottom: 20px;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.search-container .input-group-text {
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hide advanced filter button (search icon) in live games mode */
.games-live-mode .search-container .input-group-text:first-child,
.games-live-mode .stat-item:has(#displayedGames) {
    display: none;
}

/* Add left border radius to search input when filter button is hidden in live games mode */
.games-live-mode .search-container #searchInput {
    border-top-left-radius: var(--bs-border-radius-lg) !important;
    border-bottom-left-radius: var(--bs-border-radius-lg) !important;
}

.search-container .input-group-text:hover,
.search-container .btn-outline-secondary:hover {
    background-color: var(--image-bg-start);
    color: var(--stat-color);
    border-color: var(--stat-color);
}

.search-container .btn-outline-secondary {
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-card {
    background: var(--card-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    cursor: pointer;
}

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

.game-image-container {
    position: relative;
    width: 100%;
    padding-top: 133%;
    /* 3:4 aspect ratio for game covers */
    background: linear-gradient(135deg, var(--image-bg-start) 0%, var(--image-bg-end) 100%);
    overflow: hidden;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.game-image.loading {
    opacity: 0;
}

.game-image.loaded {
    opacity: 1;
}

.image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--placeholder-color);
}

.game-title {
    padding: 15px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--card-text);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.serial-number {
    position: absolute;
    top: 0px;
    right: 0px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 1px 6px;
    border-radius: 0 0 0 4px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 10;
}

.pagination-controls {
    background: var(--header-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.settings-button {
    position: absolute;
    top: 50%;
    right: 3%;
    transform: translateY(-50%);
    background: var(--stat-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.settings-button:hover {
    transform: translateY(-50%) rotate(90deg);
    background: var(--stat-color);
    filter: brightness(1.2);
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.settings-modal.show {
    display: flex;
}

.settings-content {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--image-bg-end);
}

.settings-header h3 {
    margin: 0;
    color: var(--card-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-settings {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--card-text);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-settings:hover {
    transform: rotate(90deg);
    color: var(--stat-color);
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--card-text);
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-group .form-control,
.settings-group .form-select {
    width: 100%;
}

.jump-to-page-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.jump-to-page-group .form-control {
    flex: 1;
}

.jump-to-page-group button {
    background: var(--stat-color);
    color: white;
    border: none;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jump-to-page-group button:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.page-size-selector {
    display: none;
}

/* Advanced Filters */
.filters-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--image-bg-end);
}

.filters-section h4 {
    color: var(--stat-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--card-text);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Toggle Switch Styles */
.toggle-container {
    margin-top: 5px;
}

.toggle-switch {
    position: relative;
    display: flex;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 4px;
    width: 100%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--card-text);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.toggle-switch input[type="radio"]:checked+.toggle-option {
    color: white;
    font-weight: 600;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: transform 0.3s ease;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    /* Start on the second option (shuffled) */
}

.toggle-switch input[type="radio"]:first-of-type:checked~.toggle-slider {
    transform: translateX(0);
}

.toggle-switch input[type="radio"]:nth-of-type(2):checked~.toggle-slider {
    transform: translateX(100%);
}

@media (prefers-color-scheme: dark) {
    .toggle-switch {
        border-color: #444;
        background: var(--card-bg);
    }

    .toggle-slider {
        background: linear-gradient(135deg, #8b9cf9 0%, #a855f7 100%);
    }
}

/* Multiselect Dropdown Styles */
.multiselect-container {
    position: relative;
}

.multiselect-dropdown {
    position: relative;
    width: 100%;
}

.multiselect-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 2px solid var(--image-bg-start);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--card-text);
}

.multiselect-selected:hover {
    border-color: var(--stat-color);
    background: var(--image-bg-start);
}

.multiselect-dropdown.active .multiselect-selected {
    border-color: var(--stat-color);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.multiselect-selected .placeholder {
    color: var(--card-text);
    opacity: 0.5;
    font-size: 0.9rem;
    flex: 1;
    background-color: transparent;
    cursor: pointer;
}

.multiselect-selected i.fa-chevron-down {
    transition: transform 0.2s ease;
    color: var(--stat-color);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.multiselect-dropdown.active .multiselect-selected i.fa-chevron-down {
    transform: rotate(180deg);
}

.multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--stat-color);
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.multiselect-tag i {
    cursor: pointer;
    opacity: 0.8;
    font-size: 0.7rem;
}

.multiselect-tag i:hover {
    opacity: 1;
}

.multiselect-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--stat-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: var(--card-text);
}

.multiselect-dropdown.active .multiselect-options {
    max-height: 300px;
    opacity: 1;
}

.multiselect-search {
    padding: 10px;
    border-bottom: 1px solid var(--image-bg-start);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.multiselect-search-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--image-bg-start);
    border: 1px solid var(--image-bg-end);
    border-radius: 6px;
    color: var(--card-text);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}

.multiselect-search-input:focus {
    border-color: var(--stat-color);
    background: var(--card-bg);
}

.multiselect-search-input::placeholder {
    color: var(--card-text);
    opacity: 0.5;
}

.multiselect-options-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

/* Scrollbar styling for multiselect */
.multiselect-options-list::-webkit-scrollbar {
    width: 8px;
}

.multiselect-options-list::-webkit-scrollbar-track {
    background: var(--image-bg-start);
    border-radius: 4px;
}

.multiselect-options-list::-webkit-scrollbar-thumb {
    background: var(--stat-color);
    border-radius: 4px;
}

.multiselect-options-list::-webkit-scrollbar-thumb:hover {
    background: var(--bg-gradient-start);
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--card-text);
}

.multiselect-option:hover {
    background: var(--image-bg-start);
    color: var(--card-text);
}

.multiselect-option.selected {
    background: var(--stat-color);
    color: white;
    font-weight: 600;
}

.multiselect-option input[type="checkbox"] {
    display: none;
}

.multiselect-option label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    font-weight: normal !important;
    color: inherit !important;
    position: relative;
    padding-left: 4px;
}

.multiselect-option.selected label::before {
    opacity: 1;
}

.multiselect-option.selected label {
    font-weight: 600 !important;
}

.multiselect-option.hidden {
    display: none;
}

/* Old checkbox styles - keeping for compatibility */
.filter-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: var(--image-bg-start);
    border-radius: 8px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--card-bg);
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-checkbox-item:hover {
    background: var(--stat-color);
    color: white;
    transform: translateY(-2px);
}

.filter-checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

.filter-checkbox-item input[type="checkbox"]:checked+label {
    font-weight: 700;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.filter-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-filters-btn {
    background: var(--stat-color);
    color: white;
}

.apply-filters-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.clear-filters-btn {
    background: var(--image-bg-start);
    color: var(--card-text);
}

.clear-filters-btn:hover {
    background: var(--image-bg-end);
    transform: translateY(-2px);
}

.active-filters-count {
    background: var(--stat-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Game Details Modal */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.game-modal.show {
    display: flex;
}

.game-modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideIn 0.3s ease;
}

.game-modal-header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    padding: 20px;
    border-bottom: 2px solid var(--image-bg-end);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    border-radius: 15px 15px 0 0;
}

.game-modal-title-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-modal-header h2 {
    margin: 0;
    color: var(--card-text);
    font-size: 1.5rem;
    line-height: 1.3;
}

/* Mobile: Make title scrollable if it exceeds 2 lines */
@media (max-width: 576px) {
    .game-modal-header h2 {
        max-height: calc(1.3em * 2);
        /* 2 lines based on line-height */
        overflow-y: auto;
        overflow-x: hidden;
        word-wrap: break-word;
        word-break: break-word;
        scrollbar-width: thin;
        scrollbar-color: var(--stat-color) var(--image-bg-start);
    }

    /* WebKit scrollbar styling */
    .game-modal-header h2::-webkit-scrollbar {
        width: 4px;
    }

    .game-modal-header h2::-webkit-scrollbar-track {
        background: var(--image-bg-start);
        border-radius: 2px;
    }

    .game-modal-header h2::-webkit-scrollbar-thumb {
        background: var(--stat-color);
        border-radius: 2px;
    }

    .game-modal-header h2::-webkit-scrollbar-thumb:hover {
        background: var(--stat-label-color);
    }
}

.game-serial-badge {
    display: inline-block;
    align-items: center;
    background: linear-gradient(135deg, var(--stat-color), var(--stat-label-color));
    color: #212121;
    padding: 0px 6px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: fit-content;
}

.game-serial-badge i {
    font-size: 0.7rem;
}

.close-game-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--card-text);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-game-modal:hover {
    color: var(--stat-color);
    transform: scale(1.2);
}

.game-modal-body {
    padding: 30px;
}

.game-detail-section {
    margin-bottom: 25px;
}

.game-detail-section h3 {
    color: var(--stat-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--image-bg-end);
    padding-bottom: 10px;
}

.game-cover-container {
    text-align: center;
    margin-bottom: 20px;
}

.game-cover-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.game-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.game-info-item {
    background: var(--image-bg-start);
    padding: 12px;
    border-radius: 8px;
}

.game-info-item strong {
    color: var(--stat-color);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.game-info-item span {
    color: var(--card-text);
}

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

.screenshot-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.screenshot-gallery img:hover {
    transform: scale(1.05);
}

.youtube-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.download-section {
    margin-bottom: 10px;
    border: 1px solid var(--image-bg-end);
    border-radius: 8px;
    overflow: hidden;
}

.download-section .accordion-item {
    background: transparent;
    border: none;
}

.download-section h4 {
    color: var(--stat-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accordion-button {
    background: var(--image-bg-start) !important;
    color: var(--card-text) !important;
    border: none !important;
    font-weight: 600;
    padding: 5px 5px;
}

@media screen and (max-width: 576px) {
    .accordion-button {
        font-size: xx-small;
    }

    .download-badge {
        font-size: x-small;
    }
}

.accordion-button:focus {
    box-shadow: none !important;
    border: none !important;
}

.accordion-button:not(.collapsed) {
    background: var(--stat-color) !important;
    color: white !important;
    box-shadow: none !important;
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}

.accordion-body {
    background: var(--card-bg);
    color: var(--card-text);
    padding: 20px;
    border-top: 1px solid var(--image-bg-end);
}

.accordion-body a {
    color: var(--stat-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.accordion-body a:hover {
    color: var(--card-text);
    text-decoration: underline;
}

.accordion-body p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.download-meta {
    display: inline-flex;
    gap: 1px;
    margin-left: 10px;
    font-size: 0.875rem;
    opacity: 0.9;
}

.download-badge {
    background: rgba(0, 0, 0, 0.3);
    color: var(--card-text);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.accordion-button:not(.collapsed) .download-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--stat-color);
}

/* Ensure all modal text elements use theme colors */
.game-modal-body h1,
.game-modal-body h2,
.game-modal-body h3,
.game-modal-body h4,
.game-modal-body h5,
.game-modal-body h6 {
    color: var(--stat-color);
}

.game-modal-body p,
.game-modal-body span,
.game-modal-body div {
    color: var(--card-text);
}

@media (max-width: 768px) {
    .game-modal-content {
        margin: 10px;
    }

    .game-modal-body {
        padding: 20px;
    }

    .game-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination responsive improvements */
.pagination {
    flex-wrap: wrap;
    gap: 5px;
}

.pagination .page-item {
    margin: 0;
}

@media (max-width: 576px) {
    .pagination-controls {
        padding: 15px 10px;
    }

    .pagination {
        font-size: 0.875rem;
    }

    .pagination .page-link {
        padding: 0.375rem 0.65rem;
        min-width: 36px;
        text-align: center;
    }

    .page-size-selector {
        font-size: 0.875rem;
    }

    .page-size-selector .form-select {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }

    .settings-button {
        right: 15px;
    }
}

.loading-spinner {
    text-align: center;
    padding: 50px;
    color: var(--text-primary);
    font-size: 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loading-progress {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 1rem;
    font-weight: bold;
    min-width: 40px;
    color: var(--text-primary);
    display: none;
    /* Hide since percentage is now in the message */
}

.stats-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-number {
    font-size: 1.7rem;
    font-weight: bold;
    color: var(--stat-color);
}

.stat-label {
    color: var(--stat-label-color);
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 50px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

#gamesGrid {
    margin-bottom: 50px;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

/* Dark mode Bootstrap overrides */
@media (prefers-color-scheme: dark) {

    .form-control,
    .form-select {
        background-color: #1a1a2e;
        border-color: #444;
        color: #e0e0e0;
    }

    .form-control:focus,
    .form-select:focus {
        background-color: #1a1a2e;
        border-color: #8b9cf9;
        color: #e0e0e0;
    }

    .form-control::placeholder {
        color: #888;
    }

    .input-group-text {
        background-color: #2a2a3e;
        border-color: #444;
        color: #e0e0e0;
    }

    .btn-outline-secondary {
        color: #e0e0e0;
        border-color: #444;
    }

    .btn-outline-secondary:hover {
        background-color: #444;
        border-color: #555;
        color: #fff;
    }

    .pagination .page-link {
        background-color: #2a2a3e;
        border-color: #444;
        color: #e0e0e0;
    }

    .pagination .page-link:hover {
        background-color: #3a3a4e;
        border-color: #555;
        color: #fff;
    }

    .pagination .page-item.active .page-link {
        background-color: #8b9cf9;
        border-color: #8b9cf9;
        color: #1a1a2e;
    }

    .pagination .page-item.disabled .page-link {
        background-color: #1a1a2e;
        border-color: #333;
        color: #555;
    }

    .settings-content {
        background: #2a2a3e;
    }

    .settings-modal {
        background: rgba(0, 0, 0, 0.7);
    }
}

.download-section .accordion-body {
    width: fit-content;
}

.download-section .accordion-collapse {
    overflow-y: auto;
}

.game-modal-body .fetched-content {
    width: 100%;
    overflow-y: auto;
}

.fetched-content .fetched-content-inner {
    width: fit-content;
}


.fetched-content .fetched-content-inner table td {
    background-color: transparent !important;
    border: 1px solid;
    padding: 1em;
}

.fetched-content .fetched-content-inner table {
    border: 0px;
    margin-bottom: 2em;
    border-collapse: collapse;
}

/* Games Live Styles */
.games-live-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.games-live-container .alert {
    margin-bottom: 20px;
}

.games-live-container .form-label {
    font-weight: 600;
    color: var(--card-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.games-live-container .form-select {
    cursor: pointer;
}

.games-live-container .btn-primary {
    background: var(--stat-color);
    border-color: var(--stat-color);
}

.games-live-container .btn-primary:hover {
    filter: brightness(1.2);
}

@media (prefers-color-scheme: dark) {

    .games-live-container .form-select,
    .games-live-container .form-control {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .games-live-container .form-select:focus,
    .games-live-container .form-control:focus {
        background-color: #2d3748;
        border-color: var(--stat-color);
        color: #e2e8f0;
    }
}

/* ===================================
   PWA Styles
   =================================== */

/* Install PWA Button */
.install-pwa-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pulse-install 2s infinite;
}

.install-pwa-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

@keyframes pulse-install {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6);
    }
}

@media (prefers-color-scheme: dark) {
    .install-pwa-button {
        background: linear-gradient(135deg, #8b9cf9 0%, #9b7bc2 100%);
        box-shadow: 0 4px 15px rgba(139, 156, 249, 0.4);
    }

    .install-pwa-button:hover {
        box-shadow: 0 6px 20px rgba(139, 156, 249, 0.6);
    }

    @keyframes pulse-install {

        0%,
        100% {
            box-shadow: 0 4px 15px rgba(139, 156, 249, 0.4);
        }

        50% {
            box-shadow: 0 4px 25px rgba(139, 156, 249, 0.6);
        }
    }
}

/* PWA Notifications */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
}

.pwa-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.pwa-notification i {
    font-size: 20px;
}

.pwa-notification.pwa-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #155724;
}

.pwa-notification.pwa-success i {
    color: #28a745;
}

.pwa-notification.pwa-error {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #721c24;
}

.pwa-notification.pwa-error i {
    color: #dc3545;
}

.pwa-notification.pwa-info {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: #004085;
}

.pwa-notification.pwa-info i {
    color: #17a2b8;
}

@media (prefers-color-scheme: dark) {
    .pwa-notification {
        background: #2a2a3e;
        color: #e0e0e0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }

    .pwa-notification.pwa-success {
        background: linear-gradient(135deg, #155724 0%, #1e7e34 100%);
        color: #84fab0;
    }

    .pwa-notification.pwa-error {
        background: linear-gradient(135deg, #721c24 0%, #922530 100%);
        color: #fa709a;
    }

    .pwa-notification.pwa-info {
        background: linear-gradient(135deg, #004085 0%, #0056b3 100%);
        color: #a1c4fd;
    }
}

/* Mobile responsiveness for PWA elements */
@media (max-width: 768px) {
    .install-pwa-button {
        bottom: 15px;
        right: 15px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .pwa-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }
}

/* iOS specific PWA styles */
@supports (-webkit-touch-callout: none) {

    /* Safe area for notch devices */
    body {
        padding-top: calc(env(safe-area-inset-top) + 20px);
        padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
    }
}

/* Standalone mode (when installed as PWA) */
@media all and (display-mode: standalone) {
    body {
        /* Additional padding for status bar */
        padding-top: max(20px, env(safe-area-inset-top));
    }

    .install-pwa-button {
        /* Hide install button when already installed */
        display: none !important;
    }
}

/* Download Links Section Styling */
.download-links-section {
    margin: 20px 0;
    padding: 20px;
    background: var(--image-bg-start);
    border-radius: 10px;
    border-left: 4px solid var(--stat-color);
}

.download-links-section h6 {
    color: var(--stat-color);
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.download-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--stat-color) 0%, var(--bg-gradient-end) 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.download-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
}

.download-link-btn i {
    font-size: 1.1em;
}

/* Dark mode adjustments for download links */
@media (prefers-color-scheme: dark) {
    .download-links-section {
        background: rgba(42, 42, 62, 0.5);
        border-left-color: #8b9cf9;
    }

    .download-link-btn {
        background: linear-gradient(135deg, #8b9cf9 0%, #667eea 100%);
    }
}

/* Parsed VC Content Styling */
.parsed-vc-content {
    color: var(--card-text);
    line-height: 1.6;
}

.parsed-vc-content .vc-content {
    margin: 15px 0;
}

.parsed-vc-content h5 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.parsed-vc-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.parsed-vc-content p {
    margin-bottom: 12px;
}

.parsed-vc-content ul,
.parsed-vc-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.parsed-vc-content li {
    margin-bottom: 8px;
}

.parsed-vc-content strong {
    color: var(--stat-color);
    font-weight: 600;
}

.parsed-vc-content a {
    color: var(--stat-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.parsed-vc-content a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.parsed-vc-content .info-tabs {
    margin: 20px 0;
}

.parsed-vc-content .info-section {
    background: var(--image-bg-start);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--stat-color);
}

.parsed-vc-content .info-section h6 {
    margin-top: 0;
    margin-bottom: 10px;
}

.parsed-vc-content hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--placeholder-color);
    opacity: 0.3;
}

/* Dark mode for parsed content */
@media (prefers-color-scheme: dark) {
    .parsed-vc-content .info-section {
        background: rgba(42, 42, 62, 0.3);
    }
}

/* Extracted image styling with error handling */
.screenshot-gallery img,
.mb-4 img {
    transition: opacity 0.3s ease;
}

.screenshot-gallery img[src*="redirect-me-to-image-from-wp-media-id/"],
.mb-4 img[src*="redirect-me-to-image-from-wp-media-id/"] {
    background: var(--image-bg-start);
    min-height: 150px;
}

/* Hide broken images gracefully */
img[src*="redirect-me-to-image-from-wp-media-id/"]:not([src$=".jpg"]):not([src$=".png"]):not([src$=".jpeg"]):not([src$=".gif"]) {
    display: none;
}