.mobile-home,
.mobile-home-menu-links,
.home-video-list-small {
    display: none;
}

.desktop-home-shell,
.home-video-list:not(.home-video-list-small) {
    display: contents;
}

.mobile-home-active .desktop-home-shell,
.mobile-home-active .navbar-custom,
.mobile-home-active .menuMobile {
    display: none;
}

.mobile-home-active .mobile-home-menu-links {
    display: block;
}

.mobile-home-active #sidebar {
    top: 0;
    height: 100dvh;
    padding-top: calc(16px + env(safe-area-inset-top));
    overflow-y: auto;
    transform: translateX(-100%);
}

.mobile-home-active #sidebar.show {
    transform: translateX(0);
}

.mobile-home-active #sidebarOverlay {
    position: fixed;
    inset: 0;
    z-index: 1027;
    display: none;
    background: rgb(0 0 0 / 70%);
}

.mobile-home-active #sidebar.show + #sidebarOverlay {
    display: block;
}

.mobile-home-active [data-cookie-banner] {
    top: calc(56px + env(safe-area-inset-top));
    bottom: auto;
    z-index: 1026;
    pointer-events: none;
}

.mobile-home-active [data-cookie-banner] .showBanner {
    pointer-events: auto;
}

.mobile-home-active {
    overflow: hidden;
}

.mobile-home-opening {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    color: #fff;
    background: rgb(18 18 23 / 97%);
    font-size: 1.2rem;
    font-weight: 650;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 140ms ease, visibility 0s linear 140ms;
}

.mobile-home-opening.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
}

.mobile-home-opening img {
    display: block;
    width: auto;
    max-width: min(140px, 55vw);
    max-height: 68px;
    object-fit: contain;
}

.mobile-home-opening [hidden] {
    display: none !important;
}

.mobile-home-opening-progress {
    width: 48px;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(255 255 255 / 20%);
    visibility: hidden;
}

.mobile-home-opening.is-waiting .mobile-home-opening-progress {
    visibility: visible;
}

.mobile-home-opening-progress::before {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: #bbaeef;
}

.mobile-home-opening.is-waiting .mobile-home-opening-progress::before {
    animation: mobile-home-opening-slide .8s ease-in-out infinite alternate;
}

@keyframes mobile-home-opening-slide {
    to { transform: translateX(150%); }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-home-opening {
        transition: none;
    }

    .mobile-home-opening.is-waiting .mobile-home-opening-progress::before {
        animation: none;
    }
}

.mobile-home-active .mobile-home {
    --home-header: calc(56px + env(safe-area-inset-top));
    --home-controls-bottom: 2px;
    --home-panel-bottom: var(--mobile-primary-space, calc(58px + env(safe-area-inset-bottom)));
    position: fixed;
    inset: 0;
    z-index: 1025;
    display: block;
    overflow: hidden;
    color: #fff;
    background: #121217;
}

.mobile-home[data-full] {
    --home-controls-bottom: 0px;
}

.mobile-home [hidden] {
    display: none !important;
}

.mobile-home-header {
    position: absolute;
    z-index: 3;
    inset: 0 0 auto;
    min-height: var(--home-header);
    padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    background: linear-gradient(180deg, rgb(16 16 22 / 74%), transparent);
}

.mobile-home-tabs {
    display: flex;
    justify-content: center;
    gap: clamp(2px, 2vw, 8px);
}

.mobile-home-tabs button,
.mobile-home-icon {
    border: 0;
    color: inherit;
    background: transparent;
    min-height: 44px;
}

.mobile-home-tabs button {
    position: relative;
    min-width: 0;
    padding-inline: clamp(4px, 2vw, 10px);
    font-size: clamp(.75rem, 3.7vw, 1rem);
    white-space: nowrap;
    color: rgb(255 255 255 / 80%);
}

.mobile-home-tabs button[aria-pressed="true"] {
    color: #fff;
    font-weight: 700;
}

.mobile-home-tabs button[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    inset: auto 25% 1px;
    height: 2px;
    border-radius: 2px;
    background: #d7c9ff;
}

.mobile-home-icon {
    width: 44px;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}

.mobile-home-episode-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-home-player,
.mobile-home-shorts,
.mobile-home-videos {
    position: absolute;
    inset: 0 0 var(--home-panel-bottom);
}

.mobile-home-player {
    touch-action: none;
    isolation: isolate;
    background: #000;
}

.mobile-home-player > video,
.mobile-home-player > img,
.mobile-home-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mobile-home-player > video,
.mobile-home-player > img {
    object-fit: contain;
}

.mobile-home-player > [data-standby] {
    visibility: hidden;
    pointer-events: none;
}

.mobile-home-player > img,
.mobile-home-shade {
    pointer-events: none;
}

