@import url("https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap");

:root {
    /* ธีม: สตรีมดำ + ชมพู (เว็บหลัก pp2p) */
    --bg: #0a0a0c;
    --panel: #111114;
    --text: #fdf2f6;
    --muted: #c4b0bb;
    --border: #2a1f2a;
    --accent: #ff85a1;
    --accent-2: #e85b88;
    --accent-soft: rgba(255, 133, 161, 0.12);
    --accent-glow: rgba(255, 100, 140, 0.2);
    /* พื้นหลังหลักของเว็บ (เทียบกับ body) — ใช้ซ้ำกับการ์ดประวัติ */
    --page-bg: #05060a;
    --page-bg-rgb: 5 6 10;
}

* {
    box-sizing: border-box;
    font-family: "Prompt", sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    background-color: var(--page-bg);
    background-image:
        radial-gradient(900px 520px at 88% -8%, rgba(200, 60, 100, 0.18), rgba(5, 6, 10, 0) 60%),
        radial-gradient(720px 480px at -5% 105%, rgba(180, 40, 90, 0.12), rgba(5, 6, 10, 0) 58%),
        radial-gradient(500px 320px at 50% 0%, rgba(255, 120, 160, 0.08), rgba(5, 6, 10, 0) 50%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

/* หน้าเล่น/รายละเอียดใน app.php — แคบลงบนจอใหญ่ กันคอนเทนต์กางเต็มจอเกินไป */
.container.app-page {
    width: min(960px, calc(100vw - 24px));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.container.home-portal-page {
    width: min(1320px, 94vw);
    max-width: 1320px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 120, 150, 0.18);
    background: linear-gradient(180deg, rgba(10, 8, 12, 0.96) 0%, rgba(8, 6, 10, 0.9) 100%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.nav-wrap {
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: auto;
    height: 40px;
    max-width: min(200px, 42vw);
    object-fit: contain;
    display: block;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav-brand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    justify-self: start;
    min-width: 0;
}

.nav-shop-balance {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(80, 20, 40, 0.45), rgba(40, 8, 22, 0.55));
    color: #ffe0ea !important;
    border: 1px solid rgba(255, 120, 150, 0.4);
    box-shadow: 0 0 16px rgba(200, 40, 100, 0.15);
    text-decoration: none !important;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-shop-balance:link,
.nav-shop-balance:visited,
.nav-shop-balance:hover,
.nav-shop-balance:active {
    color: #ffe0ea !important;
    text-decoration: none !important;
}

.nav-shop-balance:hover {
    background: linear-gradient(135deg, rgba(100, 28, 50, 0.55), rgba(60, 12, 32, 0.65));
    box-shadow: 0 0 20px rgba(255, 100, 130, 0.22);
}

.nav-shop-balance .nav-balance-amount {
    color: inherit !important;
    text-decoration: none !important;
}

.nav-balance-coins {
    flex-shrink: 0;
    display: block;
}

.nav-balance-amount {
    font-variant-numeric: tabular-nums;
}

.mobile-nav-wallet .mobile-nav-wallet__amt {
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu-center {
    justify-self: center;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-center-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.nav-menu-center .nav-link {
    white-space: nowrap;
}

/* ปุ่มเมนูเพิ่มเติม (drawer) — ใช้คลาส nav-link ให้หน้าตาเดียวกับลิงก์กลางเดิม */
button.ws-drawer-open.nav-link {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

button.ws-drawer-open.nav-link::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.nav-menu-right {
    justify-self: end;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    color: #ffe4ec;
    padding: 0;
    cursor: pointer;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.user-brief {
    display: grid;
    gap: 1px;
    text-align: left;
    font-size: 0.73rem;
}

.user-brief strong {
    font-size: 0.9rem;
    color: #fff0f4;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 255px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: 0.2s ease;
    border: 1px solid rgba(200, 80, 120, 0.35);
    border-radius: 12px;
    background: linear-gradient(180deg, #1a1216, #100c10);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    padding: 10px;
    z-index: 300;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-line {
    font-size: 0.78rem;
    color: #d4b5c0;
    margin-bottom: 4px;
}

.user-dropdown-history {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 9px;
    text-decoration: none;
    color: #ffbdd2;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(255, 140, 170, 0.35);
    background: rgba(200, 40, 80, 0.12);
}

.user-dropdown-history:hover {
    background: rgba(200, 40, 80, 0.22);
}

.user-dropdown-logout {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    border-radius: 9px;
    text-decoration: none;
    background: linear-gradient(90deg, #ff85a1, #e85b88);
    color: #1a0a0f;
    font-weight: 600;
    border: 0;
}

.user-dropdown-logout:hover {
    filter: brightness(1.06);
}

.countdown-text {
    color: #ffb3c7;
    font-weight: 600;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: 0.2s ease;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(255, 120, 150, 0.4);
    background: rgba(255, 100, 140, 0.1);
    color: #fff;
}
.nav-link.active {
    box-shadow: 0 0 0 1px rgba(255, 100, 140, 0.2);
}

.login-btn {
    border-color: #ffffff3a;
    background: #ffffff;
    color: #111;
    font-weight: 600;
}

.login-btn:hover {
    background: #e8e8e8;
}

.mobile-bottom-nav {
    display: none;
}

/* —— Drawer สไลด์จากขวา (ธีมดำ-ทอง) —— */
.ws-nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
    visibility: hidden;
}

.ws-nav-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

body.ws-drawer-open {
    overflow: hidden;
}

.ws-nav-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.ws-nav-drawer.is-open .ws-nav-drawer__backdrop {
    opacity: 1;
}

.ws-nav-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 340px);
    max-width: 100%;
    background: linear-gradient(180deg, #14151a 0%, #0d0f14 100%);
    border-left: 1px solid rgba(220, 60, 110, 0.28);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    outline: none;
}

.ws-nav-drawer.is-open .ws-nav-drawer__panel {
    transform: translateX(0);
}

.ws-nav-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 14px 14px;
    border-bottom: 1px solid rgba(220, 60, 110, 0.22);
    flex-shrink: 0;
}

.ws-nav-drawer__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ff8fab;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ws-nav-drawer__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #c9ccd6;
    cursor: pointer;
}

.ws-nav-drawer__close:hover {
    color: #ff8fab;
    background: rgba(255, 255, 255, 0.06);
}

.ws-nav-drawer__list {
    padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.ws-nav-drawer__row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 16px;
    margin: 0 8px 4px;
    border-radius: 12px;
    text-decoration: none;
    color: #e8eaef;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ws-nav-drawer__row--static {
    cursor: default;
}

.ws-nav-drawer__row--muted {
    opacity: 0.45;
    pointer-events: none;
}

.ws-nav-drawer__row:hover,
.ws-nav-drawer__row:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.ws-nav-drawer__row.is-active {
    background: rgba(220, 60, 110, 0.12);
    border-color: rgba(255, 160, 190, 0.35);
    color: #ff8fab;
}

.ws-nav-drawer__row--danger {
    margin-top: 8px;
    border-color: rgba(255, 255, 255, 0.06);
}

.ws-nav-drawer__row--danger:hover {
    border-color: rgba(255, 120, 120, 0.25);
    color: #ffb4b4;
}

.ws-nav-drawer__ico {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #d94680;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-nav-drawer__ico svg {
    width: 22px;
    height: 22px;
    display: block;
}

.ws-nav-drawer__row.is-active .ws-nav-drawer__ico,
.ws-nav-drawer__row:hover .ws-nav-drawer__ico {
    color: #ff8fab;
}

.ws-nav-drawer__label {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ws-nowrap {
    white-space: nowrap;
}

/* ปก placeholder (purchased ฯลฯ) — ดำ+ชมพู */
.watch-history-thumb-placeholder--gold {
    background: linear-gradient(145deg, rgba(200, 40, 100, 0.38), rgba(12, 4, 10, 0.98));
    border: 1px solid rgba(255, 120, 160, 0.4);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.purchased-meta-id {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 6px;
}

/* คอม: ยอดเงินอยู่แถบขวาแล้ว — ไม่ซ้ำใน drawer */
@media (min-width: 681px) {
    .ws-nav-drawer__row--hide-when-header-balance {
        display: none !important;
    }

    /* คอมมีลิงก์ติดต่อเราในแถบกลางแล้ว */
    .ws-nav-drawer__row--contact {
        display: none !important;
    }

    /* คอม: ไม่แสดงปุ่มเมนูสามขีด — ใช้ลิงก์ในแถบหลักแทน (selector ยาวกันชนด้วย flex/inline-flex) */
    .site-header .nav-wrap .nav-menu-center button.ws-drawer-open.ws-drawer-open--more,
    .ws-drawer-open--more {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        border: 0 !important;
    }

    .ws-nav-drawer__row--nav-mirror-purchased {
        display: none !important;
    }

    .ws-nav-drawer__panel {
        width: min(400px, 38vw);
    }
}

@media (max-width: 400px) {
    .ws-drawer-open--more > span {
        display: none;
    }
}

.hero {
    margin-top: 40px;
    padding: 44px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, #17181b, #111214);
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.hero p {
    margin: 0 0 24px;
    color: var(--muted);
}

.cta-btn {
    display: inline-block;
    text-decoration: none;
    color: #111;
    background: var(--accent);
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
}

.app-page {
    padding-top: 10px;
}

.app-section {
    padding: 16px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.app-section h1 {
    margin: 0;
}

.app-search-wrap {
    width: min(320px, 100%);
}

.app-search-input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(200, 80, 100, 0.3);
    border-radius: 12px;
    background: #0c080a;
    color: #fff0f4;
    padding: 0 13px;
    outline: none;
}

.app-search-input:focus {
    border-color: #e85b88;
    box-shadow: 0 0 0 3px rgba(255, 100, 140, 0.2);
}

.app-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #7e2d35;
    background: #2a1417;
    color: #ffccd2;
    border-radius: 10px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.app-card-link {
    text-decoration: none;
    display: block;
    height: 100%;
    border-radius: 18px;
    outline: none;
}

.app-card-link:not(.app-card-link-disabled) .app-card {
    transition:
        transform 0.24s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.24s ease,
        border-color 0.24s ease;
}

.app-card-link:not(.app-card-link-disabled):hover .app-card,
.app-card-link:not(.app-card-link-disabled):focus-visible .app-card {
    transform: translateY(-6px);
    border-color: rgba(200, 100, 130, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(200, 90, 120, 0.25);
}

.app-card-link:not(.app-card-link-disabled):hover .app-card--featured,
.app-card-link:not(.app-card-link-disabled):focus-visible .app-card--featured {
    border-color: rgba(255, 140, 170, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 18px 36px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 150, 188, 0.3),
        0 0 24px rgba(200, 40, 100, 0.12);
}

.app-card-link:not(.app-card-link-disabled):focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 100, 140, 0.45);
}

.app-card-link-disabled {
    cursor: not-allowed;
}

.app-card {
    position: relative;
    background: linear-gradient(180deg, #151018 0%, #0c0a0e 100%);
    border: 1px solid rgba(200, 80, 100, 0.22);
    border-radius: 18px;
    padding: 16px 10px;
    text-align: center;
    color: #f2f4fa;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.25);
    min-height: 174px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.app-card--featured {
    border-color: rgba(200, 80, 120, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 22px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 150, 188, 0.12);
}

/* กล่องข้อความพูดมุมขวาบน — แอพยอดนิยม (ดำ+ชมพู) */
.app-card-bubble {
    position: absolute;
    top: -6px;
    right: -12px;
    z-index: 4;
    pointer-events: none;
    max-width: min(118px, 42vw);
    padding: 7px 10px 9px;
    border-radius: 14px 14px 14px 5px;
    background: linear-gradient(165deg, #fff0f5 0%, #ffc0d3 40%, #ff6b9d 100%);
    border: 1px solid rgba(255, 100, 150, 0.55);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.45) inset,
        0 10px 22px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 100, 140, 0.3);
    transform-origin: 85% 100%;
    animation: app-card-bubble-pop 2.6s cubic-bezier(0.45, 0, 0.25, 1.45) infinite;
    will-change: transform;
}

.app-card-bubble::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ffbdd4 0%, #f4729c 100%);
    border-right: 1px solid rgba(200, 60, 100, 0.45);
    border-bottom: 1px solid rgba(200, 60, 100, 0.45);
    border-radius: 0 0 3px 0;
    transform: skewX(-18deg) rotate(42deg);
    box-shadow: -1px 2px 3px rgba(0, 0, 0, 0.12);
}

.app-card-bubble__text {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: #2d0f1a;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.app-card-bubble__star {
    display: none;
}

.app-card-bubble__star-svg {
    display: block;
}

.app-card-bubble__star-shape {
    fill: #ffd0e6;
    stroke: #9f1239;
    stroke-width: 0.55;
    vector-effect: non-scaling-stroke;
}

@keyframes app-card-bubble-star-shine {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 3px rgba(255, 100, 160, 0.7));
    }
    40% {
        transform: scale(1.12) rotate(-8deg);
        filter: drop-shadow(0 0 12px rgba(255, 100, 160, 0.95));
    }
    75% {
        transform: scale(1.04) rotate(6deg);
        filter: drop-shadow(0 0 7px rgba(244, 114, 182, 0.85));
    }
}

@keyframes app-card-bubble-pop {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(-2deg) scale(1);
    }
    18% {
        transform: translate3d(-2px, -10px, 0) rotate(1.5deg) scale(1.06);
    }
    32% {
        transform: translate3d(1px, 2px, 0) rotate(-1deg) scale(0.97);
    }
    46% {
        transform: translate3d(0, -5px, 0) rotate(0.5deg) scale(1.03);
    }
    60% {
        transform: translate3d(0, 0, 0) rotate(-1.2deg) scale(1);
    }
    74% {
        transform: translate3d(2px, -6px, 0) rotate(2deg) scale(1.04);
    }
    88% {
        transform: translate3d(-1px, 1px, 0) rotate(-0.5deg) scale(0.99);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-card-bubble {
        animation: none;
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble__star {
        animation: none !important;
    }

    .app-card-link:not(.app-card-link-disabled) .app-card {
        transition-duration: 0.01ms;
    }

    .app-card-link:not(.app-card-link-disabled):hover .app-card,
    .app-card-link:not(.app-card-link-disabled):focus-visible .app-card {
        transform: none;
    }
}

.app-card-maintenance {
    opacity: 0.9;
    border-color: rgba(200, 80, 100, 0.45);
    background: linear-gradient(180deg, #1a1014 0%, #0f0c0e 100%);
}

.app-card img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
}

.app-card h3 {
    margin: 10px 0 6px;
    font-size: 1.05rem;
    line-height: 1.25;
    min-height: 2.6em;
}

.app-status {
    color: #f8a8c8;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: auto;
}

.app-status-featured {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ff7eb0;
}

.app-status-featured::before {
    content: "★";
    font-size: 0.86rem;
    color: #ff9ed4;
}

.app-status-maintenance {
    color: #fca5a5;
}

.app-maintenance-note {
    margin-top: 4px;
    color: #d4a0b0;
}

.app-card-note {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #b8a0ae;
    min-height: 1.2em;
}

.app-no-results {
    margin: 14px 0 0;
    text-align: center;
    color: var(--muted);
}

.login-page {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 120px);
    position: relative;
}

.login-box {
    width: min(420px, 100%);
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: linear-gradient(180deg, #1a1f2a, #11151d 55%, #0f1219);
    padding: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.login-head-logo {
    width: auto;
    max-width: 140px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #37405a;
    background: #0f1117;
    padding: 6px;
}

.login-box h1 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.login-box p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.user-login-form {
    display: grid;
    gap: 9px;
    margin-top: 8px;
}

.user-login-form label {
    font-size: 0.9rem;
    color: #c0c6d6;
}

.user-login-form input {
    height: 44px;
    border: 1px solid #303748;
    border-radius: 10px;
    background: #0d1118;
    color: #f5f7fb;
    padding: 0 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-login-form input:focus {
    border-color: #e85b88;
    box-shadow: 0 0 0 3px rgba(255, 100, 140, 0.2);
    outline: none;
}

.user-login-form button {
    margin-top: 6px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.user-login-form button:hover {
    filter: brightness(1.05);
}

.login-modal[hidden] {
    display: none;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 16, 0.72);
    backdrop-filter: blur(6px);
}

.login-modal-panel {
    position: relative;
    width: min(420px, calc(100% - 24px));
    margin: 10vh auto 0;
    border: 1px solid #2b3040;
    border-radius: 18px;
    background: linear-gradient(180deg, #1a1f2a, #11151d 55%, #0f1219);
    padding: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #2d3448;
    background: #131a27;
    color: #dce6ff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.api-output {
    margin-top: 10px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #2a2f3a;
    background: #0c0f14;
    color: #d9deea;
    overflow: auto;
    font-size: 0.83rem;
    line-height: 1.45;
}

.dramabox-page {
    border-color: #2a3040;
    
}

.drama-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.drama-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ff4d4f, #e03131);
    color: #fff;
    border: 1px solid #ff6b6b;
    box-shadow: 0 8px 20px rgba(224, 49, 49, 0.35);
    text-decoration: none;
    transition: transform 0.15s ease, filter 0.2s ease;
}

.back-icon-btn svg {
    width: 18px;
    height: 18px;
}

.back-icon-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.drama-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
}

.drama-user-line {
    margin: 2px 0 0;
    color: #a8b1c8;
    font-size: 0.82rem;
}

.endpoint-list {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.endpoint-row {
    border: 1px solid #283042;
    border-radius: 12px;
    background: #111723;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.endpoint-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: #0b9f8d;
    color: #eafffc;
    font-size: 0.72rem;
    font-weight: 700;
}

.endpoint-row code {
    color: #6effee;
    font-size: 0.85rem;
}

.endpoint-label {
    color: #a7b5d2;
    font-size: 0.85rem;
}

.drama-block {
    margin-top: 16px;
}

.drama-block-head h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.drama-card {
    border: 1px solid #273046;
    border-radius: 12px;
    background: #121928;
    overflow: hidden;
}

.drama-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

/* กล่องเล่นวิดีโอในหน้าตอน — ห้ามใช้ .drama-card (overflow:hidden ตัดภาพ + โฟกัสปกการ์ด 3:4) */
.drama-player-shell {
    border: 1px solid #273046;
    border-radius: 12px;
    background: #121928;
    overflow: visible;
}

#episodePlayer {
    width: 100%;
    max-width: 100%;
    max-height: min(85vh, 920px);
    height: auto;
    object-fit: contain;
    background: #000;
    vertical-align: top;
    display: block;
}

/* มือถือ + วิดีโอแนวตั้ง: ยึดความสูงก่อน ลดแถบดำใต้ภาพ (เดิม width:100% ทำให้สูงไม่เต็ม viewport) */
@media (max-width: 768px) {
    #episodePlayer {
        width: auto;
        max-width: 100%;
        height: min(calc(100dvh - 140px), 88vh);
        max-height: min(calc(100dvh - 140px), 88vh);
        margin-left: auto;
        margin-right: auto;
    }
}

.drama-player-shell:fullscreen,
.drama-player-shell:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    background: #000;
    border: none;
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
}

.drama-player-shell:fullscreen #episodePlayer,
.drama-player-shell:-webkit-full-screen #episodePlayer {
    width: auto !important;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0 auto;
    border-radius: 0;
}

/* ชื่อเรื่อง: บังคับ 2 บรรทัด + … (อย่าใส่ max-height คู่กับ line-clamp — บางเครื่องจะตัดบรรทัดผิด) */
.drama-card h3 {
    margin: 0;
    padding: 8px 9px 1px;
    font-size: 0.88rem;
    color: #f0f5ff;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.drama-episode {
    margin: 0 0 10px;
    padding: 0 9px 8px;
    color: #93a4c9;
    font-size: 0.78rem;
    line-height: 1.25;
}

.series-pagination {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ใช้แอตทริบิวต์ [hidden] แทน display:none ถาวร — เดิมมี !important ทำให้แถบโหลดไม่เคยขึ้น */
.series-pagination.drama-loading {
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 8px;
}

.drama-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border: 1px solid #28466f;
    background: linear-gradient(180deg, #0e1f36, #0b172b);
    border-radius: 14px;
    padding: 12px 14px;
}

.drama-loading[hidden] {
    display: none !important;
}

.drama-spinner {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(201, 223, 255, 0.22);
    border-top-color: rgba(122, 176, 255, 0.55);
    animation: dramaLoadingSpin 0.85s linear infinite;
    flex: 0 0 auto;
}

@keyframes dramaLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

.drama-loading-text {
    display: grid;
    gap: 2px;
}

.drama-loading-text strong {
    color: #d9e9ff;
    font-size: 0.88rem;
    line-height: 1.2;
}

.drama-loading-text small {
    color: #9fbde7;
    font-size: 0.75rem;
    line-height: 1.2;
}

.drama-category-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.drama-category-btn {
    border: 1px solid #2d3a54;
    background: #101827;
    color: #cfe0ff;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
}

.drama-category-btn.is-active {
    border-color: #e85b88;
    background: #183a73;
    color: #fff;
}

@keyframes dramaSpin {
    to {
        transform: rotate(360deg);
    }
}

.drama-detail-page {
    margin-top: 10px;
    max-width: 100%;
}

@media (max-width: 680px) {
    .drama-detail-page .drama-hero {
        min-height: min(200px, 34vh);
    }

    .drama-detail-page .drama-summary-card {
        margin-top: 10px;
    }

    .drama-detail-page .drama-block-head {
        margin-top: 12px !important;
    }
}

.wh-resume-boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: grid;
    place-items: center;
    background: rgba(5, 9, 16, 0.94);
    backdrop-filter: blur(5px);
}

.wh-resume-boot-inner {
    text-align: center;
    padding: 28px 24px;
}

.wh-resume-boot-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff3040;
    border-radius: 50%;
    animation: dramaSpin 0.9s linear infinite;
}

.wh-resume-boot-msg {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #e8eefc;
}

.drama-hero {
    position: relative;
    min-height: 300px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #273046;
    background-image:
        linear-gradient(180deg, rgba(5, 8, 16, 0.1) 0%, rgba(5, 8, 16, 0.92) 75%),
        var(--hero-cover);
    background-size: cover;
    background-position: center;
}

.drama-hero-back {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e8efff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(8, 12, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.drama-hero-content {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.drama-hero-poster {
    width: 74px;
    height: 98px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.drama-hero-meta h2 {
    margin: 0 0 8px;
    font-size: 1.9rem;
    line-height: 1.1;
}

.drama-hero-meta p {
    margin: 0;
    color: #d0d8eb;
    font-size: 0.9rem;
}

.drama-hero-actions {
    margin-top: 14px;
    margin-bottom: 14px;
}

.drama-main-play-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: #ff3040;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.drama-main-play-btn .play-icon {
    margin-right: 6px;
}

.drama-summary-card {
    border-radius: 14px;
    padding: 14px;
}

.drama-summary-card h3 {
    margin: 0 0 8px;
}

.drama-summary-card p {
    margin: 0;
    color: #c7d3ea;
    line-height: 1.5;
}

.drama-episode-grid .drama-episode-btn {
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
}

.drama-episode-grid .drama-episode-btn h3 {
    padding: 0;
    margin: 0;
    font-size: 15px;
}

.drama-episode-grid .drama-episode-btn .drama-episode {
    margin: 6px 0 0;
    padding: 0;
    font-size: 10px;
}

.drama-episode-grid .drama-episode-btn--coin {
    border-color: rgba(255, 160, 190, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 160, 190, 0.35);
}

.drama-episode-grid .drama-episode-btn--coin.drama-episode-btn--coin-locked {
    border-color: rgba(248, 113, 113, 0.75);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
    cursor: not-allowed;
}

.drama-episode-grid .drama-episode-btn .drama-episode-coin {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #ffb3c7;
    letter-spacing: 0.02em;
}

.drama-episode-grid .drama-episode-btn .drama-episode-coin--locked {
    display: block;
    margin-left: auto;
    margin-right: auto;
    color: #fecaca !important;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

/* ซีรี่ย์แบบซื้อครั้งเดียวปลดทั้งเรื่อง — ไม่โชว์ราคาซ้ำทุกตอน (กันสับสนว่าตอนละเท่าไหร่) */
.drama-episode-grid .drama-episode-btn .drama-episode-coin--series-only {
    font-size: 10px;
    letter-spacing: 0.03em;
}

.drama-episode-grid .drama-episode-btn.is-playing {
    border-color: #ff4d5e;
    box-shadow: inset 0 0 0 1px #ff4d5e;
}

/* Coin unlock: ปุ่มปลดล็อกทั้งเรื่อง — ชิดขวา ขนาดกะทัดรัด */
.coin-unlock-all-bar {
    margin-top: 0;
    margin-bottom: 12px;
    display: flex;
    justify-content: flex-end;
}

.coin-unlock-all-btn {
    width: auto;
    max-width: min(100%, 280px);
    margin: 0;
    padding: 9px 14px;
    border-radius: 11px;
    border: 1px solid rgba(255, 120, 150, 0.5);
    background: linear-gradient(135deg, #9f1239 0%, #e11d48 48%, #881337 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(200, 40, 80, 0.35);
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.coin-unlock-all-btn:hover {
    filter: brightness(1.06);
}

.coin-unlock-all-btn:active {
    transform: scale(0.98);
}

@media (min-width: 640px) {
    .coin-unlock-all-btn {
        max-width: 300px;
        padding: 10px 16px;
        font-size: 13.5px;
    }
}

/* Bottom sheet: confirm coin / series unlock */
.coin-unlock-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}

.coin-unlock-sheet.is-open {
    visibility: visible;
    pointer-events: auto;
}

.coin-unlock-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.coin-unlock-sheet.is-open .coin-unlock-sheet__backdrop {
    opacity: 1;
}

.coin-unlock-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(88vh, 520px);
    padding: 0 20px 22px;
    padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #1a0f16 0%, #0c080a 45%, #050304 100%);
    border-radius: 22px 22px 0 0;
    border: 1px solid rgba(255, 120, 150, 0.38);
    border-bottom: none;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
    transform: translateY(105%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.coin-unlock-sheet.is-open .coin-unlock-sheet__panel {
    transform: translateY(0);
}

@media (min-width: 720px) {
    .coin-unlock-sheet__panel {
        left: 50%;
        right: auto;
        width: min(440px, calc(100vw - 40px));
        bottom: max(20px, env(safe-area-inset-bottom, 0px));
        border-radius: 20px;
        border: 1px solid rgba(236, 72, 120, 0.38);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
        transform: translate(-50%, 105%);
    }

    .coin-unlock-sheet.is-open .coin-unlock-sheet__panel {
        transform: translate(-50%, 0);
    }
}

.coin-unlock-sheet.is-busy .coin-unlock-sheet__confirm {
    opacity: 0.85;
}

.coin-unlock-sheet__handle {
    width: 40px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
    margin: 10px auto 14px;
}

.coin-unlock-sheet__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e8e0d4;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
    touch-action: manipulation;
}

.coin-unlock-sheet__body {
    text-align: center;
    padding-top: 4px;
}

.coin-unlock-sheet__title {
    margin: 0 36px 8px 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff5f7;
    letter-spacing: 0.02em;
}

.coin-unlock-sheet__sub {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: #c9a8b4;
    line-height: 1.45;
}

.coin-unlock-sheet__price {
    margin: 0 0 20px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffd0de;
    text-shadow: 0 0 24px rgba(255, 120, 150, 0.4);
}

.coin-unlock-sheet__price small {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b8a0a8;
}

.coin-unlock-sheet__confirm {
    width: 100%;
    padding: 15px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 150, 180, 0.5);
    background: linear-gradient(135deg, #d9466f 0%, #f472b0 40%, #be123c 100%);
    color: #fff5f7;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
    touch-action: manipulation;
    box-shadow: 0 6px 24px rgba(200, 40, 100, 0.35);
}

.coin-unlock-sheet__confirm:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.coin-unlock-sheet__cancel {
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: #a89098;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
}

.episode-seq-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.episode-seq-btn {
    min-width: 48px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.episode-seq-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.episode-seq-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.episode-seq-label {
    color: #f5d0dc;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    max-width: min(280px, 100%);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drama-episode-grid .drama-episode-btn.is-watched {
    border-color: #2ecc71;
    box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.7);
    background: linear-gradient(180deg, #15243b, #101a2a);
}

@media (max-width: 680px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-wrap {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 0;
        min-height: 64px;
    }

    .nav-brand-block {
        flex: 1;
        min-width: 0;
    }

    .nav-center-links {
        display: none !important;
    }

    .nav-menu-center {
        display: flex !important;
        margin-left: auto;
        justify-self: unset;
        gap: 0;
    }

    .nav-menu-right {
        display: none;
    }

    /* มือถือ: คืนปุ่มเมนูให้มองเห็นได้ (override กฎซ่อนของเดสก์ท็อป) */
    .site-header .nav-wrap .nav-menu-center button.ws-drawer-open.ws-drawer-open--more {
        display: inline-flex !important;
        visibility: visible !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 10px 14px !important;
        overflow: visible !important;
        pointer-events: auto !important;
        border: 1px solid transparent !important;
    }

    /* ปุ่มเมนูมือถือ: พื้นดำ ข้อความ/ไอคอนขาว ให้เข้ากับธีมหลัก */
    .ws-drawer-open--more.nav-link {
        color: #f5f5f5;
        background: #0a0a0c;
        border-color: rgba(220, 60, 110, 0.45);
    }

    .ws-drawer-open--more.nav-link:hover,
    .ws-drawer-open--more.nav-link:focus-visible {
        color: #fff;
        background: #12141a;
        border-color: rgba(255, 160, 190, 0.55);
    }

    .app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .app-section {
        padding: 12px;
    }

    .app-header {
        flex-direction: column;
        align-items: stretch;
    }

    .app-search-wrap {
        width: 100%;
    }

    .app-card {
        border-radius: 16px;
        padding: 14px 8px;
    }

    .drama-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .endpoint-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .drama-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .drama-hero {
        min-height: 220px;
    }

    .drama-hero-meta h2 {
        font-size: 1.35rem;
    }
}

/* ---------- หน้าแรก (พอร์ทัล + แบนเนอร์ + การ์ดซีรีย์) ---------- */
.home-portal-page {
    /* โปร่ง — ให้เห็นพื้นหลัง body / แบรนด์ที่แอดมินตั้ง */
    background: transparent;
}

.home-portal {
    padding: 8px 0 32px;
    max-width: min(1320px, 94vw);
    margin: 0 auto;
}

.home-portal-search-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 14px;
}

.home-portal-search {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
    min-height: 46px;
    padding: 0 4px 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(236, 72, 120, 0.28);
    background: linear-gradient(180deg, rgba(24, 18, 14, 0.95), rgba(12, 10, 9, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.home-portal-search__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: text;
}

.home-portal-search__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(236, 72, 120, 0.88);
}

.home-portal-search__icon svg {
    display: block;
}

.home-portal-search__divider {
    flex-shrink: 0;
    width: 1px;
    align-self: center;
    height: 24px;
    margin: 0 2px 0 8px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(236, 72, 120, 0.45) 22%,
        rgba(236, 72, 120, 0.45) 78%,
        transparent 100%
    );
}

.home-portal-search__account {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    margin: 0 -2px 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    text-decoration: none;
    color: rgba(236, 72, 120, 0.92);
    outline: none;
    transition: color 0.18s ease, background 0.18s ease;
}

.home-portal-search__account svg {
    display: block;
}

.home-portal-search__account:hover,
.home-portal-search__account:focus-visible {
    color: #ffe8a8;
    background: rgba(236, 72, 120, 0.1);
}

.home-portal-search__account:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(236, 72, 120, 0.35);
    border-radius: 10px;
}

.home-portal-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #f8f0e6;
    font-size: 0.92rem;
    outline: none;
}

.home-portal-search-input::placeholder {
    color: rgba(232, 220, 200, 0.45);
}

/* ---------- แบนเนอร์หน้าแรก (ใหม่): scroll-snap + scrollTo ตาม clientWidth — คอม/มือถือสัดส่วนเดียวกัน ---------- */
.hp-banner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 16px;
    box-sizing: border-box;
    position: relative;
    --hp-banner-safe-top: 5.5%;
    --hp-banner-safe-right: 4.2%;
    --hp-banner-safe-bottom: 16%;
    --hp-banner-safe-left: 4.2%;
}

.hp-banner__chrome {
    position: relative;
    width: 100%;
    aspect-ratio: 1600 / 656;
    overflow: hidden;
    border-radius: clamp(14px, 2.2vw, 22px);
    border: none;
    box-shadow: none;
    background: transparent;
}

.hp-banner__frame {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background: url("../images/banner.png") center center / 100% 100% no-repeat;
}

.hp-banner__empty {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 16px;
    color: rgba(255, 235, 190, 0.9);
    font-weight: 700;
    font-size: clamp(0.9rem, 2.2vw, 1.2rem);
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, rgba(8, 8, 12, 0.45), rgba(6, 6, 10, 0.72));
}

.hp-banner__scroller {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pinch-zoom;
    scrollbar-width: none;
    outline: none;
}

.hp-banner__scroller::-webkit-scrollbar {
    display: none;
}

.hp-banner__slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    align-self: stretch;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hp-banner__safe {
    position: absolute;
    top: var(--hp-banner-safe-top);
    right: var(--hp-banner-safe-right);
    bottom: var(--hp-banner-safe-bottom);
    left: var(--hp-banner-safe-left);
    overflow: hidden;
    border-radius: clamp(22px, 3.5vw, 42px);
    clip-path: inset(0 round clamp(22px, 3.5vw, 42px));
    z-index: 0;
}

.hp-banner__img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.hp-banner__overlay {
    position: absolute;
    top: auto;
    right: var(--hp-banner-safe-right);
    bottom: var(--hp-banner-safe-bottom);
    left: var(--hp-banner-safe-left);
    z-index: 2;
    padding: clamp(12px, 1.8vw, 22px) clamp(12px, 1.8vw, 22px) clamp(18px, 2.6vw, 28px) clamp(56px, 8.4vw, 122px);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    pointer-events: none;
}

.hp-banner__title {
    font-size: clamp(1rem, 2.8vw, 1.45rem);
    color: #fff8ea;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hp-banner__sub {
    font-size: clamp(0.78rem, 2vw, 0.95rem);
    color: rgba(255, 245, 220, 0.78);
}

.hp-banner__btn {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2a1f0a;
    background: linear-gradient(180deg, #ffe6a8, #e8b84a);
    border: 1px solid rgba(255, 230, 160, 0.65);
}

.hp-banner__btn--muted {
    opacity: 0.75;
    cursor: default;
}

.hp-banner__dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 0 12px;
}

.hp-banner__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(236, 72, 120, 0.28);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hp-banner__dot:hover,
.hp-banner__dot:focus-visible {
    background: rgba(236, 72, 120, 0.55);
    outline: none;
}

.hp-banner__dot.is-active {
    background: linear-gradient(180deg, #ffb3c9, #e11d6a);
    transform: scale(1.15);
}

.home-curated-series {
    margin: 8px 0 18px;
}

.home-curated-series .watch-history-head {
    margin-bottom: 10px;
}

.home-curated-series .watch-history-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.home-curated-series .watch-history-title {
    color: #fff0f6;
}

.home-curated-series .watch-history-sub {
    color: var(--muted);
}

.home-curated-series .watch-history-card {
    border-color: rgba(236, 72, 120, 0.4);
}

.home-curated-series .watch-history-card:hover,
.home-curated-series .watch-history-card:focus-visible {
    border-color: rgba(255, 130, 170, 0.65);
    box-shadow: 0 10px 24px rgba(40, 0, 24, 0.45);
}

.home-curated-series .watch-history-drama-title {
    color: #ffe4ef;
}

.home-curated-series .watch-history-meta-line {
    color: rgba(200, 160, 180, 0.9);
}

.home-curated-series .watch-history-ep-pill {
    color: #2d0a14;
    border-color: rgba(255, 150, 180, 0.5);
    background: linear-gradient(180deg, #ffe0ec, #f4729c);
}

.home-curated-series .watch-history-app-pill {
    border-color: rgba(255, 150, 180, 0.4);
    color: #ffd0e4;
    background: rgba(255, 100, 140, 0.12);
}

.home-curated-series .watch-history-progress-bar {
    background: linear-gradient(90deg, var(--accent-2), var(--accent), #ffc0d4);
}

.home-curated-series__icon {
    color: #ff8fab;
    border-color: rgba(255, 120, 160, 0.4);
    background: linear-gradient(180deg, rgba(40, 16, 32, 0.9), rgba(12, 6, 10, 0.98));
}

@media (max-width: 899px) {
    .hp-banner__overlay {
        padding-left: clamp(42px, 10.5vw, 72px);
        padding-bottom: clamp(16px, 3.8vw, 24px);
    }

    .home-curated-series .watch-history-title-small {
        font-size: 1rem;
    }

    .home-curated-series .watch-history-grid {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .home-curated-series .watch-history-title-small {
        font-size: 0.92rem;
    }

    .home-curated-series .watch-history-card-body {
        padding-left: 30px;
        padding-right: 12px;
    }
}

/* บล็อกซ้าย–ขวา (การ์ดซีรีย์ + แอพ) + แถวหัว “ซีรี่ย์แนะนำ” / “แอพทั้งหมด” */
.home-portal-split {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.home-split-head-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(236, 72, 120, 0.12);
    min-width: 0;
}

.home-split-head-cell {
    min-width: 0;
}

.home-split-head-cell--left {
    flex: 0 0 48%;
    max-width: 48%;
}

.home-split-head-cell--right {
    flex: 1 1 0;
    min-width: 0;
}

.home-split-head-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: rgba(255, 248, 238, 0.94);
}

.home-split-head-title__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(236, 72, 120, 0.88);
}

.home-split-head-title__icon svg {
    display: block;
}

.home-split-head-title__text {
    font-weight: inherit;
    color: inherit;
}

.home-main-split {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
}

.home-split-left {
    flex: 0 0 48%;
    max-width: 48%;
    min-width: 0;
}

.home-split-right {
    flex: 1 1 0;
    min-width: 0;
}

.home-portal .home-hero-series--empty {
    background: transparent;
    border-color: rgba(236, 72, 120, 0.28);
}

.home-hero-series {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 18px;
    outline: none;
}

/* การ์ดที่ลิงก์ได้ — hover/focus ให้รู้ว่ากดได้ */
a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty) {
    cursor: pointer;
}

a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty) .home-hero-series-frame {
    transition:
        transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):hover .home-hero-series-frame,
a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):focus-visible .home-hero-series-frame {
    transform: translateY(-5px);
    border-color: rgba(255, 120, 160, 0.52);
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(236, 72, 120, 0.2);
}

/* พอร์ทัล — hover โปสเตอร์เบากว่า ไม่ทึบทับพื้นหลัง */
.home-portal a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):hover .home-hero-series-frame,
.home-portal a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):focus-visible .home-hero-series-frame {
    border-color: rgba(255, 130, 170, 0.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):focus-visible {
    box-shadow: 0 0 0 3px rgba(236, 72, 120, 0.4);
}

@media (prefers-reduced-motion: reduce) {
    a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty) .home-hero-series-frame {
        transition-duration: 0.01ms;
    }

    a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):hover .home-hero-series-frame,
    a.home-hero-series:not(.home-hero-series--nolink):not(.home-hero-series--empty):focus-visible .home-hero-series-frame {
        transform: none;
    }
}

.home-hero-series--nolink {
    cursor: default;
}

.home-hero-series--empty {
    border-radius: 18px;
    border: none;
    padding: 0;
    background: transparent;
}

.home-hero-series-frame {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(236, 72, 120, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 190, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.24),
        0 10px 28px rgba(0, 0, 0, 0.28);
    background: linear-gradient(180deg, rgba(24, 16, 14, 0.85), rgba(8, 7, 11, 0.92));
}

.home-hero-series-frame--empty {
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: min(64vh, 460px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 14px;
}

.home-hero-series-frame--empty p {
    margin: 0;
    color: rgba(255, 236, 198, 0.86);
    font-weight: 700;
    font-size: clamp(0.88rem, 2.1vw, 1.05rem);
}

.home-portal .home-hero-series-frame {
    border-color: rgba(236, 72, 120, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 190, 0.08),
        inset 0 0 0 1px rgba(0, 0, 0, 0.2),
        0 8px 22px rgba(0, 0, 0, 0.24);
}

.home-hero-series-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: min(64vh, 460px);
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
    display: block;
}

.home-hero-series-bottom {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    padding: 14px 12px 12px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88));
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-hero-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #2d0a14;
    background: linear-gradient(90deg, #ffb3c9, #ff4d7d);
}

.home-hero-foot {
    font-size: 0.78rem;
    color: rgba(255, 248, 235, 0.82);
}

.home-series-more {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-series-more-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(240, 220, 200, 0.55);
    margin-bottom: 2px;
}

/* การ์ดซีรีย์เพิ่มเติม — ขนาด/สไตล์เดียวกับการ์ดหลัก (ไม่ใช่ thumbnail เล็ก) */
.home-series-more-item {
    margin-top: 0;
}

.home-series-more-item .home-hero-series-img {
    max-height: none;
}

.app-grid--rail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* กรอบรอบรายการแอพ (คอลัมน์ขวา) — โทนดำ+ชมพู */
.home-portal .home-split-right > .app-grid.app-grid--rail {
    padding: 10px 10px 12px;
    border: 1px solid rgba(236, 72, 120, 0.34);
    border-radius: 14px;
    background: rgba(6, 5, 8, 0.36);
    box-shadow:
        inset 0 1px 0 rgba(255, 200, 220, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* การ์ดแอพแต่ละแถว */
.home-portal .app-grid--rail .app-card.app-card--compact,
.home-portal .app-grid--rail .app-card--compact.app-card--featured,
.home-portal .app-grid--rail .app-card--compact.app-card-maintenance {
    background: linear-gradient(165deg, rgba(48, 20, 36, 0.58), rgba(14, 8, 12, 0.78));
    border: 1px solid rgba(236, 72, 120, 0.4);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 200, 220, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.25),
        0 4px 14px rgba(0, 0, 0, 0.32);
}

.home-portal .app-grid--rail .app-card--compact.app-card--featured {
    border-color: rgba(255, 120, 160, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 200, 220, 0.12),
        inset 0 0 0 1px rgba(255, 100, 140, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(236, 72, 120, 0.18);
}

.home-portal .app-grid--rail .app-card--compact.app-card-maintenance {
    border-color: rgba(200, 100, 120, 0.4);
    background: linear-gradient(165deg, rgba(36, 20, 24, 0.7), rgba(10, 8, 9, 0.84));
}

.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):hover .app-card--compact,
.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):focus-visible .app-card--compact {
    border-color: rgba(255, 140, 180, 0.55);
    background: linear-gradient(165deg, rgba(60, 28, 44, 0.7), rgba(18, 10, 14, 0.84));
    box-shadow:
        inset 0 1px 0 rgba(255, 200, 220, 0.12),
        inset 0 0 0 1px rgba(0, 0, 0, 0.22),
        0 8px 22px rgba(0, 0, 0, 0.38);
}

.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):hover .app-card--featured,
.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):focus-visible .app-card--featured {
    border-color: rgba(255, 130, 170, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 220, 235, 0.16),
        inset 0 0 0 1px rgba(255, 100, 140, 0.12),
        0 10px 26px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 120, 160, 0.2);
}

