/* ==========================================================================
   Moban 8-10-32 — App Shell (mobile-first)
   Palette: deep blue #0B4F6C / amber #FFB627 / light #F1F6F9
   ========================================================================== */

html, body { overflow-x: hidden; }

:root {
    --navy: #0B4F6C;
    --navy-deep: #073A50;
    --navy-ink: #052A3A;
    --amber: #FFB627;
    --amber-deep: #F09E00;
    --bg: #F1F6F9;
    --card: #FFFFFF;
    --ink: #123243;
    --muted: #5E7888;
    --line: #DCE8EF;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow: 0 6px 18px rgba(11, 79, 108, 0.10);
    --shadow-lg: 0 14px 34px rgba(11, 79, 108, 0.16);
    --header-h: 58px;
    --tabbar-h: 66px;
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-download {
    background: linear-gradient(135deg, var(--amber), var(--amber-deep));
    color: var(--navy-ink);
    box-shadow: 0 6px 16px rgba(255, 182, 39, 0.45);
}
.btn-download:hover { box-shadow: 0 10px 24px rgba(255, 182, 39, 0.6); transform: translateY(-2px); }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-login {
    color: #CFE6F0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 16px;
    font-size: 13px;
}
.btn-register {
    background: var(--amber);
    color: var(--navy-ink);
    padding: 7px 16px;
    font-size: 13px;
}

/* ---------- Top bar ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 120;
    background: linear-gradient(180deg, var(--navy), var(--navy-deep));
    box-shadow: 0 2px 12px rgba(5, 42, 58, 0.35);
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.logo-img { height: 34px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Reading progress bar ---------- */
.reading-progress {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--amber), #FFD469);
    z-index: 130;
    border-radius: 0 3px 3px 0;
    transition: width 0.1s linear;
}

/* ---------- Layout shells ---------- */
.site-main { min-width: 0; }
.home-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 14px 26px;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "hero"
        "cats"
        "games"
        "news"
        "cta";
    gap: 18px;
}
.hero-card { grid-area: hero; min-width: 0; }
.cat-section { grid-area: cats; min-width: 0; }
.games-section { grid-area: games; min-width: 0; }
.news-section { grid-area: news; min-width: 0; }
.cta-section { grid-area: cta; min-width: 0; }

.page-wrap { max-width: 820px; margin: 0 auto; padding: 18px 14px 30px; min-width: 0; }
.single-wrap { max-width: 780px; }

/* ---------- Section titles ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 900;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 14px;
}
.title-bar {
    width: 5px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--amber), var(--amber-deep));
    flex-shrink: 0;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.section-head .section-title { margin-bottom: 14px; }
.link-more {
    font-size: 13px;
    font-weight: 700;
    color: var(--amber-deep);
    margin-bottom: 14px;
    flex-shrink: 0;
}
.link-more:hover { text-decoration: underline; }

/* ---------- Hero card ---------- */
.hero-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--navy-deep);
    box-shadow: var(--shadow-lg);
}
.hero-media { position: relative; aspect-ratio: 16 / 8.2; }
.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.hero-img.is-active { opacity: 1; }
.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 42, 58, 0) 25%, rgba(5, 42, 58, 0.88) 100%);
}
.hero-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 18px 34px;
    color: #fff;
}
.hero-chip {
    display: inline-block;
    background: var(--amber);
    color: var(--navy-ink);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.hero-title {
    font-size: clamp(20px, 5.4vw, 34px);
    font-weight: 900;
    line-height: 1.18;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
}
.hero-desc { font-size: 13.5px; color: rgba(255, 255, 255, 0.85); margin-bottom: 12px; max-width: 520px; }
.hero-dots {
    position: absolute;
    right: 16px;
    bottom: 12px;
    display: flex;
    gap: 6px;
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}
.hero-dot.is-active { width: 20px; background: var(--amber); }

/* ---------- Category grid ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.cat-tile {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 8px 14px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 1px solid transparent;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.cat-tile:hover {
    transform: translateY(-4px);
    border-color: var(--amber);
    box-shadow: var(--shadow-lg);
}
.cat-emoji { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.cat-name { font-weight: 800; font-size: 14px; color: var(--navy); }
.cat-sub { font-size: 11px; color: var(--muted); }

/* ---------- Games horizontal scroller ---------- */
.games-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 4px 2px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--amber) transparent;
}
.games-scroller::-webkit-scrollbar { height: 5px; }
.games-scroller::-webkit-scrollbar-thumb { background: var(--amber); border-radius: 99px; }
.game-card {
    position: relative;
    flex: 0 0 138px;
    min-width: 0;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.game-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.game-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(5, 42, 58, 0.82);
    color: var(--amber);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
}
.game-info { padding: 10px 10px 12px; }
.game-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.game-dl {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--navy-ink);
    background: var(--amber);
    padding: 4px 12px;
    border-radius: 999px;
}

