/* Default style start */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

body {
    --bg-main: #121212;
    --bg-surface: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #bbb;
    --border-color: #333;
    --accent: #007bff;
    --accent-text: #66b3ff;
    --accent-btn: #0066d6;
    --req-bg: #e0e0e0;
    --req-text: #121212;
    --radius: 8px;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}

body[data-theme="light"] {
    --bg-main: #f4f4f6;
    --bg-surface: #ffffff;
    --bg-card: #e9e9eb;
    --bg-input: #dddddf;
    --text-primary: #121212;
    --text-secondary: #555;
    --border-color: #ccc;
    --accent: #0056b3;
    --accent-text: #00428f;
    --accent-btn: #0056b3;
    --req-bg: #2a2a2a;
    --req-text: #ffffff;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-section,
.grid-section {
    margin-bottom: 3rem;
}

.hero-section h2,
.grid-section h2 {
    margin-bottom: 1rem;
}
/* Default style end */

/* Header, footer and nav start */
.main-header,
.main-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.main-footer {
    justify-content: flex-end;
    margin-top: auto;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
}

.main-footer .logo {
    order: 1;
}

.header-controls,
.main-nav ul,
.footer-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
}

.header-controls {
    justify-content: flex-end;
    margin-left: auto;
}

.main-nav a,
.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.main-nav a:hover,
.footer-nav a:hover {
    color: var(--text-primary);
}

.main-nav a[aria-current="page"],
.footer-nav a[aria-current="page"] {
    color: var(--accent-text);
    font-weight: 600;
}

.main-header .logo {
    order: -1;
}

.logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    height: 64px;
    width: auto;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
}

.sun-icon,
.moon-icon {
    color: var(--text-primary);
}

.menu-toggle {
    display: none;
}

body[data-theme="light"] .sun-icon,
body:not([data-theme="light"]) .moon-icon {
    display: none;
}
/* Header, footer and nav end */

/* Carousel start */
.carousel-container {
    position: relative;
    width: 100%;
}

.carousel-stage {
    display: grid;
    width: 100%;
    overflow: hidden;
}

.card-group {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.card-group.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 3.5rem;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.carousel-arrow:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.prevBtn { left: 0;  transform: translateX(-120%); }
.nextBtn { right: 0; transform: translateX(120%); }

body[data-theme="light"] .carousel-arrow {
    color: rgba(0, 0, 0, 0.55);
}

body[data-theme="light"] .carousel-arrow:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.06);
}
/* Carousel end */

/* Game card and featured release start */
.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    font: inherit;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.game-card img {
    aspect-ratio: 460 / 215;
    object-fit: cover;
}

.game-card .game-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.game-card:hover .game-title {
    background: var(--accent-btn);
    color: #ffffff;
}

.hero-section .carousel-container {
    margin: 0 auto;
}

.hero-section .card-group {
    grid-template-columns: 1fr;
}

.hero-section .game-card img {
    aspect-ratio: 1920 / 620;
}

.hero-section .game-card .game-title {
    padding: 1.1rem 1rem;
    font-size: 1.5rem;
}
/* Game card and featured release end */

/* Popup start */
.popup-modal {
    width: 90%;
    max-width: 500px;
    margin: auto;
    padding: 2rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.popup-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.popup-modal form[method="dialog"] {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.popup-modal .close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-modal .close-btn:hover {
    color: red;
}

.popup-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--accent);
    border-radius: 4px;
}

.popup-info-header,
.popup-meta-footer {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 4px;
}

.popup-info-header h2 {
    margin-bottom: 0.25rem;
    font-size: 1.4rem;
}

.popup-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.popup-description {
    margin: 1rem 0;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    border-bottom: 1px dashed var(--border-color);
}

.popup-requirements {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: var(--req-bg);
    color: var(--req-text);
    border-radius: 4px;
    cursor: pointer;
}

.popup-requirements summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    list-style: none;
}

.popup-requirements summary::before         { content: "\25BD "; }
.popup-requirements[open] summary::before   { content: "\25B3 "; }