.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):hover .app-card-maintenance,
.home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):focus-visible .app-card-maintenance {
    border-color: rgba(220, 120, 130, 0.48);
    background: linear-gradient(165deg, rgba(44, 24, 28, 0.75), rgba(12, 9, 10, 0.88));
}

/* รายการแอพคอลัมน์ขวา: ไอคอน | คอลัมน์ข้อความ (ชื่อ + สถานะ + หมายเหตุ) */
.home-portal .app-grid--rail .app-card--compact {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 0;
    min-height: 0;
    padding: 10px 12px;
    text-align: left;
    overflow: hidden;
}

.home-portal .app-grid--rail .app-card--compact > img {
    grid-column: 1;
    grid-row: 1;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    margin: 0;
    object-fit: cover;
    justify-self: center;
}

.home-portal .app-grid--rail .app-card-rail-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.home-portal .app-grid--rail .app-card--featured .app-card-rail-body {
    padding-right: min(76px, 30%);
}

.home-portal .app-grid--rail .app-card-rail-body h3 {
    margin: 0;
    min-height: 0;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    color: #fff0f6;
}

.home-portal .app-grid--rail .app-card-rail-body .app-status {
    margin-top: 0;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.home-portal .app-grid--rail .app-card-rail-body .app-card-note {
    display: block;
    margin-top: 0;
    font-size: 0.72rem;
    line-height: 1.3;
    color: rgba(200, 170, 190, 0.78);
    width: 100%;
}

/* ป้ายแอพเด่น — มุมบนขวาของการ์ดเท่านั้น ไม่มีหางฟองคำพูด (กันทับชื่อ/สถานะ) */
.home-portal .app-grid--rail .app-card--compact .app-card-bubble {
    top: 6px;
    right: 6px;
    left: auto;
    max-width: min(96px, 52%);
    padding: 4px 8px 5px;
    border-radius: 999px;
    transform-origin: 100% 0;
    animation: none;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 4px 12px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 150, 188, 0.2);
}

