/*
Theme Name: Games UK49 Theme
Theme URI: https://games-uk49result.com
Author: UK49 Digital Studio
Author URI: https://games-uk49result.com
Description: Category-first game theme inspired by modern instant-play portals, built uniquely for UK49 game deployment.
Version: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: games-uk49-theme
Tags: games, responsive, arcade, lottery
*/

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

html {
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

:root {
    --primary-color: #45a04b;
    --primary-hover: #2f8a36;
    --secondary-color: #2e2e2e;
    --bg-color: #b3e5e6;
    --text-color: #252525;
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    --card-shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.22);
    --header-height: 78px;
    --footer-nav-height: 68px;
    --max-width: 1380px;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
    font-size: 17px;
    min-height: 100vh;
    overflow-x: hidden;
}

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

main {
    flex: 1;
    margin: 0 auto;
    max-width: var(--max-width);
    padding: 34px 18px;
    width: 100%;
}

.simple-header {
    background: #000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    min-height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
    padding: 4px 12px;
}

.logo {
    align-items: center;
    display: inline-flex;
    height: 70px;
    justify-content: center;
    width: 70px;
}

.logo img,
.logo .custom-logo {
    border-radius: 12px;
    height: 70px;
    object-fit: contain;
    width: 70px;
}

.logo-fallback {
    align-items: center;
    background: linear-gradient(150deg, #4caf50, #1f7bd0);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 70px;
    justify-content: center;
    width: 70px;
}

.header-links {
    align-items: center;
    display: flex;
    gap: 18px;
}

.desktop-links-game {
    flex: 1;
    gap: 8px;
    justify-content: center;
}

.nav-link {
    align-items: center;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-size: 0.96rem;
    font-weight: 600;
    min-height: 40px;
    padding: 7px 10px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f5f7fa;
    color: #0b7de3;
}

.mobile-menu-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: none;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 40px;
    padding: 7px 12px;
}

.mobile-nav-panel {
    background: #111;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 14px;
}

.mobile-nav-panel .nav-link {
    border-radius: 8px;
    font-size: 0.94rem;
}

.mobile-nav-panel.is-open {
    display: flex;
}

.page-title {
    margin-bottom: 34px;
    text-align: center;
}

.page-title h1 {
    background: linear-gradient(135deg, #4caf50, #2f9137);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 11px;
}

.page-title p {
    color: #2d2d2d;
    font-size: 1.08rem;
    margin: 0 auto;
    max-width: 780px;
}

.single-uk49-game .simple-header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.single-uk49-game .header-content {
    max-width: 1420px;
}

.single-uk49-game .nav-link {
    color: #2f2f2f;
}

.single-uk49-game .nav-link:hover {
    background: linear-gradient(135deg, #4b9aa2 0%, #764ba2 100%);
    color: #fff;
}

.single-uk49-game .mobile-menu-toggle {
    border-color: #d9d9d9;
    color: #2f2f2f;
}

.game-single-wrap {
    margin: 0 auto;
    max-width: 1460px;
    width: 100%;
}

.game-main-container {
    display: flex;
    gap: 28px;
    justify-content: center;
    padding: 10px 10px 28px;
}

.game-center {
    max-width: 980px;
    min-width: 0;
    width: 100%;
}

.game-title-bar {
    margin-bottom: 14px;
    padding: 0 4px;
}

.game-category-label {
    color: #3a7a43;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.game-title-bar h1 {
    color: #1f2937;
    font-size: 1.55rem;
    margin-bottom: 3px;
}

.game-subtitle {
    color: #516072;
    font-size: 0.95rem;
    margin: 0;
}

.game-frame-surface {
    background: #e8e5dc;
    border-radius: 22px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
    padding: 24px;
}

.game-frame-inner {
    background: #edeae2;
    border-radius: 20px;
    min-height: 640px;
    padding: 14px;
}

.single-uk49-game .game-frame-inner > p,
.single-uk49-game .game-frame-inner > h2,
.single-uk49-game .game-frame-inner > h3,
.single-uk49-game .game-frame-inner > h4 {
    display: none;
}

.game-frame-inner .uk49ga-player-section {
    margin: 0;
}

.game-frame-inner .uk49ga-player {
    border: none;
    border-radius: 18px;
    box-shadow: none;
}

.game-right-sidebar {
    align-self: flex-start;
    position: sticky;
    top: 108px;
    width: 270px;
}

.sidebar-related-games {
    padding-top: 28px;
}

.sidebar-games-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
}

.sidebar-game-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    display: block;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.sidebar-game-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transform: translateY(-4px);
}

