/*
 * 首页样式
 * < 1400px：手机 / 平板 / 小笔记本，单列全屏分段
 * >= 1400px：桌面，左图右文
 */
:root {
    --navy: #0d1b45;
    --navy-deep: #081233;
    --orange: #ff9f1c;
    --text-muted: rgb(255 255 255 / 0.86);
    --font-display: "Baloo 2", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Noto Sans", "Noto Sans Thai", sans-serif;
}

.desktop {
    display: none;
}

html {
    scroll-behavior: smooth;
}
body {
    background-color: var(--navy-deep);
    color: #ffffff;
    font-family: var(--font-body);
}
body a {
    text-decoration: none;
    color: #ffffff;
}

/* 标题：圆润粗体 + 游戏按钮式硬投影 */
h1, h2 {
    font-family: var(--font-display);
    font-weight: 800;
    text-shadow: 0 3px 0 var(--navy), 0 6px 16px rgb(0 0 0 / 0.35);
}
h1 {
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
    line-height: 1.1;
}
h2 {
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
    line-height: 1.15;
    margin: 0 0 0.4em;
}

/* 文字区：从插画渐变到深蓝底 */
/* 两侧各留 36px，避开左下角的导航圆点 */
.center {
    width: min(100% - 72px, 36em);
    margin: 0 auto;
}
.text-background {
    background: linear-gradient(to bottom, rgb(8 18 51 / 0), rgb(8 18 51 / 0.88) 30%, rgb(8 18 51 / 0.96));
    padding: 80px 0 48px;
    line-height: 1.65;
    color: var(--text-muted);
}
.text-background h2 {
    color: #ffffff;
}
.align {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* 手机导航：左下角圆点 */
#nav-desktop {
    display: none;
}
#nav-mobile {
    position: fixed;
    left: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    z-index: 2;
}
#nav-mobile a {
    width: 10px;
    height: 10px;
    background: #fff;
    opacity: .4;
    border-radius: 100%;
    margin: 5px 0;
}
#nav-mobile a.selected {
    height: 40px;
    opacity: .8;
    border-radius: 20px;
}

/* 每段一屏，背景图等比铺满，不拉伸 */
section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: clip;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* 首屏：图片随屏幕高度缩放，保证按钮在一屏内 */
#home {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 32px;
    background-image: url("/img/home_bg.png");
}
#home-logo {
    flex-shrink: 0;
    width: min(260px, 70%);
}
#home-text {
    flex-shrink: 0;
    width: min(420px, 90%);
    margin-top: 12px;
    text-align: center;
}
#home-text h1 {
    margin: 0;
}
#home > #home-image {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 8px 0 -16px;
}
#home-image img {
    height: 100%;
    width: auto;
    max-width: min(100%, 560px);
    object-fit: contain;
}
#store-link {
    flex-shrink: 0;
    position: relative;
    display: flex;
    gap: 12px;
    width: min(420px, 90%);
}
#store-link a {
    flex: 1;
}
#store-link img {
    width: 100%;
}

/* About 轮播 */
#about {
    background-image: url("/img/about_bg.png");
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 56px 0;
}
.embla {
    width: min(100%, 880px);
}
.embla__viewport {
    overflow: hidden;
}
.embla__container {
    display: flex;
}
.embla__slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 0 20px;
    text-align: center;
}
.about-image {
    margin: 16px 0 20px;
}
.about-image img {
    margin: 0 auto;
    border-radius: 20px;
}
.about-body {
    max-width: 36em;
    margin: 0 auto;
    line-height: 1.65;
    color: var(--text-muted);
}
.embla__controls {
    width: 105px;
    margin: 36px auto 0 auto;
}
.embla__dots {
    display: flex;
    flex-direction: row;
    column-gap: 15px;
    align-items: center;
}
.embla__dot {
    background: url("/img/selectoff.png") no-repeat center;
    background-size: contain;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.5);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    cursor: pointer;
    border: 0;
    width: 25px;
    height: 24px;
}
.embla__dot--selected {
    background-image: url("/img/selecton.png");
}