.home-portal .app-grid--rail .app-card--compact .app-card-bubble::after {
    display: none;
}

.home-portal .app-grid--rail .app-card--compact .app-card-bubble__text {
    font-size: 0.58rem;
    line-height: 1.2;
    text-align: center;
}

/* มือถือ: คอลัมน์แอพแคบ — ย่อการ์ด + โทนดำ+ชมพู */
@media (max-width: 899px) {
    .home-portal {
        padding-left: max(10px, env(safe-area-inset-left, 0px));
        padding-right: max(10px, env(safe-area-inset-right, 0px));
    }

    .home-portal .home-main-split {
        gap: 8px;
    }

    .home-portal .home-split-head-row {
        gap: 8px;
        margin-bottom: 8px;
        padding-bottom: 8px;
        align-items: center;
    }

    .home-portal .home-split-head-title {
        font-size: 0.78rem;
        font-weight: 700;
        gap: 6px;
    }

    .home-portal .home-split-head-title__icon svg {
        width: 16px;
        height: 16px;
    }

    .home-portal .home-split-head-cell--left {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .home-portal .home-portal-split {
        gap: 0;
    }

    .home-portal .home-split-left {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .home-portal .home-split-right {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc(50% + 2px);
        overflow-x: hidden;
    }

    .home-portal .home-hero-series-img,
    .home-portal .home-series-more-item .home-hero-series-img {
        max-height: min(54vh, 380px);
    }

    .home-portal .home-split-right > .app-grid.app-grid--rail {
        padding: 6px 6px 8px;
        border-radius: 12px;
    }

    .home-portal .app-grid--rail {
        gap: 7px;
    }

    .home-portal .app-grid--rail .app-card--compact {
        grid-template-columns: 22px minmax(0, 1fr);
        column-gap: 6px;
        padding: 6px 7px 7px;
        min-height: 0;
        border-radius: 11px;
        background: linear-gradient(165deg, rgba(44, 20, 36, 0.9), rgba(12, 8, 10, 0.96));
        border: 1px solid rgba(255, 100, 150, 0.42);
        box-shadow:
            inset 0 1px 0 rgba(255, 200, 220, 0.1),
            inset 0 0 0 1px rgba(0, 0, 0, 0.28),
            0 5px 14px rgba(0, 0, 0, 0.38);
    }

    .home-portal .app-grid--rail .app-card--featured {
        border-color: rgba(255, 120, 170, 0.55);
        box-shadow:
            inset 0 1px 0 rgba(255, 200, 220, 0.12),
            inset 0 0 0 1px rgba(255, 100, 140, 0.12),
            0 6px 16px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 120, 160, 0.2);
        background: linear-gradient(165deg, rgba(56, 24, 40, 0.92), rgba(16, 8, 12, 0.98));
    }

    .home-portal .app-grid--rail .app-card-maintenance {
        background: linear-gradient(165deg, rgba(36, 20, 22, 0.9), rgba(12, 8, 8, 0.95));
        border-color: rgba(200, 100, 120, 0.48);
        box-shadow:
            inset 0 1px 0 rgba(255, 180, 200, 0.06),
            inset 0 0 0 1px rgba(0, 0, 0, 0.28),
            0 5px 14px rgba(0, 0, 0, 0.36);
    }

    .home-portal .app-grid--rail .app-card--compact > img {
        width: 22px;
        height: 22px;
        border-radius: 7px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .home-portal .app-grid--rail .app-card-rail-body h3 {
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1.2;
        color: #ffe4ef;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        word-break: break-word;
    }

    .home-portal .app-grid--rail .app-card-rail-body .app-status {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        margin-top: 0;
        padding: 1px 6px 2px;
        border-radius: 999px;
        font-size: 0.56rem;
        font-weight: 700;
        border: 1px solid rgba(255, 130, 170, 0.4);
        background: rgba(8, 4, 8, 0.7);
        color: #f9a8c8;
    }

    .home-portal .app-grid--rail .app-card-rail-body .app-status::before {
        content: "◆";
        font-size: 0.45rem;
        line-height: 1;
        color: #ff8fab;
        opacity: 0.9;
    }

    .home-portal .app-grid--rail .app-card-rail-body .app-status-featured {
        color: #ff8fab;
        border-color: rgba(255, 150, 190, 0.5);
    }

    .home-portal .app-grid--rail .app-card-rail-body .app-status-maintenance {
        color: #f9a8a8;
        border-color: rgba(248, 150, 160, 0.45);
    }

    .home-portal .app-grid--rail .app-card-rail-body .app-card-note {
        font-size: 0.58rem;
        line-height: 1.25;
        color: rgba(200, 170, 190, 0.7);
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble {
        top: 3px;
        right: 3px;
        max-width: min(64px, 62%);
        padding: 2px 5px 3px;
        border-radius: 999px;
    }

    /* มือถือ: ดาว + แบดจ์ โทนชมพู แทนข้อความ "แอพกำลังนิยม" */
    .home-portal .app-grid--rail .app-card--compact .app-card-bubble--with-star {
        animation: none;
        padding: 4px 6px 5px;
        max-width: none;
        min-width: 28px;
        background: radial-gradient(120% 100% at 32% 18%, #fff0f6, #ffb3d0 45%, #db2777 90%);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.45) inset,
            0 4px 12px rgba(0, 0, 0, 0.32),
            0 0 0 1px rgba(255, 100, 150, 0.4);
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble--with-star .app-card-bubble__text {
        display: none;
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble__star {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1;
        animation: app-card-bubble-star-shine 2.4s ease-in-out infinite;
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble__star-svg {
        width: 15px;
        height: 15px;
    }

    .home-portal .app-grid--rail .app-card--compact .app-card-bubble:not(.app-card-bubble--with-star) .app-card-bubble__text {
        font-size: clamp(9px, 2.5vw, 11px);
        line-height: 1.12;
        letter-spacing: -0.01em;
    }

    .home-portal .app-grid--rail .app-card--featured .app-card-rail-body {
        padding-right: min(44px, 24%);
    }

    .home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):hover .app-card--compact,
    .home-portal .app-grid--rail .app-card-link:not(.app-card-link-disabled):focus-visible .app-card--compact {
        transform: translateY(-2px);
    }

    .home-series-more-label {
        font-size: 0.68rem;
    }

    .home-series-more {
        gap: 14px;
    }
}

/* เลิกบังคับความสูงการ์ดใหญ่ของหน้าแอพทั่วไป — เฉพาะรางพอร์ทัล */
.home-portal .app-grid--rail .app-card.app-card--compact {
    min-height: 0;
}

@media (min-width: 900px) {
    .home-split-head-row {
        display: grid;
        grid-template-columns: minmax(250px, 36%) 1fr;
        gap: 28px;
        align-items: center;
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    .home-split-head-cell--left,
    .home-split-head-cell--right {
        flex: unset;
        max-width: none;
    }

    .home-split-head-cell--right {
        padding-left: 22px;
        border-left: 1px solid rgba(236, 72, 120, 0.12);
    }

    .home-main-split {
        display: grid;
        grid-template-columns: minmax(250px, 36%) 1fr;
        gap: 28px;
    }

    .home-split-left,
    .home-split-right {
        flex: unset;
        max-width: none;
        min-width: 0;
    }

    .home-hero-series-img {
        max-height: none;
        min-height: min(56vh, 500px);
    }

    .home-series-more-item .home-hero-series-img {
        min-height: min(56vh, 500px);
    }

    .home-split-right {
        border-left: 1px solid rgba(236, 72, 120, 0.12);
        padding-left: 22px;
    }
}

@media (min-width: 1100px) {
    .home-split-head-row {
        grid-template-columns: minmax(280px, 38%) 1fr;
        gap: 32px;
    }

    .home-main-split {
        grid-template-columns: minmax(280px, 38%) 1fr;
        gap: 32px;
    }
}

/* ---------- หน้าติดต่อ /contact ---------- */
.contact-page {
    position: relative;
    min-height: calc(100vh - 72px);
    padding: 28px 0 48px;
    overflow: hidden;
}

.contact-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(520px 280px at 50% -5%, rgba(99, 132, 255, 0.18), transparent 65%),
        radial-gradient(400px 220px at 100% 40%, rgba(6, 199, 85, 0.1), transparent 55%),
        radial-gradient(380px 200px at 0% 80%, rgba(24, 119, 242, 0.08), transparent 50%);
}

.contact-inner {
    position: relative;
    z-index: 1;
}

.contact-hero {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 40px;
}

.contact-hero-logo-wrap {
    display: inline-flex;
    padding: 20px 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    margin-bottom: 22px;
}

.contact-hero-logo {
    width: auto;
    height: clamp(56px, 12vw, 88px);
    max-width: min(280px, 80vw);
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.contact-eyebrow {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b9ccf;
}

.contact-title {
    margin: 0 0 14px;
    font-size: clamp(1.65rem, 4.5vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(120deg, #fff 0%, #c8d4f5 45%, #9eb4e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.contact-lead {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #b4bcd0;
}

.contact-social {
    max-width: 520px;
    margin: 0 auto;
}

.contact-section-title {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e6f0;
    text-align: center;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.contact-card:hover,
.contact-card:focus-visible {
    transform: translateY(-4px) scale(1.01);
    outline: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

.contact-card--fb {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbf 50%, #0a4a9e 100%);
}

.contact-card--fb:hover,
.contact-card--fb:focus-visible {
    border-color: rgba(255, 255, 255, 0.35);
}

.contact-card--line {
    background: linear-gradient(135deg, #06c755 0%, #05a347 50%, #048c3c 100%);
}

.contact-card--line:hover,
.contact-card--line:focus-visible {
    border-color: rgba(255, 255, 255, 0.35);
}

.contact-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.contact-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.contact-card-label {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.contact-card-hint {
    font-size: 0.88rem;
    opacity: 0.92;
}

.contact-card-arrow {
    flex-shrink: 0;
    font-size: 1.25rem;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.contact-card:hover .contact-card-arrow,
.contact-card:focus-visible .contact-card-arrow {
    transform: translateX(4px);
}

.contact-empty {
    margin: 12px 0 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 200, 100, 0.08);
    border: 1px solid rgba(255, 200, 100, 0.25);
    color: #e8d5b0;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.contact-empty code {
    font-size: 0.82em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #ffd89a;
}

@media (prefers-reduced-motion: reduce) {
    .contact-card {
        transition: none;
    }

    .contact-card:hover,
    .contact-card:focus-visible {
        transform: none;
    }

    .contact-card:hover .contact-card-arrow,
    .contact-card:focus-visible .contact-card-arrow {
        transform: none;
    }
}

/* --- Watch history (ดูต่อ/ประวัติการดู) --- */
.watch-history-page .watch-history-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 14px;
    margin-top: 30px;
}

.watch-history-head-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(255, 100, 150, 0.28), rgba(120, 30, 70, 0.1));
    border: 1px solid rgba(255, 150, 180, 0.4);
    color: #ff9ec0;
}

.watch-history-head-icon svg {
    width: 17px;
    height: 17px;
}

.watch-history-title {
    margin: 0 0 3px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff0f4;
    letter-spacing: 0.01em;
}

.watch-history-title-small {
    font-size: 1.2rem;
    margin-bottom: 1px;
}

.watch-history-sub {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.watch-history-head-second {
    margin-top: 22px;
}

.watch-history-empty {
    text-align: center;
    padding: 26px 14px;
    color: rgba(220, 180, 200, 0.9);
    font-size: 0.92rem;
    line-height: 1.6;
}

.watch-history-empty-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    opacity: 0.9;
}

.watch-history-empty-secondary {
    padding: 16px 10px;
    font-size: 0.86rem;
    opacity: 0.85;
}

.watch-history-grid,
.watch-history-grid-secondary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
}

.watch-history-card {
    /* สีเดียวกับพื้นหลังเว็บ — เฟดปกใช้ rgb(var(--wh-fade)) ละลายเข้ากัน */
    --wh-fade: var(--page-bg-rgb);
    isolation: isolate;
    position: relative;
    display: grid;
    /* ปกกว้างขึ้น — ความสูงคุมแยกด้านล่าง ไม่ให้การ์ดยาวเกิน */
    grid-template-columns: minmax(136px, 60%) 1fr;
    grid-template-rows: minmax(0, auto);
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    border: 1px solid rgba(255, 100, 140, 0.2);
    background: rgb(var(--wh-fade));
    overflow: hidden;
    min-height: 88px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.watch-history-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(100deg, rgba(255, 100, 150, 0.12) 0%, rgba(0, 0, 0, 0) 55%);
    pointer-events: none;
}

.watch-history-card::after {
    content: none;
}

.watch-history-card:hover,
.watch-history-card:focus-visible {
    border-color: rgba(255, 150, 190, 0.6);
    box-shadow: 0 10px 28px rgba(50, 0, 32, 0.48);
    transform: translateY(-1px);
    outline: none;
}

.watch-history-card-complete {
    border-color: rgba(255, 100, 140, 0.2);
    background: rgb(var(--wh-fade));
}

.watch-history-thumb-wrap {
    position: relative;
    overflow: hidden;
    margin-right: -1px;
    min-height: 88px;
    height: 100%;
    align-self: stretch;
    background: rgb(var(--wh-fade));
    z-index: 1;
}

/* เฟดปก — ชั้นเดียว ไล่ยาวนุ่ม ละลายเข้าสีการ์ด (ไม่ซ้อน mask กับ overlay) */
.watch-history-thumb-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgb(var(--wh-fade) / 0) 0%,
        rgb(var(--wh-fade) / 0) 10%,
        rgb(var(--wh-fade) / 0.02) 24%,
        rgb(var(--wh-fade) / 0.08) 38%,
        rgb(var(--wh-fade) / 0.2) 51%,
        rgb(var(--wh-fade) / 0.38) 62%,
        rgb(var(--wh-fade) / 0.58) 72%,
        rgb(var(--wh-fade) / 0.76) 80%,
        rgb(var(--wh-fade) / 0.9) 88%,
        rgb(var(--wh-fade) / 0.97) 94%,
        rgb(var(--wh-fade)) 100%
    );
}

.watch-history-thumb-wrap::after {
    content: none;
}

.watch-history-thumb,
.watch-history-thumb-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    /* เก็บรอยตัดที่ขอบขวาของรูปไม่ให้เห็นเป็นเส้น */
    -webkit-mask-image: linear-gradient(
        90deg,
        #000 0%,
        #000 82%,
        rgba(0, 0, 0, 0.9) 88%,
        rgba(0, 0, 0, 0.55) 93%,
        rgba(0, 0, 0, 0.2) 97%,
        transparent 100%
    );
    mask-image: linear-gradient(
        90deg,
        #000 0%,
        #000 82%,
        rgba(0, 0, 0, 0.9) 88%,
        rgba(0, 0, 0, 0.55) 93%,
        rgba(0, 0, 0, 0.2) 97%,
        transparent 100%
    );
}

.watch-history-thumb-placeholder {
    background: linear-gradient(135deg, #1a0e16, #080408);
    box-shadow: inset 0 0 0 1px rgba(255, 100, 130, 0.12);
}

.watch-history-card-body {
    position: relative;
    /* ทับเข้าโซนเฟดของปก — ตัดขอบตารางระหว่างคอลัมน์ให้ไม่เห็นรอยต่อ */
    margin-left: -52px;
    padding: 10px 12px 10px 60px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
    z-index: 3;
    background: rgb(var(--wh-fade));
}

/* เฟดย้อนจากฝั่งข้อความไปฝั่งปก เพื่อให้รอยต่อหายเหมือนรูปอ้างอิง */
.watch-history-card-body::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -64px;
    width: 88px;
    pointer-events: none;
    z-index: -1;
    background: linear-gradient(
        90deg,
        rgb(var(--wh-fade) / 0) 0%,
        rgb(var(--wh-fade) / 0.16) 28%,
        rgb(var(--wh-fade) / 0.44) 52%,
        rgb(var(--wh-fade) / 0.74) 74%,
        rgb(var(--wh-fade)) 100%
    );
}

.watch-history-title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    margin-bottom: 6px;
}

.watch-history-drama-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff5f8;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.watch-history-meta-line {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
    font-size: 0.78rem;
    color: rgba(200, 165, 188, 0.92);
}

.watch-history-meta-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #e891b0;
    background: rgba(255, 100, 140, 0.1);
    border: 1px solid rgba(255, 150, 180, 0.25);
}

.watch-history-meta-icon svg {
    width: 11px;
    height: 11px;
}

.watch-history-meta-times {
    letter-spacing: 0.02em;
}

.watch-history-ep-pill {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    color: #2a0816;
    border: 1px solid rgba(255, 150, 180, 0.45);
    background: linear-gradient(180deg, rgba(255, 220, 235, 0.95), rgba(255, 140, 180, 0.7));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.watch-history-app-line {
    margin: 0 0 4px;
}

.watch-history-app-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 100, 140, 0.12);
    border: 1px solid rgba(255, 150, 180, 0.32);
    color: #ffd6e8;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.watch-history-progress {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 100, 140, 0.12);
    overflow: hidden;
    margin-top: 5px;
}

.watch-history-progress-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent) 45%, #ffd0e4 100%);
    min-width: 0;
    box-shadow: 0 0 10px rgba(255, 100, 140, 0.25);
}

@media (max-width: 640px) {
    .watch-history-grid,
    .watch-history-grid-secondary {
        gap: 8px;
    }

    .watch-history-card {
        /* ปกกว้างขึ้น ความสูงคุมไม่ให้ยาว */
        grid-template-columns: minmax(118px, 62%) 1fr;
        min-height: 78px;
        border-radius: 12px;
    }

    .watch-history-thumb-wrap {
        min-height: 78px;
        width: 100%;
    }

    .watch-history-card-body {
        margin-left: -30px;
        padding: 5px 8px 5px 36px;
        justify-content: center;
    }

    .watch-history-card-body::before {
        left: -40px;
        width: 58px;
    }

    .watch-history-title-row {
        margin-bottom: 3px;
        gap: 4px;
        align-items: flex-start;
    }

    .watch-history-drama-title {
        font-size: 0.86rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .watch-history-ep-pill {
        font-size: 0.56rem;
        font-weight: 600;
        padding: 2px 6px;
        line-height: 1.2;
    }

    .watch-history-meta-line {
        margin: 0 0 3px;
        font-size: 0.68rem;
        gap: 5px;
    }

    .watch-history-meta-icon {
        width: 14px;
        height: 14px;
    }

    .watch-history-meta-icon svg {
        width: 9px;
        height: 9px;
    }

    .watch-history-app-line {
        margin: 0 0 2px;
    }

    .watch-history-app-pill {
        font-size: 0.58rem;
        padding: 2px 7px;
    }

    .watch-history-progress {
        height: 2px;
        margin-top: 5px;
    }

    .watch-history-sub {
        font-size: 0.79rem;
    }
}

/* Tablet: 2 cards per row */
@media (min-width: 900px) {
    .watch-history-grid,
    .watch-history-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* Desktop: 3 cards per row */
@media (min-width: 1200px) {
    .watch-history-grid,
    .watch-history-grid-secondary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .watch-history-card {
        grid-template-columns: minmax(128px, 58%) 1fr;
        min-height: 90px;
    }

    .watch-history-thumb-wrap {
        min-height: 90px;
    }
}