.popup-requirements p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.popup-meta-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popup-meta-footer:has(> a:only-child) {
    justify-content: flex-end;
}

.steam-icon {
    display: block;
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
    object-fit: contain;
    transition: transform 0.2s;
}

.popup-meta-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
    margin-left: auto; 
}

.popup-meta-footer a:hover {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

.gold-star {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.3);
}
/* Popup end */

/* Responsive screen start */
@media (min-width: 992px) {
    .card-group { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1350px) {
    .prevBtn { transform: none; background: linear-gradient(to right, rgba(0, 0, 0, 0.75), transparent); }
    .nextBtn { transform: none; background: linear-gradient(to left,  rgba(0, 0, 0, 0.75), transparent); }
    .carousel-arrow:hover { background: rgba(255, 255, 255, 0.15); }

    body[data-theme="light"] .prevBtn { background: linear-gradient(to right, rgba(255, 255, 255, 0.85), transparent); }
    body[data-theme="light"] .nextBtn { background: linear-gradient(to left,  rgba(255, 255, 255, 0.85), transparent); }
    body[data-theme="light"] .carousel-arrow:hover { background: rgba(0, 0, 0, 0.08); }
}

@media (max-width: 768px) {
    .main-header {
        display: grid;
        grid-template-columns: 1fr auto;
        padding: 1rem;
    }

    .logo {
        grid-area: 1 / 1;
    }

    .logo img {
        height: 52px;
    }

    .header-controls {
        grid-area: 1 / 2;
        gap: 0.5rem;
        margin: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        background: var(--bg-input);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        color: var(--text-primary);
        cursor: pointer;
        transition: border-color 0.2s;
    }

    .menu-toggle:hover {
        border-color: var(--accent);
    }

    .menu-icon,
    .menu-icon::before,
    .menu-icon::after {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: transform 0.25s, top 0.25s, background 0.2s;
    }

    .menu-icon {
        position: relative;
    }

    .menu-icon::before,
    .menu-icon::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .menu-icon::before { top: -6px; }
    .menu-icon::after  { top: 6px; }

    .menu-toggle[aria-expanded="true"] .menu-icon {
        background: transparent;
    }

    .menu-toggle[aria-expanded="true"] .menu-icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .menu-icon::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .main-nav {
        display: none;
        grid-area: 2 / 1 / 3 / 3;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .main-nav a {
        display: block;
        padding: 0.7rem 1rem;
        border-radius: var(--radius);
    }

    .main-nav a:hover,
    .main-nav a[aria-current="page"] {
        background: var(--bg-card);
    }

    .main-footer {
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        padding: 1.25rem 1rem;
    }

    .main-footer .logo {
        order: -1;
    }

    .footer-nav ul {
        justify-content: center;
        gap: 0.5rem 1.25rem;
    }

    .footer-nav a {
        font-size: 0.9rem;
    }

    .carousel-arrow {
        width: 40px;
        font-size: 2.5rem;
    }

    .hero-section .game-card .game-title {
        padding: 0.85rem 0.75rem;
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    main { padding: 1rem 0.5rem; }
    .hero-section .game-card .game-title { font-size: 1rem;
    .popup-modal { padding: 1.25rem; } }
}
/* Responsive screen end */

/* Contact start */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.contact-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}
.submit-btn {
    background: var(--accent-btn);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}
.submit-btn:hover {
    opacity: 0.9;
}
.form-alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}
.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
}
body[data-theme="light"] .alert-success { color: #1e7e34; }
.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #dc3545;
}
body[data-theme="light"] .alert-error { color: #bd2130; }
/* Contact end */

/* Status popup start */
.status-popup {
    max-width: 420px;
    text-align: center;
}

.status-popup .status-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.status-popup .status-logo img {
    display: block;
    height: 72px;
    width: auto;
}

.status-popup h2 {
    margin-bottom: 0.5rem;
}

.status-popup p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-success h2 { color: #28a745; }
.status-error h2   { color: #dc3545; }

body[data-theme="light"] .status-success h2 { color: #1e7e34; }
body[data-theme="light"] .status-error h2   { color: #bd2130; }
/* Status popup end */