
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', sans-serif;
    background-color: #0f1626; 
    color: #e0e0e0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center; 
    padding: 0 10px; 
}

a {
    text-decoration: none;
    color: inherit;
}

header.header {
    background-color: #1a2c4e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.logo {
    max-height: 60px;
    height: 80px;
    margin-right: 15px;
}

.rtp-header {
    width: 600px;
    height: auto;
    display: block;
    margin: 0 auto; 
    max-width: 100%;
    image-rendering: -webkit-optimize-contrast;
}

@media (max-width: 600px) {
    .rtp-header {
        max-width: 300px; 
    }
}

#mode-toggle {
    background: linear-gradient(145deg, #2c3e50, #1a243a);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    color: #f39c12;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

#mode-toggle:hover {
    background: linear-gradient(145deg, #1a243a, #2c3e50);
    transform: scale(1.05);
}


nav.auth-buttons { 
    display: flex;
    justify-content: center;
    gap: 25px; 
    padding: 20px 0; 
    background-color: #1a2c4e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 15px; 
    margin-bottom: 20px; 
}

.auth-link {
    background-color: #e63946; 
    color: white;
    padding: 12px 30px; 
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(230, 57, 70, 0.4);
}

.auth-link:hover {
    background-color: #c02d38;
    transform: translateY(-3px);
    box-shadow: 0 9px 20px rgba(230, 57, 70, 0.6);
}

.running-text {
    position: relative;
    width: 100%;
    height: 40px;
    background-color: #0d1a26;
    overflow: hidden;
    color: #ffd700; 
    font-size: 1.3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding-left: 100%;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7); 
}

.running-text::before {
    content: attr(data-text);
    display: inline-block;
    animation: scrollText 25s linear infinite;
    animation-delay: 1s;
}

@keyframes scrollText {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}


body.light-mode .running-text {
    background-color: #e0e0e0;
    color: #e63946;
    text-shadow: 0 0 8px rgba(230, 57, 70, 0.4); 
}

.filter-search-section { 
    position: relative;
    background-color: #1a2c4e; 
    border-radius: 999px;
    height: 50px;
    width: 90%;
    max-width: 900px; 
    margin: 20px auto 30px auto; 
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 0 20px;
    box-sizing: border-box;
    overflow-x: auto; 
    box-shadow: 0 0 15px 5px rgba(255,215,0,0.3); 
}

.filter-search-section img {
    height: 35px;
    cursor: pointer;
    transition: transform 0.3s ease, border 0.3s ease, box-shadow 0.3s ease; 
    flex-shrink: 0;
    border: 2px solid transparent; 
    border-radius: 5px;
    padding: 2px;
}

.filter-search-section img:hover {
    transform: scale(1.2);
}

.filter-search-section img.active {
    border: 2px solid #ffd700; 
    box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.6); 
    transform: scale(1.1); 
}

body.light-mode .filter-search-section img.active {
    border: 2px solid #e63946; 
    box-shadow: 0 0 15px 5px rgba(230, 57, 70, 0.4); 
}

.filter-search-section input[type="text"] {
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    background-color: #0f1626; 
    color: #fff;
    outline: none;
    transition: 0.3s;
    flex-shrink: 1; 
    min-width: 120px; 
}

.filter-search-section input::placeholder {
    color: #aaa;
}

.filter-search-section input:focus {
    background-color: #2a2a2a;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .filter-search-section {
        flex-wrap: wrap; 
        justify-content: center;
        height: auto; 
        padding: 10px;
        gap: 10px; 
    }
    .filter-search-section img {
        height: 30px;
        margin-right: 0; 
    }
    .filter-search-section input[type="text"] {
        width: 100%; 
        margin-top: 10px;
    }
}

main#game-container { 
    margin-top: 30px;
    padding: 0 10px; 
    width: 100%; 
    max-width: 1200px; 
    margin-left: auto;
    margin-right: auto; 
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px; 
    justify-items: center; 
}

.game-card {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 10px;
    max-width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease; 
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5); 
    border: 1px solid #ffd700; 
}

.game-card.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, height 0s 0.3s, margin 0s 0.3s, padding 0s 0.3s; 
}

.game-card h3,
.game-card p {
    margin: 4px 0;
    font-size: 12px;
}

.game-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}

.rtp-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 5px;
}

.rtp-fill {
    height: 100%;
    width: 0;
    border-radius: 50px;
    transition: width 1s ease-in-out;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.4s ease, visibility 0.4s ease; 
}

.popup:not(.hidden) { 
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: #1a2c4e;
    padding: 25px; 
    border-radius: 12px; 
    text-align: center;
    color: white;
    max-width: 380px; 
    width: 90%; 
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.9);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.popup:not(.hidden) .popup-content {
    transform: translateY(0) scale(1); 
    opacity: 1;
}

.popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px; 
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.popup-content h2 {
    font-size: 1.8em; 
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.popup-content p {
    font-size: 1.1em; 
    margin-bottom: 8px;
    line-height: 1.5;
}

.popup-content p#popup-rtp {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.2em;
    margin-top: 10px; 
    margin-bottom: 20px; 
}


.popup-content .auth-link {
    font-size: 1em; 
    padding: 10px 25px; 
    margin: 8px 8px 0; 
}

.popup-content .auth-link:hover {
    background-color: #c02d38;
    transform: translateY(-3px);
    box-shadow: 0 9px 20px rgba(230, 57, 70, 0.6);
}

.close-btn {
    font-size: 32px; 
    top: 15px;
    right: 15px; 
    color: #e0e0e0;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    color: #e63946;
    transform: rotate(90deg); 
}

body.light-mode {
    background-color: #f0f2f5;
    color: #333;
}