/* 游戏：竖屏用竖版背景，横屏用横版背景 */
#game {
    background-image: url("/img/game_bg_1_m.png");
    background-position: center top;
}
@media (orientation: landscape) and (min-width: 768px) {
    #game {
        background-image: url("/img/game_bg_1.png");
    }
}
#game-icon-list {
    width: min(92%, 600px);
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border-radius: 24px;
    padding: 10px;
    margin: 0 auto -48px;
    position: relative;
    z-index: 1;
    background-color: rgb(0 0 0 / 45%);
    backdrop-filter: blur(6px);
}
.game-icon {
    flex: 1;
    max-width: 100px;
    cursor: pointer;
    border-radius: 18px;
    transition: transform .15s ease;
}
.game-icon img {
    border-radius: 18px;
}
.game-icon.selected {
    transform: translateY(-4px);
    box-shadow: 0 0 0 3px var(--orange);
}

/* 社区 */
#community {
    background-image: url("/img/community_bg.png");
}
#community-image-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}
#community-image-list img {
    width: min(78%, 380px);
}
#community-image-1, #community-image-3 {
    margin-left: -50px;
}
#community-image-2 {
    margin-right: -50px;
    margin-top: 24px;
    margin-bottom: 24px;
}

/* 个性化 */
#customization {
    background-image: url("/img/customization_bg.png");
    background-position: center 30%;
}

footer {
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 30px;
    font-size: 0.8125rem;
    color: rgb(255 255 255 / 0.7);
}
footer a {
    color: rgb(255 255 255 / 0.7);
}
footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}
#footer-link {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .game-icon {
        transition: none;
    }
}

@media only screen and (min-width:1400px) {
    .desktop {
        display: block;
    }
    .center {
        width: 26rem;
        margin: 0;
    }
    .text-background {
        background: url("/img/text_bg.png") no-repeat;
        background-position: right;
        background-size: cover;
        height: 100vh;
        padding-left: 700px;
        padding-right: 12%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        font-size: 1.0625rem;
    }
    .align {
        flex-direction: row;
        align-items: center;
        gap: 100px;
    }

    #nav-desktop {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
        width: 100%;
        position: fixed;
        padding-top: 20px;
        padding-bottom: 40px;
        display: flex;
        flex-direction: row;
        column-gap: 36px;
        justify-content: center;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 1.375rem;
        z-index: 2;
    }
    #nav-desktop a:not(#nav-logo):hover {
        color: var(--orange);
    }
    #nav-logo {
        position: absolute;
        top: 5px;
        left: 20px;
        width: 200px;
    }
    #nav-mobile {
        display: none;
    }

    #home {
        justify-content: flex-end;
        gap: 16px;
        padding: 96px 0 64px;
    }
    #home-logo, #home-text {
        display: none;
    }
    #home-text-desktop {
        text-align: center;
    }
    #home-text-desktop h1 {
        margin: 0;
    }
    #home-image img {
        max-width: min(100%, 900px);
    }
    #store-link {
        width: min(560px, 90%);
        gap: 20px;
    }

    .embla__controls {
        width: 210px;
    }
    .embla__dot {
        width: 60px;
        height: 55px;
    }

    #game {
        background-image: url("/img/game_bg_1.png");
    }
    #game-icon-list {
        flex-direction: column;
        width: 130px;
        margin: 0;
    }
    .game-icon {
        max-width: none;
        width: 100%;
    }
    .game-icon.selected {
        transform: translateX(6px);
    }
    #game .text-background {
        background: none;
        padding-left: 0;
    }
    /* 部分游戏背景是浅色，文字加半透明深色底保证可读 */
    #game .text-background .center {
        padding: 28px 32px;
        border-radius: 24px;
        background: rgb(8 18 51 / 0.6);
        backdrop-filter: blur(8px);
    }

    #community, #customization {
        background-position: -450px center;
    }
    /* 文字区占满整行（左侧透明露出插画），图片浮在左半边 */
    #community-image-list {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 45%;
        padding-top: 0;
        gap: 48px;
        z-index: 1;
    }
    #community .text-background {
        flex: 1;
    }
    #community-image-list img {
        width: min(100%, 460px);
    }
    #community-image-1, #community-image-3 {
        margin-left: -120px;
    }
    #community-image-2 {
        margin: 0 -160px 0 0;
    }

    #footer-text {
        display: flex;
        gap: 5px;
    }
}