.sidebar-game-card .game-thumb-desktop {
    aspect-ratio: 1;
    height: auto;
    width: 100%;
}

.g49-counter-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 0 auto 30px;
    max-width: 960px;
}

.g49-counter-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.g49-counter-card strong {
    color: #1f6c3b;
    display: block;
    font-size: 1.25rem;
}

.desktop-categories {
    display: block;
}

.mobile-categories {
    display: none;
}

.category-section,
.category-section-mobile {
    margin-bottom: 42px;
}

.section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 10px;
}

.section-header h2 {
    color: #2f2f2f;
    font-size: 1.75rem;
    font-weight: 700;
}

.see-all {
    color: var(--primary-color);
    display: inline-flex;
    font-size: 0.96rem;
    font-weight: 700;
    gap: 4px;
}

.see-all::after {
    content: "›";
    font-size: 1.2rem;
    line-height: 1;
}

.category-grid-desktop {
    display: grid;
    gap: 20px;
    grid-auto-flow: dense;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 10px;
}

.game-card-desktop {
    justify-self: center;
    max-width: 220px;
    transition: transform 0.3s ease;
    width: 100%;
}

.game-card-desktop:hover {
    transform: translateY(-6px);
}

.game-thumb {
    align-items: center;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    color: #fff;
    display: flex;
    font-size: 1.45rem;
    font-weight: 800;
    justify-content: center;
    width: 100%;
}

.game-thumb-desktop {
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
}

.game-thumb-mobile {
    height: 140px;
    object-fit: cover;
    width: 140px;
}

.game-card-desktop:hover .game-thumb {
    box-shadow: var(--card-shadow-hover);
}

.game-card-desktop-title,
.game-card-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 9px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scroll-container {
    padding: 0 10px;
    position: relative;
}

