/* ========== RESET & BASE STYLES ========== */

.slaunch-app,
.slaunch-app * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.slaunch-app {
    scroll-behavior: smooth;
}

.slaunch-app {
    --slaunch-bg: #f8fafc;
    --slaunch-panel: #ffffff;
    --slaunch-panel-soft: #fffaf2;
    --slaunch-border: #e3d4be;
    --slaunch-text: #223344;
    --slaunch-muted: #5e6d7b;
    --slaunch-accent: #bd4b11;
    --slaunch-accent-dark: #8f3308;
    --slaunch-shadow: 0 8px 24px rgba(20, 37, 56, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background-color: transparent;
    color: var(--slaunch-text);
    line-height: 1.6;
}

/* ========== CONTAINER ========== */

.slaunch-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.main-content {
    flex: 1;
    padding: 0 20px;
}

/* ========== HEADER ========== */

.header {
    background: linear-gradient(135deg, #fff6e9 0%, #ffffff 100%);
    border: 1px solid var(--slaunch-border);
    color: var(--slaunch-text);
    padding: 16px 18px;
    text-align: center;
    box-shadow: var(--slaunch-shadow);
    border-radius: 14px;
}

.header h1 {
    font-size: clamp(1.55rem, 2.2vw, 2rem);
    line-height: 1.2;
    margin-bottom: 6px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    color: var(--slaunch-muted);
    margin: 0;
}

.header .filters-section {
    text-align: left;
    margin: 14px 0 0;
    padding: 16px;
    box-shadow: none;
}

/* ========== FOOTER ========== */

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer p {
    margin: 0;
}

/* ========== SEARCH SECTION ========== */

.search-section {
    margin: 30px 0;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-container-inline {
    flex: 1 1 380px;
    max-width: none;
    margin: 0;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1em;
    border: 1px solid var(--slaunch-border);
    border-radius: 25px;
    background-color: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:hover {
    border-color: #c7b298;
    box-shadow: 0 4px 12px rgba(20, 37, 56, 0.08);
}

.search-input:focus {
    outline: none;
    border-color: var(--slaunch-accent);
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.14);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--slaunch-border);
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 999;
    margin-top: -2px;
    box-shadow: var(--slaunch-shadow);
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 15px 15px 0;
}

.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.search-results.hidden {
    display: none;
}

.search-results-list {
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
    background-color: #f9f9f9;
}

.search-result-item:active {
    background-color: #f0f0f0;
}

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

.search-result-thumbnail {
    width: 60px;
    height: 75px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.search-result-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ddd 0%, #f0f0f0 100%);
    color: #999;
    font-size: 0.8em;
    text-align: center;
    padding: 5px;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-provider {
    font-size: 0.85em;
    color: #999;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.95em;
}

/* ========== FILTERS SECTION ========== */

.filters-section {
    background: var(--slaunch-panel);
    border: 1px solid var(--slaunch-border);
    padding: 30px;
    border-radius: 14px;
    margin: 30px 0;
    box-shadow: var(--slaunch-shadow);
}

.filters-section h2 {
    color: #333;
    margin-bottom: 0;
    font-size: 1.5em;
}

.filters-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .search-container-inline {
        flex-basis: 100%;
    }

    .filters-toggle-help {
        display: none;
    }
}

.filters-toggle-btn {
    border: 1px solid #d1b798;
    background: #fff6e8;
    color: #6b3415;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters-toggle-btn:hover {
    background: #ffefda;
    border-color: #bf9d76;
}

.filters-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.18);
}

.filters-toggle-help {
    margin: 0 0 12px;
    color: var(--slaunch-muted);
    font-size: 0.95em;
}

.filters-toggle-btn.has-active-filters {
    background: #bd4b11;
    border-color: #bd4b11;
    color: #fff;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.active-filters.hidden {
    display: none;
}

.active-filters-label {
    font-weight: 600;
    color: #6b3415;
    font-size: 0.9em;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.active-filter-chip {
    background: #fff6e8;
    border: 1px solid #d1b798;
    color: #6b3415;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.85em;
}

.active-filters-clear {
    background: none;
    border: none;
    color: #bd4b11;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.coverage-filter {
    margin: 0 0 16px;
}

.coverage-help {
    margin: 4px 0 0;
    color: var(--slaunch-muted);
    font-size: 0.85em;
}

.dropdown-option.is-unavailable {
    display: none !important;
}

.pagination.hidden {
    display: none;
}

.filters-content.is-collapsed {
    display: none;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #3f4a56;
    font-size: 0.95em;
}

.filter-select {
    padding: 12px;
    border: 1px solid var(--slaunch-border);
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 35px;
}

.filter-select:hover {
    border-color: #c7b298;
    box-shadow: 0 4px 10px rgba(20, 37, 56, 0.08);
}

.filter-select:focus {
    outline: none;
    border-color: var(--slaunch-accent);
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.14);
}

.filter-results {
    color: #666;
    font-size: 0.95em;
}

.filter-results span {
    font-weight: 600;
    color: var(--slaunch-accent-dark);
}

/* ========== SEARCHABLE SELECT ========== */

.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid var(--slaunch-border);
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.searchable-select-input:hover {
    border-color: #c7b298;
    box-shadow: 0 4px 10px rgba(20, 37, 56, 0.08);
}

