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

:root {
    --bg: #0f0f10;
    --panel: #17181b;
    --text: #f5f5f5;
    --muted: #a6a6ad;
    --border: #2a2b30;
    --accent: #ffffff;
}

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

body {
    margin: 0;
    background-color: #0b0d12;
    background-image:
        radial-gradient(900px 520px at 88% -8%, rgba(59, 78, 120, 0.14), rgba(11, 13, 18, 0) 62%),
        radial-gradient(720px 420px at -12% 108%, rgba(44, 58, 93, 0.1), rgba(11, 13, 18, 0) 60%);
    background-repeat: no-repeat;
    color: var(--text);
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 16, 0.92);
    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-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu-center {
    justify-self: center;
}

.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: #f1f5ff;
    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: #f5f8ff;
}

.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 #2b3346;
    border-radius: 12px;
    background: linear-gradient(180deg, #181f2c, #101522);
    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: #c0cbe4;
    margin-bottom: 4px;
}

.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: #fff;
    color: #111;
    font-weight: 600;
}

.countdown-text {
    color: #84f3ac;
    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: var(--border);
    background: #1f2024;
}

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

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

.mobile-bottom-nav {
    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: 24px;
}

.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 #2a2e38;
    border-radius: 12px;
    background: #0d0f14;
    color: #f5f7fb;
    padding: 0 13px;
    outline: none;
}

.app-search-input:focus {
    border-color: #3c69ff;
    box-shadow: 0 0 0 3px rgba(60, 105, 255, 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: #4a5670;
    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(100, 130, 200, 0.15);
}

.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: #5c6578;
    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(250, 204, 21, 0.28),
        0 0 24px rgba(250, 204, 21, 0.08);
}

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

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

.app-card {
    position: relative;
    background: linear-gradient(180deg, #181b22 0%, #12151a 100%);
    border: 1px solid #2a2f3a;
    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: #3d4358;
    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(250, 204, 21, 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, #fffef8 0%, #fff3c9 38%, #ffe08a 100%);
    border: 1px solid rgba(180, 130, 40, 0.45);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.65) inset,
        0 10px 22px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(250, 204, 21, 0.25);
    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, #ffe8a8 0%, #ffd36a 100%);
    border-right: 1px solid rgba(180, 130, 40, 0.35);
    border-bottom: 1px solid rgba(180, 130, 40, 0.35);
    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: #3d2808;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

@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;
    }

    .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.78;
    border-color: #5f4a2b;
    background: linear-gradient(180deg, #1d1a15 0%, #15120f 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: #15944f;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: auto;
}

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

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

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

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

.app-card-note {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #8895b2;
    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: #3c69ff;
    box-shadow: 0 0 0 3px rgba(60, 105, 255, 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;
}

/* ชื่อเรื่อง: บังคับ 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;
}

.drama-loading {
    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-spinner {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(201, 223, 255, 0.22);
    border-top-color: #59a4ff;
    animation: dramaSpin 0.8s linear infinite;
    flex: 0 0 auto;
}

.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: #2f7bff;
    background: #183a73;
    color: #fff;
}

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

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

.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.is-playing {
    border-color: #ff4d5e;
    box-shadow: inset 0 0 0 1px #ff4d5e;
}

.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: calc(76px + env(safe-area-inset-bottom));
    }

    .nav-wrap {
        gap: 14px;
        grid-template-columns: 1fr;
        align-items: center;
        padding: 12px 0;
    }

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

    .mobile-bottom-nav {
        position: fixed;
        left: 50%;
        bottom: calc(10px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        width: min(420px, calc(100% - 20px));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(23, 24, 27, 0.95);
        backdrop-filter: blur(10px);
        z-index: 200;
    }

    .mobile-nav-link {
        flex: 1;
        min-height: 56px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--text);
        text-decoration: none;
        border-radius: 12px;
        border: 1px solid transparent;
        font-size: 0.78rem;
        font-weight: 500;
    }

    .mobile-nav-link.active {
        background: #1f2024;
        border-color: var(--border);
    }

    .mobile-nav-link .nav-icon {
        width: 20px;
        height: 20px;
    }

    .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;
    }
}

/* ---------- หน้าติดต่อ /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;
    }
}