.mobile-home-shade {
    background: linear-gradient(0deg, rgb(14 13 20 / 90%), rgb(14 13 20 / 45%) 21%, transparent 52%);
}

.mobile-home-controls {
    position: absolute;
    inset: auto max(12px, env(safe-area-inset-right)) var(--home-controls-bottom) max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px 12px;
}

.mobile-home-description {
    grid-column: 1;
}

.mobile-home-description h1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: clamp(1.15rem, 5vw, 1.55rem);
    font-weight: 700;
    overflow-wrap: anywhere;
    margin: 0 0 9px;
}

.mobile-home-description p {
    margin: 0;
    color: #edeaf6;
    font-size: .875rem;
}

.mobile-home-progress {
    --progress: 0%;
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    height: 22px;
    appearance: none;
    background: transparent;
    touch-action: pan-x;
}

.mobile-home[data-full] .mobile-home-progress {
    padding-block-start: 10px;
}

.mobile-home-progress::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5d8ff var(--progress), rgb(255 255 255 / 34%) var(--progress));
}

.mobile-home-progress::-webkit-slider-thumb {
    width: 8px;
    height: 8px;
    margin-top: -2.5px;
    border-radius: 50%;
    appearance: none;
    background: #eee7ff;
}

.mobile-home-progress::-moz-range-track {
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5d8ff var(--progress), rgb(255 255 255 / 34%) var(--progress));
}

.mobile-home-progress::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    background: #eee7ff;
}

.mobile-home-primary {
    grid-column: 1;
    min-height: 46px;
    border: 1px solid rgb(221 205 255 / 34%);
    border-radius: 12px;
    background: rgb(48 37 69 / 88%);
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.mobile-home-primary:disabled {
    opacity: .7;
}

.mobile-home-primary[data-mobile-all] {
    border-color: rgb(255 255 255 / 28%);
    background: rgb(255 255 255 / 25%);
    text-shadow: 0 1px 3px rgb(18 13 25 / 78%);
}

.mobile-drama-playback-footer {
    position: absolute;
    z-index: 3;
    inset: auto 0 0;
    box-sizing: border-box;
    height: var(--home-panel-bottom);
    display: flex;
    align-items: center;
    padding: 6px max(12px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid rgb(255 255 255 / 12%);
    background: #16151b;
}

.mobile-drama-episodes {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgb(222 207 255 / 20%);
    border-radius: 18px;
    background: #282431;
    color: #f5f0ff;
    font-size: .9375rem;
    font-weight: 650;
    text-align: start;
}

.mobile-drama-episodes i {
    flex: none;
    color: #d7c9ff;
}

.mobile-drama-episodes:focus-visible {
    outline: 2px solid #d7c9ff;
    outline-offset: 2px;
}

.mobile-home-arrows button:disabled {
    opacity: .45;
}

.mobile-home-arrows {
    position: absolute;
    right: 66px;
    bottom: 110px;
}

.mobile-home-arrows .mobile-home-icon,
.mobile-home-center {
    border-radius: 50%;
    background: rgb(20 19 29 / 72%);
}

.mobile-home-actions {
    --home-action-gap: clamp(14px, 2dvh, 16px);
    position: absolute;
    inset-inline-end: 0;
    bottom: 51px;
    display: grid;
    width: 54px;
    justify-items: center;
    gap: var(--home-action-gap);
}

.mobile-home-actions .mobile-home-reactions {
    display: grid;
    gap: var(--home-action-gap);
}

.mobile-home-actions .mobile-home-reactions[hidden] {
    display: none;
}

.mobile-home-actions .mobile-home-reactions button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    width: 52px;
    min-height: 50px;
    padding: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: .75rem;
    line-height: 1.15;
    text-shadow: 0 1px 4px #171221;
}

.mobile-home-actions i {
    font-size: 1.9375rem;
    line-height: 1;
    text-shadow: 0 1px 5px #171221;
}

.mobile-home-sound i {
    font-size: 1.25rem;
}

.mobile-home-actions [data-mobile-share] {
    width: 52px;
    min-height: 50px;
}

@media (max-height: 600px) {
    .mobile-home-actions {
        --home-action-gap: 10px;
        bottom: 39px;
    }
}

@media (max-height: 420px) {
    .mobile-home-actions {
        --home-action-gap: 6px;
        bottom: 29px;
    }

    .mobile-home-actions .mobile-home-reactions button,
    .mobile-home-actions .mobile-home-icon {
        min-height: 40px;
    }

    .mobile-home-actions .mobile-home-reactions button {
        gap: 1px;
        padding-block: 0;
        font-size: .6875rem;
    }

    .mobile-home-actions i {
        font-size: 1.5625rem;
    }

    .mobile-home-sound i {
        font-size: 1.1875rem;
    }
}

.mobile-home-actions[data-rail-aligned] {
    inset-block-start: var(--action-rail-top);
    inset-block-end: auto;
    /* Each row starts at a button center. The last row anchors mute. */
    grid-template-rows: repeat(3, var(--action-rail-step)) 0;
    gap: 0;
    pointer-events: none;
}

[data-rail-aligned] .mobile-home-reactions:not([hidden]) {
    display: contents;
}

.mobile-home-actions[data-rail-aligned] button {
    grid-column: 1;
    align-self: start;
    height: min(52px, var(--action-rail-step));
    min-height: 0;
    padding-block: 0;
    transform: translateY(-50%);
    pointer-events: auto;
}

[data-rail-aligned] [data-drama-like] {
    grid-row: 1;
}

[data-rail-aligned] [data-drama-open-comments] {
    grid-row: 2;
}

[data-rail-aligned] [data-mobile-share] {
    grid-row: 3;
}

.mobile-home-actions[data-rail-aligned] [data-mobile-mute] {
    --action-mute-height: min(52px, var(--action-rail-step), var(--action-mute-room));
    grid-row: 4;
    height: var(--action-mute-height);
}

[data-rail-aligned] .mobile-home-reactions i {
    font-size: clamp(0px, calc(var(--action-rail-step) - 16px), 1.9375rem);
}

[data-rail-aligned] [data-mobile-share] i {
    font-size: clamp(0px, calc(var(--action-rail-step) - 5px), 1.9375rem);
}

[data-rail-aligned] [data-mobile-mute] i {
    font-size: clamp(0px, calc(var(--action-mute-height) - 5px), 1.25rem);
}

.mobile-home-center {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    z-index: 1;
}

.mobile-home-message {
    position: absolute;
    inset: 35% 16px auto;
    z-index: 2;
    text-align: center;
}

.mobile-home-shorts,
.mobile-home-videos {
    inset-block-start: var(--home-header);
}

.mobile-home-shorts iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #121217;
}

