/* Tablet portrait: frosted rotate hint on PC pages (home / shop / opening). */
.bu-tablet-rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.28);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    pointer-events: auto;
    touch-action: none;
    overscroll-behavior: none;
}

.bu-tablet-rotate-hint[hidden] {
    display: none !important;
}

.bu-tablet-rotate-hint__glass {
    width: min(520px, 94vw);
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.34) 0%,
        rgba(255, 255, 255, 0.12) 55%,
        rgba(255, 255, 255, 0.08) 100%
    );
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    text-align: center;
    color: #fff;
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    backdrop-filter: blur(22px) saturate(1.35);
    pointer-events: none;
}

/* Dark stage — overflow hidden only for radius; inner padding keeps rotate clear. */
.bu-tablet-rotate-hint__stage {
    width: 100%;
    aspect-ratio: 524 / 420;
    margin: 0 auto;
    border-radius: 20px;
    background: #070a12;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* Extra inset so rotated corners / arrow tips never meet the clipped edge. */
    padding: 44px 48px;
}

.bu-tablet-rotate-hint__rail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    width: 100%;
    height: 100%;
    max-width: 440px;
    transform-origin: center center;
}

.bu-tablet-rotate-hint__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.08em;
    flex: 0 0 auto;
    line-height: 1.05;
    font-family: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(1.55rem, 4.2vw, 2.15rem);
    letter-spacing: -0.02em;
    color: #fff;
    text-align: left;
}

.bu-tablet-rotate-hint__line {
    display: block;
}

.bu-tablet-rotate-hint__line--accent {
    color: #ffaf49;
}

.bu-tablet-rotate-hint__divider {
    width: 2px;
    align-self: stretch;
    min-height: 7.2em;
    max-height: 160px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.55);
    flex: 0 0 auto;
}

/* Motion well — sized for diagonal of device (√2) so spin never clips. */
.bu-tablet-rotate-hint__motion {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: min(100%, 240px);
    aspect-ratio: 1 / 1;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.bu-tablet-rotate-hint__spin {
    position: relative;
    width: 52%;
    height: 52%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    opacity: 0;
    transform: rotate(0deg) scale(0.92);
}

.bu-tablet-rotate-hint__device {
    position: relative;
    z-index: 1;
    width: 40%;
    height: auto;
    max-height: 70%;
    color: #ffaf49;
    display: block;
    overflow: visible;
}

.bu-tablet-rotate-hint__arrows {
    position: absolute;
    inset: -14%;
    width: 128%;
    height: 128%;
    color: #fff;
    opacity: 0.95;
    pointer-events: none;
    overflow: visible;
}

/* Beat: text alone → device in → rotate 90° → hold → reset. */
.bu-tablet-rotate-hint__stage--run .bu-tablet-rotate-hint__spin {
    animation: buTabletRotateSpin 5.6s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
}

.bu-tablet-rotate-hint__stage--run .bu-tablet-rotate-hint__rail {
    animation: buTabletRotateRail 5.6s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
}

@keyframes buTabletRotateSpin {
    0%,
    17% {
        opacity: 0;
        transform: rotate(0deg) scale(0.9);
    }
    22% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
    48% {
        opacity: 1;
        transform: rotate(90deg) scale(1);
    }
    72% {
        opacity: 1;
        transform: rotate(90deg) scale(1);
    }
    86%,
    100% {
        opacity: 0;
        transform: rotate(90deg) scale(0.92);
    }
}

/* Subtle group tilt during the rotate beat — kept small so padding still covers it. */
@keyframes buTabletRotateRail {
    0%,
    22% {
        transform: rotate(0deg);
    }
    48%,
    72% {
        transform: rotate(-8deg);
    }
    86%,
    100% {
        transform: rotate(0deg);
    }
}

/* Lock vertical browsing while the portrait gate is up. */
html.bu-tablet-rotate-hint-active,
body.bu-tablet-rotate-hint-active {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

body.bu-tablet-rotate-hint-active {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

@media (orientation: landscape), (pointer: fine) and (hover: hover) {
    body:not(.bu-tablet-rotate-hint-active) .bu-tablet-rotate-hint {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .bu-tablet-rotate-hint__glass {
        padding: 14px;
    }

    .bu-tablet-rotate-hint__stage {
        padding: 28px 24px;
    }

    .bu-tablet-rotate-hint__rail {
        gap: 14px;
    }
}