.searchable-select-input:focus {
    outline: none;
    border-color: var(--slaunch-accent);
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.14);
}

.searchable-select-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 1px solid #d5c3aa;
    border-radius: 50%;
    background: #fffaf2;
    color: #7f4e2e;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.searchable-select-clear:hover {
    background: #fff1de;
    border-color: #c9b294;
    color: #6b3415;
}

.searchable-select-clear:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.18);
}

.searchable-select-clear.visible {
    display: inline-flex;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--slaunch-border);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.searchable-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.searchable-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 5px 5px 0;
}

.searchable-select-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.searchable-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.searchable-select-dropdown.visible {
    display: block;
}

.dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
}

.dropdown-option:hover {
    background-color: #f0f0f0;
}

.dropdown-option.selected {
    background-color: #fff1de;
    color: var(--slaunch-accent-dark);
    font-weight: 600;
}

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

/* ========== SORT SECTION ========== */

.sort-section {
    margin-top: 10px;
    padding-top: 4px;
}

.features-panel {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--slaunch-border);
    border-radius: 10px;
    background: #fffdf8;
}

.features-toggle-btn {
    border: 1px solid #d1b798;
    background: #fff6e8;
    color: #6b3415;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.features-toggle-btn:hover {
    background: #ffefda;
    border-color: #bf9d76;
}

.features-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(189, 75, 17, 0.18);
}

.features-content {
    margin-top: 10px;
}

.features-content.is-collapsed {
    display: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px 14px;
}

.feature-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3f4a56;
    font-size: 0.92em;
    cursor: pointer;
    user-select: none;
}

.feature-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--slaunch-accent);
    cursor: pointer;
}

.sort-section h3 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.sort-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* ========== GAMES SECTION ========== */

.games-section {
    margin: 12px 0 40px;
}

.games-section h2 {
    color: #333;
    margin-bottom: 0;
    font-size: 1.5em;
}

.games-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.games-results-inline {
    font-size: 0.95em;
}

.games-results-inline p {
    margin: 0;
}

/* ========== LOADING STATE ========== */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading.hidden {
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--slaunch-accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* ========== GAMES GRID ========== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

/* ========== GAME CARD ========== */

.game-card {
    background: var(--slaunch-panel);
    border: 1px solid var(--slaunch-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(19, 41, 61, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(19, 41, 61, 0.14);
}

.game-link {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 125%;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

.game-card:hover .game-thumbnail {
    transform: scale(1.05);
}

.game-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ddd 0%, #f0f0f0 100%);
    color: #999;
    font-weight: 600;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-button {
    background: linear-gradient(135deg, var(--slaunch-accent-dark) 0%, var(--slaunch-accent) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1em;
    transition: transform 0.3s ease;
}

.play-button:hover {
    transform: scale(1.05);
}

.game-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #172b3f;
    line-height: 1.3;
}

.game-short-description {
    font-size: 0.88em;
    color: #546474;
    margin-bottom: 8px;
    line-height: 1.4;
}

.game-provider {
    font-size: 0.85em;
    color: #6d7780;
    margin-bottom: 10px;
}

.game-provider-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.provider-thumb {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e3d4be;
    flex: 0 0 auto;
}

.game-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.stat-badge {
    display: inline-block;
    background-color: #f5ede2;
    color: #5d4631;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.volatility-low {
    background-color: #d4edda;
    color: #155724;
}

.volatility-medium {
    background-color: #fff3cd;
    color: #856404;
}

.volatility-high {
    background-color: #f8d7da;
    color: #721c24;
}

.volatility-very-high {
    background-color: #d85c5c;
    color: white;
}

.game-rtp {
    font-size: 0.85em;
    color: var(--slaunch-accent-dark);
    font-weight: 600;
    margin-top: auto;
}

/* ========== NO GAMES MESSAGE ========== */

.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #999;
    font-size: 1.1em;
}

/* ========== PAGINATION ========== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.pagination-btn {
    background: linear-gradient(135deg, var(--slaunch-accent-dark) 0%, var(--slaunch-accent) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1em;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(143, 51, 8, 0.28);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #666;
    font-weight: 600;
}

/* ========== BUTTONS ========== */

.slaunch-app .btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--slaunch-accent-dark) 0%, var(--slaunch-accent) 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 5px;
    margin-top: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.slaunch-app .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(143, 51, 8, 0.28);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .search-section {
        margin: 20px 0;
    }

    .search-input {
        font-size: 16px;
        padding: 12px 16px;
    }

    .search-result-thumbnail {
        width: 50px;
        height: 62px;
    }

    .search-result-item {
        padding: 10px 12px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .sort-grid {
        grid-template-columns: 1fr;
    }

    .filters-section {
        padding: 20px;
    }

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

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    main.main-content {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 14px;
    }

    .header h1 {
        font-size: 1.32rem;
    }

    .filters-section {
        padding: 15px;
        margin: 20px 0;
    }

    .sort-section {
        padding: 15px;
        margin-top: 15px;
    }

    .sort-section h3 {
        font-size: 1em;
        margin-bottom: 12px;
    }

    .sort-grid {
        grid-template-columns: 1fr;
    }

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

    .game-info {
        padding: 12px;
    }

    .game-title {
        font-size: 0.95em;
    }

    .stat-badge {
        font-size: 0.7em;
        padding: 3px 8px;
    }
}