.mobile-home-videos {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 16px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.mobile-home-videos .home-video-list {
    display: contents;
}

.mobile-home-picker {
    width: min(100%, 34rem);
    max-height: 68dvh;
    margin: auto auto 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 20px 20px 0 0;
    color: #fff;
    background: #252131;
}

.mobile-home-picker::backdrop {
    background: rgb(0 0 0 / 65%);
}

.mobile-home-search > form {
    padding-block: 8px;
}

.mobile-home-search input {
    min-width: 0;
    font-size: 1rem;
}

.mobile-home-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-home-picker-head h2 {
    font-size: 1rem;
    margin: 0;
}

.mobile-drama-picker {
    position: fixed;
    inset: auto 0 0;
    width: min(100%, 35rem);
    max-width: 100%;
    max-height: 75vh;
    max-height: 75dvh;
    margin: 0 auto;
    padding: 0 max(12px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: hidden;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: #fbf9ff;
    color: #252033;
    color-scheme: light;
}

.mobile-drama-picker[open] {
    display: flex;
    flex-direction: column;
}

.mobile-drama-picker::backdrop {
    background: rgb(9 7 15 / 58%);
}

.mobile-drama-picker-header {
    flex: none;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 58px;
}

.mobile-drama-picker-header h2 {
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 1.0625rem;
    font-weight: 700;
}

.mobile-drama-picker button {
    border: 0;
    color: inherit;
}

.mobile-drama-picker button:focus-visible {
    outline: 2px solid #6643ab;
    outline-offset: -3px;
}

.mobile-drama-picker-close {
    width: 44px;
    min-height: 44px;
    background: transparent;
    font-size: 1.125rem;
}

.mobile-drama-picker-groups {
    display: flex;
    flex: none;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-bottom: 10px;
}

.mobile-drama-picker-groups button {
    flex: none;
    min-width: 56px;
    min-height: 44px;
    padding-inline: 10px;
    border-radius: 8px;
    background: transparent;
    color: #645c72;
    font-size: .875rem;
    font-weight: 650;
    white-space: nowrap;
}

.mobile-drama-picker-groups [aria-pressed="true"] {
    background: #eee6fc;
    color: #452a76;
}

.mobile-drama-picker-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.mobile-drama-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(6px, 2vw, 9px);
}

.mobile-drama-picker-grid button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    height: clamp(44px, 13vw, 68px);
    padding: 0 2px;
    border-radius: 12px;
    background: #efedf4;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 620;
}

.mobile-drama-picker-grid .bi {
    display: none;
    font-size: .75em;
}

.mobile-drama-picker-grid [aria-current="true"] {
    background: #e7d9ff;
    color: #4c2b83;
    font-weight: 750;
}

.mobile-drama-picker-grid [aria-current="true"] .bi {
    display: inline;
}

@media (max-width: 319px) {
    .mobile-drama-picker-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
