/* Homepage composition shared by phone, tablet and desktop. */
.page-home { background: #edf2f8; }
.page-home .home-desktop { display: none !important; }
.page-home .home-mobile { display: block; padding-bottom: 100px; background: transparent; }
.page-home .mh { width: 100%; max-width: 1040px; margin: 0 auto; overflow: hidden; color: #071c49; background: #fffefa; }
.page-home .site-header { background: linear-gradient(110deg, #164c80, #092653 80%); box-shadow: none; }
.page-home .header-inner { max-width: 1040px; min-height: 90px; padding: 10px 28px; gap: 16px; }
.page-home .brand { flex-basis: 270px; }
.page-home .brand-logo { width: 270px; }
.page-home .desktop-nav, .page-home .header-search, .page-home .font-button, .page-home .icon-button, .page-home .profile-chip > span:last-child { display: none !important; }
.page-home .header-actions { margin-left: auto; gap: 14px; }
.page-home .coin-chip { display: inline-flex !important; order: 1; padding: 7px 10px; background: #061d52; color: white; border: 1px solid #4179d6; }
.page-home .coin-chip strong { font-size: 19px; }
.page-home .profile-chip { display: flex !important; order: 2; }
.page-home .avatar { width: 45px; height: 45px; }
.page-home .menu-button { display: block; order: 3; }
.page-home .menu-button span { background: white; }
.page-home .mobile-menu { max-width: 1040px; margin: auto; }
.mh-hero { overflow: hidden; }
.mh-banner { display: block; width: 100%; height: auto; }
.mh-cats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: -18px 0 0; padding: 18px 30px 12px; border-radius: 38px 38px 0 0; background: #fffefa; }
.mh-cat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 9px 3px; color: #071c49; background: #fff; border: 1px solid #f0f1f4; border-radius: 28px; box-shadow: 0 6px 18px #183d7010; }
.mh-cat.is-active { color: white; background: linear-gradient(135deg,#152269,#1648c8); border-color: #87aaff; box-shadow: 0 4px 8px #2863d944; }
.page-home .mh-cat .mh-cat-ico { width: 52px; height: 52px; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
.page-home .mh-cat .menu-png-icon { width: 52px; height: 52px; }
.mh-cat small { font-size: 17px; font-weight: 800; }
.mh-block { padding: 12px 32px 4px; }
.mh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.mh-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 26px; font-weight: 800; color: #071c49; }
.mh-head-ico { font-size: 30px; }
.mh-head a { font-size: 17px; font-weight: 700; color: #102957; white-space: nowrap; }
.mh-featured { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.mh-feature { display: block; overflow: hidden; border-radius: 20px; background: transparent; box-shadow: 0 4px 7px #112c4925; }
.mh-feature-image { display: block; width: 100%; height: auto; aspect-ratio: 1.78; object-fit: fill; }
.mh-tiles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 16px; padding: 0 0 14px; }
.mh-tile { position: relative; display: block; padding: 0; border-radius: 18px; background: transparent; }
.page-home .mh-tile .mh-tile-art { display: block; width: 100%; max-width: none; height: auto; aspect-ratio: 1.28; background: transparent; border-radius: 0; box-shadow: none; }
.home-game-png { width: 100%; height: 100%; display: block; object-fit: contain; }
.mh-tile > .home-coming-soon { position: absolute; bottom: 1px; right: 4px; margin: 0; }
.page-home .site-footer { display: none; }
.page-home .bottom-nav { position: fixed; z-index: 99; bottom: 0; left: 50%; right: auto; transform: translateX(-50%); width: min(100%,1040px); display: grid; grid-template-columns: repeat(5,1fr); min-height: 86px; padding: 8px 8px max(8px,env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; border-top: 1px solid #eee; background: #fffffff5; box-shadow: 0 -4px 18px #16325412; }
.page-home .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; font-size: 16px; font-weight: 700; color: #496a99; }
.page-home .bottom-nav a.active { color: #1769ff; }
.page-home .bottom-nav svg, .page-home .bottom-nav .menu-png-icon { width: 36px; height: 36px; }
@media (max-width: 600px) {
 .page-home .header-inner { min-height: 64px; padding: 6px 12px; gap: 8px; }
 .page-home .brand { flex-basis: 175px; }
 .page-home .header-actions { gap: 5px; }
 .page-home .coin-chip { padding: 4px 6px; gap: 4px; }
 .page-home .coin-chip strong { font-size: 14px; }
 .page-home .avatar { width: 32px; height: 32px; }
 .page-home .menu-button { width: 34px; padding: 7px; }
 .mh-cats { gap: 6px; padding: 12px 14px 8px; margin-top: -12px; border-radius: 24px 24px 0 0; }
 .mh-cat { min-height: 70px; border-radius: 18px; padding: 5px 1px; }
 .page-home .mh-cat .mh-cat-ico, .page-home .mh-cat .menu-png-icon { width: 34px; height: 34px; }
 .mh-cat small { font-size: clamp(10px,2.8vw,14px); letter-spacing: -.03em; }
 .mh-block { padding: 8px 14px 3px; }
 .mh-head { margin-bottom: 9px; }
 .mh-head h2 { font-size: 18px; gap: 6px; }
 .mh-head-ico { font-size: 22px; }
 .mh-head a { font-size: 12px; }
 .mh-featured { gap: 8px; }
 .mh-feature { border-radius: 12px; }
 .mh-tiles { gap: 8px; }
 .page-home .bottom-nav { min-height: 70px; border-radius: 24px 24px 0 0; }
 .page-home .bottom-nav a { font-size: 12px; min-height: 50px; }
 .page-home .bottom-nav svg, .page-home .bottom-nav .menu-png-icon { width: 29px; height: 29px; }
}

.mh-promo { margin: 16px 32px 4px; }
.mh-promo a { display: block; overflow: hidden; border-radius: 14px; box-shadow: 0 3px 10px #76222c15; }
.mh-promo img { display: block; width: 100%; height: auto; }
@media (max-width: 600px) { .mh-promo { margin: 12px 14px 4px; } .mh-promo a { border-radius: 9px; } }

/* The new menu badges include their own Thai labels. */
.page-home .mh-cat { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.page-home .mh-cat .mh-cat-ico { width: 100%; height: auto; }
.page-home .mh-cat .menu-png-icon { width: 100%; max-width: 126px; height: auto; aspect-ratio: 0.85; object-fit: contain; }
.page-home .mh-cat.is-active .mh-cat-ico { filter: drop-shadow(0 3px 4px #235ce530); }
.page-home .bottom-nav .menu-png-icon { width: 50px; height: 60px; }
@media (max-width: 600px) {
 .page-home .mh-cats { gap: 8px; }
 .page-home .bottom-nav .menu-png-icon { width: 44px; height: 52px; }
}

.home-loader[hidden] { display: none; }
.home-loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at center, #18477e 0%, #081c3c 60%, #040e22 100%); opacity: 1; transition: opacity .4s ease; }
.home-loader.is-leaving { opacity: 0; }
.loader-content { position: relative; z-index: 1; width: min(76vw, 480px); text-align: center; }
.loader-content img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 28px #eac46230); animation: loader-float 2.2s ease-in-out infinite; }
.loader-content p { margin: 20px 0 0; font-size: 15px; color: #f9e3aa; letter-spacing: .03em; }
.loader-dots { display: flex; justify-content: center; gap: 9px; margin-top: 24px; }
.loader-dots i { width: 8px; height: 8px; border-radius: 50%; background: #f9d579; animation: loader-pulse 1s ease-in-out infinite; }
.loader-dots i:nth-child(2) { animation-delay: .15s; }
.loader-dots i:nth-child(3) { animation-delay: .3s; }
.loader-stars { position: absolute; inset: 0; }
.loader-stars span { position: absolute; top: 50%; left: 50%; color: #ffdc79; font-size: var(--size); text-shadow: 0 0 12px #ffd363; opacity: 0; animation: loader-scatter 1.8s ease-out var(--delay) infinite; }
@keyframes loader-scatter { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 18% { opacity: .9; } 100% { transform: translate(var(--x),var(--y)) rotate(100deg) scale(.6); opacity: 0; } }
@keyframes loader-float { 50% { transform: translateY(-7px); } }
@keyframes loader-pulse { 50% { opacity: .3; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .home-loader *, .loader-stars span { animation: none; } .home-loader { transition: none; } }

.mh-hero > a { display: block; }
#mh-all-title { scroll-margin-top: 110px; }

/* The homepage starts directly with the hero banner. */
.page-home > .site-header { display: none; }
.page-home #mh-all-title { scroll-margin-top: 16px; }

/* Lightweight interactions for menu artwork and game cards. */
.page-home .mh-cat,
.page-home .mh-feature,
.page-home a.mh-tile,
.page-home .mh-promo a,
.page-home .bottom-nav a {
    transition: transform .24s ease, filter .24s ease, box-shadow .24s ease;
    -webkit-tap-highlight-color: transparent;
}
.page-home .mh-cat .menu-png-icon,
.page-home .bottom-nav .menu-png-icon {
    transition: transform .3s cubic-bezier(.2,.8,.3,1.3), filter .3s ease;
    transform-origin: 50% 80%;
}
.page-home .mh-cat { position: relative; }
.page-home .mh-cat::after {
    content: '✦';
    position: absolute;
    top: 5%;
    right: 8%;
    color: #ffd15c;
    font-size: clamp(16px, 2.5vw, 28px);
    text-shadow: 0 0 10px #ffe091;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(.4) rotate(-25deg);
    transition: opacity .2s ease, transform .35s ease;
}
.page-home .mh-feature,
.page-home .mh-promo a { position: relative; }
.page-home .mh-feature::after,
.page-home .mh-promo a::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, #ffffff55 50%, transparent 70%);
    transform: translateX(-120%);
}
@media (hover: hover) and (pointer: fine) {
    .page-home .mh-cat:hover { transform: translateY(-5px); }
    .page-home .mh-cat:hover .menu-png-icon {
        transform: rotate(-5deg) scale(1.07);
        filter: drop-shadow(0 8px 8px #d6a52e55);
    }
    .page-home .mh-cat:hover::after { opacity: 1; transform: translateY(-4px) scale(1) rotate(15deg); }
    .page-home a.mh-tile:hover { transform: translateY(-5px) scale(1.025); filter: drop-shadow(0 8px 7px #173f722b); }
    .page-home .mh-feature:hover { transform: translateY(-4px); box-shadow: 0 10px 20px #183c7130; }
    .page-home .mh-promo a:hover { transform: translateY(-3px); filter: saturate(1.08); }
    .page-home .mh-feature:hover::after,
    .page-home .mh-promo a:hover::after { transform: translateX(120%); transition: transform .65s ease; }
    .page-home .bottom-nav a:hover .menu-png-icon { transform: translateY(-4px) rotate(5deg) scale(1.08); filter: drop-shadow(0 4px 5px #d4a43355); }
}
.page-home .mh-cat:active,
.page-home .mh-feature:active,
.page-home a.mh-tile:active,
.page-home .mh-promo a:active,
.page-home .bottom-nav a:active { transform: scale(.96); }
.page-home .mh-cat:focus-visible,
.page-home .mh-feature:focus-visible,
.page-home a.mh-tile:focus-visible,
.page-home .mh-promo a:focus-visible,
.page-home .bottom-nav a:focus-visible { outline: 3px solid #3178ef; outline-offset: 3px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
    .page-home .mh-cat,
    .page-home .mh-feature,
    .page-home a.mh-tile,
    .page-home .mh-promo a,
    .page-home .bottom-nav a,
    .page-home .menu-png-icon { transition: none !important; transform: none !important; }
    .page-home .mh-cat::after,
    .page-home .mh-feature::after,
    .page-home .mh-promo a::after { display: none; }
}
/* Reading corner appears immediately before recommended games. */
.home-reading-banner{display:block;margin:14px 32px 8px;overflow:hidden;border-radius:22px;box-shadow:0 4px 12px #8c573023}.home-reading-banner img{display:block;width:100%;height:auto}.home-reading-banner:focus-visible{outline:3px solid #eaa719;outline-offset:4px}@media(max-width:600px){.home-reading-banner{margin:10px 14px 6px;border-radius:13px}}