/* ---------- News list ---------- */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.news-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.news-link { display: flex; gap: 12px; padding: 12px; align-items: center; }
.news-thumb {
    flex: 0 0 96px;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--line);
    aspect-ratio: 4 / 3;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { min-width: 0; flex: 1; }
.news-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-excerpt {
    font-size: 12.5px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.news-date { font-size: 11.5px; color: var(--muted); }
.news-empty { padding: 24px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }

/* ---------- CTA + posters ---------- */
.cta-card {
    background: linear-gradient(135deg, var(--navy), var(--navy-deep));
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.cta-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 182, 39, 0.28), transparent 70%);
}
.cta-title { color: #fff; font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.cta-desc { color: rgba(255, 255, 255, 0.78); font-size: 13px; }
.poster-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.poster-strip img {
    flex: 0 0 120px;
    min-width: 0;
    border-radius: 12px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* ---------- Page head / archive / single ---------- */
.page-head {
    background: linear-gradient(135deg, var(--navy), var(--navy-deep));
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    margin-bottom: 18px;
    color: #fff;
}
.page-title { font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.page-sub { font-size: 13px; color: rgba(255, 255, 255, 0.75); margin-top: 4px; }

.single-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px 18px 26px;
    margin-bottom: 20px;
}
.single-cat {
    display: inline-block;
    background: var(--amber);
    color: var(--navy-ink);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.single-title { font-size: clamp(20px, 5vw, 30px); font-weight: 900; color: var(--navy); line-height: 1.25; margin-bottom: 10px; }
.single-meta { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.single-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.single-content { font-size: 15.5px; line-height: 1.75; color: var(--ink); word-wrap: break-word; }
.single-content p { margin-bottom: 14px; }
.single-content h2, .single-content h3, .single-content h4 { color: var(--navy); margin: 20px 0 10px; font-weight: 800; }
.single-content img { border-radius: 12px; margin: 12px 0; }
.single-content a { color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--amber); }
.single-content ul, .single-content ol { padding-left: 22px; margin-bottom: 14px; }
.single-content ul li { list-style: disc; margin-bottom: 4px; }
.single-content ol li { list-style: decimal; margin-bottom: 4px; }
.single-content blockquote {
    border-left: 4px solid var(--amber);
    background: var(--bg);
    border-radius: 0 12px 12px 0;
    padding: 12px 16px;
    margin: 14px 0;
    font-style: italic;
}
.single-cta {
    margin-top: 22px;
    background: var(--bg);
    border: 1px dashed var(--amber);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.single-cta-text { font-weight: 700; color: var(--navy); font-size: 14px; }
.related-section { margin-top: 6px; }

.pagination-bar { margin-top: 20px; }
.pagination-bar .nav-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination-bar .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    background: var(--card);
    color: var(--navy);
    font-weight: 700;
    font-size: 13px;
    box-shadow: var(--shadow);
}
.pagination-bar .page-numbers.current { background: var(--amber); color: var(--navy-ink); }

/* ---------- Comments ---------- */
.comments-area { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 18px; }
.comments-area .comment-reply-title, .comments-area .comments-title { color: var(--navy); font-weight: 800; margin-bottom: 12px; }
.comments-area .comment-list { margin-bottom: 14px; }
.comments-area .comment { border-bottom: 1px solid var(--line); padding: 12px 0; }
.comments-area input[type="text"], .comments-area input[type="email"], .comments-area input[type="url"], .comments-area textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    background: var(--bg);
}
.comments-area .submit {
    background: var(--amber);
    color: var(--navy-ink);
    border: none;
    border-radius: 999px;
    padding: 10px 26px;
    font-weight: 800;
    cursor: pointer;
}

/* ---------- Widgets ---------- */
.widget { margin-bottom: 16px; }
.widget-title { color: var(--amber); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.widget ul li { margin-bottom: 6px; }
.widget a { color: rgba(255, 255, 255, 0.8); }
.widget a:hover { color: var(--amber); }
.widget input[type="text"], .widget input[type="search"] {
    width: 100%;
    border-radius: 12px;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
}
.widget button { background: var(--amber); border: none; border-radius: 12px; padding: 9px 16px; font-weight: 700; margin-top: 6px; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer {
    background: linear-gradient(180deg, var(--navy-deep), var(--navy-ink));
    color: rgba(255, 255, 255, 0.8);
    padding: 34px 16px calc(var(--tabbar-h) + 24px);
    margin-top: 26px;
}
.footer-widgets {
    max-width: 1100px;
    margin: 0 auto 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.footer-bottom { max-width: 760px; margin: 0 auto; text-align: center; }
.disclaimer-text {
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin: 14px 0 8px;
}
.footer-copy { font-size: 12px; color: rgba(255, 255, 255, 0.45); }

/* ==========================================================================
   Bottom notch tab bar — fixed, left:0 right:0 (never width:100vw)
   ========================================================================== */
.app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    height: var(--tabbar-h);
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, var(--navy), var(--navy-deep));
    box-shadow: 0 -8px 24px rgba(5, 42, 58, 0.35);
    padding: 0 4px env(safe-area-inset-bottom, 0);
}
.tabbar-left, .tabbar-right {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 0;
}
.tabbar-left { padding-right: 42px; }
.tabbar-right { padding-left: 42px; }
.tab-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10.5px;
    font-weight: 600;
    transition: color 0.2s ease;
    padding: 6px 2px;
}
.tab-item:hover, .tab-item.is-active { color: var(--amber); }
.tab-icon { font-size: 19px; line-height: 1; }
.tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Raised center download button */
.tab-center {
    position: absolute;
    left: 50%;
    top: -30px;
    transform: translateX(-50%);
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 210;
}
.tab-center-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--amber), var(--amber-deep));
    color: var(--navy-ink);
    font-size: 26px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--bg);
    box-shadow: 0 8px 22px rgba(255, 182, 39, 0.55);
    animation: centerPulse 2.4s ease-in-out infinite;
    transition: transform 0.2s ease;
}
.tab-center:hover .tab-center-icon { transform: scale(1.07); }
.tab-center:active .tab-center-icon { transform: scale(0.94); }
.tab-center-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
@keyframes centerPulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(255, 182, 39, 0.55); }
    50% { box-shadow: 0 8px 30px rgba(255, 182, 39, 0.9); }
}

/* Notch cutouts — radial gradient circles matching the page background */
.tabbar-left::after, .tabbar-right::before {
    content: "";
    position: absolute;
    top: 0;
    width: 44px;
    height: 44px;
    pointer-events: none;
}
.tabbar-left::after {
    left: calc(50% - 80px);
    background: radial-gradient(circle at center, var(--bg) 0, var(--bg) 19px, transparent 20.5px);
}
.tabbar-right::before {
    right: calc(50% - 80px);
    background: radial-gradient(circle at center, var(--bg) 0, var(--bg) 19px, transparent 20.5px);
}

/* ---------- Desktop home grid areas (areas must live only in main.css) ---------- */
@media (min-width: 769px) {
    .home-grid {
        grid-template-columns: 1.5fr 1fr;
        grid-template-areas:
            "hero hero"
            "cats cats"
            "games games"
            "news cta";
    }
    .news-section { min-width: 0; }
}

/* ---------- Scroll reveal ---------- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.scroll-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal { opacity: 1; transform: none; transition: none; }
    .tab-center-icon { animation: none; }
}