body.light-mode header.header {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode #mode-toggle {
    background: linear-gradient(145deg, #e0e0e0, #ffffff);
    border: 2px solid #ccc;
    color: #ff9800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.light-mode #mode-toggle:hover {
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    transform: scale(1.05);
}

body.light-mode nav.auth-buttons {
    background-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .running-text {
    background-color: #e0e0e0;
    color: #e63946; 
}

body.light-mode .filter-search-section {
    background-color: #e0e0e0;
    box-shadow: 0 0 15px 5px rgba(0,0,0,0.1);
}

body.light-mode .filter-search-section input[type="text"] {
    background-color: #ffffff;
    color: #333;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

body.light-mode .filter-search-section input::placeholder {
    color: #888;
}

body.light-mode .filter-search-section input:focus {
    background-color: #f8f8f8;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

body.light-mode .game-card {
    background: #ffffff;
    color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .game-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

body.light-mode .rtp-bar {
    background: #ccc;
}

body.light-mode .rtp-fill {
}

body.light-mode .popup-content {
    background: #ffffff;
    color: #333;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

body.light-mode .close-btn {
    color: #666;
}

body.light-mode .close-btn:hover {
    color: #e63946;
}


@media (max-width: 768px) { 
    header.header {
        flex-direction: column; 
        padding: 10px;
    }
    .logo {
        margin-right: 0;
        margin-bottom: 10px; 
    }
    .rtp-header {
        max-width: 250px; 
        margin-bottom: 10px;
    }
    #mode-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }

    nav.auth-buttons {
        flex-direction: column; 
        gap: 15px;
        padding: 15px 10px;
    }
    .auth-link {
        width: 80%; 
        max-width: 300px;
        font-size: 1em;
    }

    .running-text {
        height: 35px;
        font-size: 1.1em;
    }

    .filter-search-section {
        flex-wrap: wrap;
        justify-content: center;
        height: auto; 
        padding: 10px;
    }
    .filter-search-section img {
        height: 30px;
        margin-right: 5px;
    }
    .filter-search-section input[type="text"] {
        width: 100%;
        margin-top: 10px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 
        gap: 8px;
    }
    .game-card {
        width: 100%; 
        padding: 8px;
        font-size: 0.9em;
    }
    .game-card h3,
    .game-card p {
        font-size: 11px;
    }

    .popup-content {
        padding: 20px;
    }
}

@media (max-width: 480px) { 
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); 
    }
}

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

.game-card {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 10px;
    max-width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0; 
    animation: fadeIn 0.5s ease-out forwards; 
}


@media (max-width: 1024px) {
    .hero-section h1 {
        font-size: 2.5em;
    }
    .hero-section p {
        font-size: 1em;
    }
    .auth-buttons .auth-link {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    .filter-search-section {
        width: 95%; 
        padding: 0 15px;
    }
}


@media (max-width: 768px) {
    header .logo img {
        height: 45px;
    }

    nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
    }
    nav ul {
        width: 100%; 
        justify-content: center; 
    }
    nav ul li a {
        font-size: 0.9em;
        padding: 8px 12px;
    }
    .mode-toggle {
        font-size: 1.5em;
    }

    .hero-section h1 {
        font-size: 2em; 
        margin-bottom: 10px;
    }
    .hero-section p {
        font-size: 0.9em;
        padding: 0 15px;
    }
    .auth-buttons {
        flex-direction: column; 
        gap: 10px;
    }
    .auth-buttons .auth-link {
        width: 80%; 
        max-width: 250px;
        font-size: 1em;
    }

    .running-text {
        font-size: 1em; 
        height: 35px;
    }

    .filter-search-section {
        flex-wrap: wrap;
        justify-content: center; 
        height: auto; 
        padding: 15px;
        gap: 10px;
    }
    .filter-search-section img {
        height: 30px; 
    }
    .filter-search-section input[type="text"] {
        width: 100%;
        margin-top: 10px; 
        font-size: 13px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
        gap: 15px; 
        padding: 20px 10px;
    }

    .game-card {
        padding: 8px;
    }
    .game-card h3 {
        font-size: 1.1em;
    }
    .game-card p {
        font-size: 0.8em;
    }

    .popup-content {
        max-width: 90%; 
        padding: 20px;
    }
    .popup-content h2 {
        font-size: 1.5em;
    }
    .popup-content p {
        font-size: 1em;
    }
    .popup-content p#popup-rtp {
        font-size: 1.1em;
    }
    .popup-content .auth-link {
        font-size: 0.9em;
        padding: 10px 20px;
    }
    .close-btn {
        font-size: 30px;
        top: 10px;
        right: 10px;
    }
}


@media (max-width: 480px) {
    header .logo img {
        height: 40px;
    }
    nav ul li a {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    .hero-section h1 {
        font-size: 1.7em;
    }
    .hero-section p {
        font-size: 0.8em;
    }
    .auth-buttons .auth-link {
        width: 90%; 
    }

    .running-text {
        font-size: 0.9em;
        height: 30px;
    }

    .filter-search-section img {
        height: 25px; 
    }
    .filter-search-section input[type="text"] {
        font-size: 12px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        padding: 15px 5px;
    }
    .game-card h3 {
        font-size: 1em;
    }
    .game-card p {
        font-size: 0.75em;
    }

    .popup-content {
        padding: 15px;
    }
    .popup-content h2 {
        font-size: 1.3em;
    }
    .popup-content p {
        font-size: 0.9em;
    }
    .popup-content p#popup-rtp {
        font-size: 1em;
    }
    .popup-content .auth-link {
        font-size: 0.85em;
        padding: 8px 15px;
        margin: 8px 5px 0; 
    }
    .close-btn {
        font-size: 26px;
        top: 8px;
        right: 8px;
    }
}