/* Layout utilities (replaces Bootstrap on index.html) */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.justify-content-center {
    justify-content: center;
}

.px-0 {
    padding-left: 0;
    padding-right: 0;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

:root {
    --gradient-sky: linear-gradient(180deg, #87ceeb 0%, #4da6ff 50%, #0066ff 100%);
    /* พื้นหลังใช้ไฟล์เดียวทุกภาษา (ไม่มี text) */
    --shared-bg-pc: url('../images/pc-bg.jpg');
    --shared-bg-main: url('../images/main-bg.jpg');
}

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: Tahoma, Verdana, sans-serif;
    background: var(--gradient-sky);
    color: #333;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* NORSE SAGA mark — top-left, absolute within body */
.site-logo {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    line-height: 0;
}

.site-logo img {
    display: block;
    width: 250px;
    height: 250px;
    object-fit: contain;
}

.site-logo:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.95);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Language switcher — top right */
.lang-switcher {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.lang-switcher .lang-switcher-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
}

.lang-switcher button {
    min-width: 2.75rem;
    padding: 0.35rem 0.55rem;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

@media (hover: hover) {
    .lang-switcher button:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.55);
    }
}

.lang-switcher button:active {
    transform: scale(0.96);
}

.lang-switcher button.is-active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
}

.lang-switcher button:focus-visible {
    outline: 2px solid rgba(140, 200, 255, 0.95);
    outline-offset: 2px;
}

/* โหมดเลย์เอาต์แคบ (≤750px): ซ่อนโลโก้มุม — ในเนื้อหามีโลโก้หลักอยู่แล้ว */
@media (max-width: 750px) {
    .site-logo {
        display: none;
    }
}

@media (min-width: 751px) {
    body {
        background-color: #0b3d7a;
        background-image: var(--shared-bg-pc);
        background-repeat: no-repeat;
        background-position: top center;
    }

    body::before {
        display: none;
    }

    .main-content {
        background-color: transparent;
        background-image: none !important;
        background-color: #0066cc00 !important;
        padding-top: 400px !important;
    }

    html[data-ads-lang="th"] .main-content {
        padding-top: 371px !important;
    }

    .countdown-section {
        padding-top: 115px !important;
    }
}

/* Animated background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Narrow viewports: scale entire 750px design proportionally */
.page-scale-shell {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: hidden;
}

.page-design-root {
    flex-shrink: 0;
    width: 750px;
    transform-origin: top center;
}

.page-design-root .main-content {
    max-width: none;
}

/* Main container (750px canvas width set on .page-design-root) */
.main-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding-top: 533px;
    padding-bottom: 40px;
    background-color: #0066cc;
    background-image: var(--shared-bg-main);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}

/* Pre-Register Section */
.pre-register-section {
    margin: 30px 0;
    animation: slideUp 0.8s ease-out 0.3s both;
}

.store-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1rem;
}

.store-badge {
    display: block;
    height: 52px;
    width: auto;
    max-width: 100%;
}

/* CTA — register button + app store badges */
.pre-register-section .col-12 > a,
.store-badges a {
    display: inline-block;
    line-height: 0;
    vertical-align: middle;
    border-radius: 4px;
    transition:
        transform 0.22s ease,
        filter 0.22s ease,
        box-shadow 0.22s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .pre-register-section .col-12 > a:hover,
    .store-badges a:hover {
        transform: scale(1.06);
        filter: brightness(1.12);
        box-shadow: 0 8px 24px rgba(0, 30, 80, 0.35);
    }

    .pre-register-section .col-12 > a:active,
    .store-badges a:active {
        transform: scale(0.98);
        filter: brightness(1.05);
        box-shadow: 0 3px 10px rgba(0, 30, 80, 0.28);
    }

    /** ปุ่มลงทะเบียน — ไม่ให้มีเงาใต้ปุ่มตอน hover/active */
    .pre-register-section .col-12 > a.register-cta:hover,
    .pre-register-section .col-12 > a.register-cta:active {
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pre-register-section .col-12 > a,
    .store-badges a {
        transition: filter 0.15s ease;
    }

    .pre-register-section .col-12 > a:hover,
    .store-badges a:hover {
        filter: brightness(1.1);
    }
}

.pre-register-section .col-12 > a:focus-visible,
.store-badges a:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.95);
    outline-offset: 4px;
}

/* Countdown — artboard 646×170 */
.countdown-section {
    animation: slideUp 0.8s ease-out 0.5s both;
}

.countdown-frame {
    position: relative;
    width: 646px;
    height: 170px;
    margin: 0 auto;
    box-sizing: border-box;
}

.countdown-digit {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 30px;
    text-align: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0;
    color: #f2fdff;
    text-shadow:
        0 0 6px rgba(100, 220, 255, 0.95),
        0 1px 2px rgba(0, 40, 80, 0.85);
}

#cd-day-10 {
    left: 261px;
    top: 113px;
}

#cd-day-01 {
    left: 299px;
    top: 113px;
}

#cd-hrs-10 {
    left: 356px;
    top: 113px;
}

#cd-hrs-01 {
    left: 394px;
    top: 113px;
}

#cd-min-10 {
    left: 451px;
    top: 113px;
}

#cd-min-01 {
    left: 489px;
    top: 113px;
}

#cd-sec-10 {
    left: 546px;
    top: 113px;
}

#cd-sec-01 {
    left: 584px;
    top: 113px;
}

/* Reservation Rewards — fade-in after countdown starts */
.reservation-rewards-section {
    animation: fadeIn 1s ease-out 0.85s both;
}

/* Footer — full viewport width (sibling of scaled canvas, under body) */
.footer-section {
    width: 100%;
    box-sizing: border-box;
    background-color: #000;
    text-align: center;
    padding: 30px 1rem 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    /* margin-top: 30px; */
    line-height: 1.8;
    animation: fadeIn 1s ease-out 1s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Per-image skeleton loading */
@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.img-skeleton-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
    line-height: 0;
}

.img-skeleton-wrap.img-fluid-wrap {
    display: block;
    width: 100%;
}

.img-skeleton {
    display: none;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.28) 45%,
        rgba(255, 255, 255, 0.1) 90%
    );
    background-size: 200% 100%;
    border-radius: 6px;
}

.img-skeleton-wrap.is-loading .img-skeleton {
    display: block;
    animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.img-skeleton-wrap.is-loading img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.img-skeleton-wrap.is-loaded img {
    position: static;
    opacity: 1;
    transition: opacity 0.28s ease;
}

.img-skeleton-wrap.is-error .img-skeleton {
    display: block;
    animation: none;
    background: rgba(255, 255, 255, 0.12);
}

.site-logo .img-skeleton-wrap {
    display: block;
    width: 250px;
    height: 250px;
}

.site-logo .img-skeleton-wrap.is-loading .img-skeleton {
    width: 100%;
    height: 100%;
}

.store-badges .img-skeleton-wrap {
    height: 52px;
}

.store-badges .img-skeleton-wrap.is-loading .img-skeleton {
    height: 100%;
    width: 155px;
}

.img-fluid-wrap.is-loading .img-skeleton {
    width: 100%;
    aspect-ratio: var(--skel-ar, 2 / 1);
    min-height: 40px;
}

@media (prefers-reduced-motion: reduce) {
    .img-skeleton-wrap.is-loading .img-skeleton {
        animation: none;
    }
}
