* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
    --bg: #f6f8fb;
    --muted: #98a7b6;
    --accent: #0f6cff;
    --card: #e6eef6;
    --card-end: #f7fbff;
    --header-bg: rgba(255,255,255,0.72);
    --submenu-start: var(--card);
    --submenu-end: #f4fbff;
    --header-contrast-start: rgba(255,255,255,0.06);
    --header-contrast-end: rgba(255,255,255,0.02);
    --text: #1b2430;
    --shadow: rgba(20,30,40,0.08);
}

[data-theme="dark"] {
    --bg: #071029;
    --muted: #9aa9bf;
    --text: #eaf2ff;
    --card: #0f1724;
    --card-end: #0f1724;
    --header-bg: rgba(10,16,28,0.6);
    --submenu-start: var(--card);
    --submenu-end: var(--card);
    --header-contrast-start: rgba(255,255,255,0.03);
    --header-contrast-end: rgba(255,255,255,0.01);
    --accent: #4aa6ff;
    --shadow: rgba(0,0,0,0.25);
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, var(--bg), var(--bg));
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing:antialiased;
}

        .site-header {
            position: fixed;
            top: 18px;
            left: 50%;
            transform: translateX(-50%);
            width: min(1100px, 95%);
            z-index: 60;
            backdrop-filter: blur(8px) saturate(120%);
            background: var(--header-bg);
            border-radius: 14px;
            padding: 10px 18px;
            box-shadow: 0 8px 30px var(--shadow);
            color: var(--text);
        }

        .header-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .site-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text);
        }

        .nav-toggle img {
            width: 28px;
            cursor: pointer;
        }

        .nav-toggle {
            background: none;
            border: none;
            display: none;
        }

        .nav-menu {
            display: flex;
            gap: 20px;
            list-style: none;
            align-items: center;
        }

        .nav-menu a,
        .submenu-toggle {
            cursor: pointer;
            color: var(--text);
            text-decoration: none;
            font-size: 0.98rem;
            padding: 6px 8px;
            border-radius: 8px;
            transition: background .18s ease, color .18s ease;
        }

        #theme-toggle {
            --w: 52px;
            --h: 28px;
            display: inline-flex;
            align-items: center;
            width: var(--w);
            height: var(--h);
            padding: 4px;
            border-radius: calc(var(--h) / 2);
            border: 1px solid rgba(20,30,40,0.06);
            background: linear-gradient(180deg, var(--header-contrast-start), var(--header-contrast-end));
            cursor: pointer;
            transition: background .15s ease, border-color .15s ease;
        }
        #theme-toggle .theme-toggle-knob {
            width: calc(var(--h) - 8px);
            height: calc(var(--h) - 8px);
            background: var(--card);
            border-radius: 50%;
            transform: translateX(0);
            transition: transform .18s ease, background .18s ease;
            box-shadow: 0 4px 10px rgba(6,18,34,0.12);
        }
        #theme-toggle.on { background: linear-gradient(90deg,var(--accent), #3aa0ff); border-color: rgba(15,108,255,0.12); }
        #theme-toggle.on .theme-toggle-knob { transform: translateX(calc(var(--w) - var(--h))); background: var(--card); }

        @media (max-width: 850px) {
            #theme-toggle { display: none; }
        }

        #theme-toggle:focus { outline: 2px solid rgba(15,108,255,0.18); outline-offset: 3px; }
        #theme-toggle.on .theme-toggle-knob { background: var(--card); }

        .nav-menu a:hover,
        .submenu-toggle:hover{ background: rgba(15,108,255,0.08); color: var(--accent);} 

        .has-submenu {
            position: relative;
        }

        .has-submenu::after{
            content: '';
            position: absolute;
            left: 6px;
            right: 6px;
            top: calc(100% - 2px);
            height: 12px;
            z-index: 40;
            pointer-events: auto;
        }

        .submenu {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            left: 50%;
            transform: translateX(-50%);

            background: linear-gradient(180deg, var(--submenu-start), var(--submenu-end));
            border-radius: 10px;
            padding: 10px;
            list-style: none;
            min-width: 180px;
            box-shadow: 0 12px 30px rgba(20,30,40,0.08);
            max-width: calc(100vw - 40px);
        }

        .has-submenu:hover .submenu,
        .submenu:hover {
            display: block;
        }

        .submenu li { margin: 6px 0; }
        .submenu a { color: var(--text); display:block; padding:6px 10px; border-radius:6px; }
        .submenu a:hover{ background: rgba(15,108,255,0.06); color:var(--accent);} 

        .hero {
            margin-top: 0;
            width: 100%;
            height: 100vh;
            min-height: 100vh;
            position: relative;
            overflow: hidden;

            background-image: url('/images/hero-placeholder.png');
            background-position: center center;
            background-repeat: no-repeat;
            background-size: cover;
            background-attachment: fixed;

            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0 20px;
        }

        .hero { will-change: transform }

        .hero::before{
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(6,18,34,0.35) 0%, rgba(6,18,34,0.12) 40%, rgba(246,250,255,0.0) 70%);
            z-index: 0;
            pointer-events: none;
        }

        .hero::after{
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: -1px;
            height: 140px;
            background: linear-gradient(180deg, rgba(255,255,255,0) 10%, var(--bg) 85%);
            pointer-events: none;
            z-index: 1;
        }

        .hero-content {
            text-align: center;
            font-size: clamp(1.6rem, 2.6vw, 2.6rem);
            color: #ffffff;
            z-index: 2;
            text-shadow: 0 6px 20px rgba(6,18,34,0.45);
        }

        .hero-content p{ opacity:0.95; color: #e6f0ff; font-size: clamp(1rem, 1.6vw, 1.1rem); margin-top:10px}

        .hero .cta { margin-top:18px }
        .hero .cta a{ background: linear-gradient(90deg,var(--accent),#3aa0ff); color:white; padding:12px 20px; border-radius:10px; text-decoration:none; display:inline-block }

        .site-header{ z-index:80 }

        .page-hero {
            width: 100%;
            height: 36vh;
            min-height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 20px;
            background: linear-gradient(180deg, rgba(15,108,255,0.06), rgba(15,108,255,0.02));
        }
        .page-hero h2 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 2rem); }

        .container { max-width: 980px; margin: 0 auto; padding: 0 18px; }

        .page-section { padding: 48px 0; }

        .news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

        .form-control { display: block; width: 100%; padding: 12px 14px; border: 1px solid rgba(20,30,40,0.06); border-radius: 8px; background: var(--card); margin: 8px 0 14px; }
        .form-label { display:block; font-weight:600; margin-bottom:6px; color: var(--text); }

        .muted { color: var(--muted); }

        .center { text-align: center; }

        .news .dark { display: block; margin: 12px auto; }

        .news-item { display: flex; flex-direction: column; justify-content: space-between; min-height: 240px; }
        .news-item .dark { margin-top: 12px; align-self: center; }

        section {
            padding: 40px 20px;
            background: transparent;
        }

        .games { margin-top: -80px; padding-top: 120px; }

        .game-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
            gap: 20px;
            padding: 0 20px;
            margin-top: 40px;
            justify-content: center;
            align-items: start;
        }

        .game-grid.two-up {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            justify-content: center;
        }

        .game-card.coming-soon { 
            background: linear-gradient(180deg, var(--card), var(--card-end));
            border: 1px dashed rgba(15,108,255,0.06);
        }

        .game-card.coming-soon img {
            width: 44%;
            flex: 0 0 200px;
            height: auto;
            max-height: 200px;
            object-fit: contain;
            display: block;
            padding: 18px;
            background: transparent;
            border-top-left-radius: 14px;
            border-bottom-left-radius: 14px;
        }

        .game-card.coming-soon .content { padding: 20px; }

        .game-card.coming-soon .content h3 { color: var(--text); }
        .game-card.coming-soon .content p { color: var(--muted); }

        .game-card.coming-soon .dark {
            pointer-events: none;
            opacity: 0.9;
            filter: grayscale(20%);
        }

        .game-grid:has(.game-card:nth-child(3):last-child) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            justify-content: center;
        }

        .game-grid:has(.game-card:nth-child(3):last-child) .game-card {
            max-width: none;
        }

        .game-grid:has(.game-card:nth-child(3):last-child)::after {
            content: "Coming soon";
            white-space: pre-line;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            padding: 16px;
            border-radius: 14px;
            background: var(--card);
            border: 1px dashed rgba(15,108,255,0.06);
            box-shadow: 0 10px 30px var(--shadow);
            color: var(--muted);
            font-weight: 600;
            font-size: 1rem;
        }

        .game-card {
            background: var(--card);
            padding: 16px;
            border-radius: 14px;
            text-align: left;
            border: 1px solid rgba(15,108,255,0.06);
            margin: 0 auto;
            box-shadow: 0 10px 30px var(--shadow);
            transition: transform .18s ease, box-shadow .18s ease;
            display: flex;
            flex-direction: row;
            align-items: stretch;
            overflow: hidden;
            gap: 0;
        }

        .game-card:hover{ transform: translateY(-6px); box-shadow: 0 18px 50px rgba(20,30,40,0.12) }

        .game-card img {
            width: 44%;
            flex: 0 0 200px;
            height: auto;
            max-height: 200px;
            object-fit: cover;
            display: block;
            border-top-left-radius: 14px;
            border-bottom-left-radius: 14px;
        }

        .game-card .content {
            padding: 20px;
            display: flex;
            flex-direction: column;
            min-height: 160px;
            gap: 8px;
            flex: 1 1 auto;
            min-width: 0;
        }

        @media (max-width: 900px) {
            .game-grid { grid-template-columns: 1fr; padding: 0 12px; gap: 20px; }
            .game-card { flex-direction: column; padding: 8px; }
            .game-card img { width: 100%; flex: 0 0 auto; max-height: 320px; border-radius: 14px 14px 0 0; }
        }

        .game-card h3 { margin: 0 0 6px 0; }

        .game-card .content h3,
        .game-card .content p {
            text-align: center;
        }
        .game-card .content p { margin-top: 6px; color: var(--muted); }

        .game-card .content a.dark { margin-top: auto; }

        .news-item {
            margin-bottom: 30px;
            background: var(--card);
            border: 1px solid rgba(15,108,255,0.06);
            padding: 18px;
            border-radius: 12px;
            box-shadow: 0 8px 28px rgba(20,30,40,0.06);
        }

        .news-item .news-hero {
            width: 100%;
            height: 260px;
            object-fit: cover;
            border-radius: 10px;
            display: block;
            margin-bottom: 12px;
        }

        .game-detail .news-hero { height: 320px; }

        @media (max-width: 900px) {
            .game-detail .news-hero { height: 220px; }
        }

        .news-item h3{
            font-size: 1.4rem;
            margin: 8px 0 8px;
        }

        .news-item p{ color: var(--muted); font-size: 1.02rem; line-height:1.55 }

        #news-list { display: grid; gap: 22px; padding: 8px 12px }

        .dark {
            display: inline-block;
            text-decoration: none;
            color: #ffffff;
            background: linear-gradient(90deg,var(--accent), #3aa0ff);
            padding: 10px 16px;
            border-radius: 10px;
            box-shadow: 0 8px 22px rgba(15,108,255,0.12);
            transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
        }

        .dark:hover { transform: translateY(-2px); opacity: 0.98 }

        .game-card a.dark {
            display: inline-block;
            min-width: 220px;
            padding: 12px 22px;
            text-align: center;
        }

        /* Non-clickable Store Page placeholder for 'Play / Store' buttons */
        .store-tba {
            display: inline-block;
            min-width: 220px;
            padding: 12px 22px;
            text-align: center;
            pointer-events: none;
            opacity: 0.92; /* slightly muted but still colored */
            filter: brightness(0.92) saturate(0.85);
            cursor: default;
            /* Let .dark provide the gradient; do not override it here. */
            border: 1px solid rgba(20,30,40,0.06);
            box-shadow: none;
            color: inherit; /* preserve white text for .dark buttons */
        }

        .about-preview,
        .news {
            max-width: 980px;
            margin: 0 auto;
            text-align: center;
        }

        @media (max-width: 850px) {
            .submenu {
                position: static;
                transform: none;
                left: auto;
                max-width: 100%;
                background: rgba(0,0,0,0.9);
                color: #ffffff;
            }
            .submenu a { color: #ffffff; }
        }

        @media (max-width: 900px){
            .site-header{ top:12px; padding:10px }
        }

        @media (max-width: 700px) {
                .game-card a.dark { display: block; width: 100%; min-width: 0; }
                .hero{ background-attachment: scroll }
                .hero::before{ background: linear-gradient(180deg, rgba(6,18,34,0.28) 0%, rgba(6,18,34,0.06) 40%, rgba(246,250,255,0.0) 70%);} 
        }

        @media (max-width: 850px) {
            .nav-toggle { display: block; }

            .nav-menu {
                display: none;
                flex-direction: column;
                margin-top: 15px;
                background: rgba(0,0,0,0.9);
                padding: 15px;
                border-radius: 15px;
            }

            .nav.open .nav-menu { display: flex; }
        }