.horizontal-scroll {
    -webkit-overflow-scrolling: touch;
    display: grid;
    gap: 15px;
    grid-auto-flow: column;
    grid-template-columns: repeat(auto-fill, 140px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px 15px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.game-card-mobile {
    scroll-snap-align: start;
    width: 140px;
}

.game-card-mobile .game-thumb {
    height: 140px;
    width: 140px;
}

.scroll-arrow {
    align-items: center;
    background: rgba(0, 0, 0, 0.62);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    font-size: 23px;
    height: 40px;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    z-index: 10;
}

.scroll-arrow.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.scroll-container::after {
    background: linear-gradient(to right, rgba(179, 229, 230, 0), rgba(179, 229, 230, 1));
    content: "";
    height: 100%;
    pointer-events: none;
    position: absolute;
    right: 10px;
    top: 0;
    transition: opacity 0.3s ease;
    width: 56px;
    z-index: 5;
}

.scroll-container.scrolled-to-end::after {
    opacity: 0;
}

.g49-info-block {
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    margin: 0 10px 22px;
    padding: 16px;
}

.g49-info-block h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.g49-info-block p {
    color: #2e2e2e;
    margin-bottom: 8px;
}

.g49-cta-link {
    color: var(--primary-hover);
    font-weight: 700;
}

.g49-faq-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.g49-faq-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.g49-faq-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.site-footer {
    background-color: #2e2e2e;
    color: #fff;
    margin-top: auto;
    padding: 35px 18px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: var(--max-width);
    text-align: center;
}

.footer-categories {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

.footer-categories a {
    color: #fff;
    font-size: 0.94rem;
    position: relative;
    transition: color 0.3s;
}

.footer-categories a:not(:last-child)::after {
    color: rgba(255, 255, 255, 0.42);
    content: "•";
    position: absolute;
    right: -11px;
}

.footer-categories a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.88rem;
}

.footer-nav {
    align-items: center;
    background: #fff;
    border-top: 1px solid #d2d2d2;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    display: none;
    height: var(--footer-nav-height);
    justify-content: space-around;
    left: 0;
    position: fixed;
    right: 0;
    z-index: 1000;
}

.nav-item {
    align-items: center;
    color: #666;
    display: flex;
    flex-direction: column;
    font-size: 0.74rem;
    font-weight: 600;
    justify-content: center;
    min-height: 44px;
    min-width: 60px;
    padding: 7px 9px;
}

.nav-item-button {
    background: transparent;
    border: none;
    cursor: pointer;
}

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

.g49-shell {
    background: rgba(255, 255, 255, 0.62);
    border-radius: 12px;
    margin: 8px 10px 18px;
    padding: 14px;
}

.g49-section {
    margin: 8px 10px 18px;
}

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

.g49-card {
    background: rgba(255, 255, 255, 0.78);
    border-radius: 12px;
    padding: 12px;
}

.g49-layout {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 300px;
}

.g49-list {
    display: grid;
    gap: 8px;
    list-style: none;
}

.g49-list a {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    display: block;
    padding: 8px 10px;
}

.g49-shell h1,
.g49-shell h2 {
    margin-bottom: 10px;
}

.g49-shell p {
    margin-bottom: 8px;
}

.g49-text-muted {
    color: #4f4f4f;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e4e4e4;
}

body.dark-mode .page-title p,
body.dark-mode .section-header h2,
body.dark-mode .g49-info-block p,
body.dark-mode .game-card-title,
body.dark-mode .game-card-desktop-title,
body.dark-mode .g49-shell {
    color: #fff;
}

body.dark-mode .g49-info-block,
body.dark-mode .g49-shell,
body.dark-mode .g49-counter-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .footer-nav {
    background: #2d2d2d;
    border-top-color: #434343;
}

body.dark-mode .nav-item {
    color: #ddd;
}

body.dark-mode .scroll-container::after {
    background: linear-gradient(to right, rgba(26, 26, 26, 0), rgba(26, 26, 26, 1));
}

@media (max-width: 767px) {
    .desktop-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .desktop-categories {
        display: none;
    }

    .mobile-categories {
        display: block;
    }

    .scroll-arrow {
        display: flex;
    }

    .footer-nav {
        display: flex;
    }

    main {
        padding: 20px 0 calc(var(--footer-nav-height) + 20px);
    }

    .page-title {
        margin-bottom: 26px;
        padding: 0 14px;
    }

    .page-title h1 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.42rem;
    }

    .site-footer {
        padding: 30px 15px calc(var(--footer-nav-height) + 28px);
    }

    .g49-layout {
        grid-template-columns: 1fr;
    }

    .single-uk49-game .simple-header {
        display: none;
    }

    .game-main-container {
        flex-direction: column;
        gap: 0;
        padding: 0 0 20px;
    }

    .game-center {
        max-width: 100vw;
        width: 100vw;
    }

    .game-title-bar {
        display: none;
    }

    .game-frame-surface {
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .game-frame-inner {
        border-radius: 0;
        min-height: calc(100vh - var(--footer-nav-height));
        padding: 0;
    }

    .game-right-sidebar {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.8rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .game-card-mobile {
        width: 130px;
    }

    .game-card-mobile .game-thumb {
        height: 130px;
        width: 130px;
    }

    .horizontal-scroll {
        grid-template-columns: repeat(auto-fill, 130px);
    }
}
