:root {
    --header-height: 68px;
    --ink: #071012;
    --teal: #0d3035;
    --gold: #d5bd82;
    --ivory: #f3eee2;
    --serif: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--ink);
    color: var(--ivory);
    font-family: var(--serif);
}

.site-header,
.game-shell {
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-loading .site-header,
body.is-loading .game-shell {
    opacity: 0;
}

.site-header,
.guide-portrait,
.hotspot,
.location-label,
.swipe-hint,
.sound-toggle {
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-revealing .guide-portrait,
body.is-revealing .hotspot,
body.is-revealing .location-label,
body.is-revealing .swipe-hint,
body.is-revealing .sound-toggle,
body.is-loading .sound-toggle {
    opacity: 0;
}

.entry-loader {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #e9e2d1;
    background: #061f22;
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transition:
        opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.8s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 1.8s;
}

.entry-loader.is-leaving {
    opacity: 0;
    visibility: hidden;
    filter: blur(18px);
    pointer-events: none;
}

.entry-emblems {
    position: absolute;
    top: 46%;
    left: 50%;
    width: clamp(150px, 21vw, 270px);
    height: clamp(210px, 31vw, 380px);
    opacity: 1;
    transform: translate(-50%, -50%);
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.entry-emblem {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    filter: blur(24px) drop-shadow(0 0 0 rgba(177, 79, 255, 0));
    transform: translateY(42px) scale(1.28);
    transition:
        opacity 1.15s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.entry-emblem.is-active {
    opacity: 0.92;
    filter: blur(0) drop-shadow(0 0 14px rgba(166, 81, 235, 0.38));
    transform: translateY(0) scale(1);
}

.entry-emblem.is-past {
    opacity: 0;
    filter: blur(13px) drop-shadow(0 0 24px rgba(166, 81, 235, 0.26));
    transform: translateY(-24px) scale(0.9);
}

.entry-emblem.is-final {
    opacity: 1;
    animation: final-emblem-glow 1.8s linear forwards;
}

.entry-progress {
    position: absolute;
    z-index: 4;
    top: calc(46% + clamp(118px, 17vw, 205px));
    left: 50%;
    display: grid;
    grid-template-columns: 1fr 3.6em;
    align-items: center;
    gap: 12px;
    width: min(72vw, 360px);
    color: rgba(226, 210, 235, 0.6);
    transform: translateX(-50%);
    transition:
        opacity 0.65s linear,
        transform 0.65s linear;
}

.entry-progress-track {
    position: relative;
    height: 2px;
    overflow: visible;
    background: rgba(216, 194, 226, 0.13);
    box-shadow: 0 0 0 1px rgba(213, 189, 130, 0.08);
}

.entry-progress-track::before,
.entry-progress-track::after {
    content: "◇";
    position: absolute;
    top: 50%;
    color: rgba(213, 189, 130, 0.42);
    font-size: 0.65rem;
    transform: translateY(-52%);
}

.entry-progress-track::before {
    right: calc(100% + 7px);
}

.entry-progress-track::after {
    left: calc(100% + 7px);
}

.entry-progress-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #6e329e, #bb6af2);
    box-shadow: 0 0 8px rgba(181, 102, 255, 0.74);
    transform: scaleX(0);
    transform-origin: left center;
}

.entry-progress-value {
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    letter-spacing: 0.12em;
}

.entry-loader.is-complete .entry-progress-fill {
    background: linear-gradient(90deg, #b566ff, #e0c4ff, #d5bd82);
    box-shadow:
        0 0 10px rgba(181, 102, 255, 0.9),
        0 0 20px rgba(213, 189, 130, 0.5);
}

.entry-loader.is-status-hidden .entry-emblems {
    filter: drop-shadow(0 0 26px rgba(175, 83, 255, 0.72));
}

.entry-loader.is-status-hidden .entry-progress,
.entry-loader.is-welcoming .entry-progress {
    opacity: 0;
    transform: translate(-50%, 8px);
}

.entry-loader.is-welcoming .entry-emblems {
    opacity: 0;
    filter: blur(18px);
}

.entry-particles {
    position: absolute;
    inset: -20%;
    opacity: 0.34;
    background-image:
        radial-gradient(circle, rgba(181, 102, 255, 0.72) 0 1px, transparent 1.8px),
        radial-gradient(circle, rgba(218, 188, 255, 0.48) 0 1px, transparent 1.6px);
    background-position: 0 0, 38px 61px;
    background-size: 92px 92px, 137px 137px;
    animation: entry-particles 9s linear infinite;
}

.magic-emblem {
    position: relative;
    width: clamp(190px, 24vw, 320px);
    aspect-ratio: 1;
    color: rgba(195, 159, 218, 0.2);
    filter: drop-shadow(0 0 4px rgba(148, 61, 224, 0.12));
}

.emblem-ring,
.emblem-cross,
.emblem-moon {
    position: absolute;
    z-index: 2;
}

.emblem-ring {
    border: 1px solid currentColor;
    border-radius: 50%;
}

.emblem-ring::before,
.emblem-ring::after {
    content: "✦";
    position: absolute;
    top: 50%;
    font-size: 0.8rem;
    transform: translateY(-50%);
}

.emblem-ring::before { left: -6px; }
.emblem-ring::after { right: -6px; }
.emblem-ring-outer { inset: 3%; }
.emblem-ring-middle { inset: 17%; transform: rotate(45deg); }
.emblem-ring-inner { inset: 31%; border-style: double; }

.emblem-cross {
    top: 9%;
    left: 49.5%;
    width: 1px;
    height: 82%;
    background: currentColor;
}

.emblem-cross-two {
    transform: rotate(90deg);
}

.emblem-moon {
    inset: 50% auto auto 50%;
    font-size: clamp(2.3rem, 5vw, 4.5rem);
    transform: translate(-50%, -50%);
}

.emblem-fill {
    position: absolute;
    z-index: 3;
    inset: 0;
    background: linear-gradient(to top, #b566ff, #7134bd 64%, #e0c4ff);
    clip-path: inset(100% 0 0);
    mix-blend-mode: screen;
    opacity: 0.92;
    mask: radial-gradient(circle at center, transparent 0 18%, #000 18.5% 19%, transparent 19.5% 31%, #000 31.5% 32%, transparent 32.5% 46%, #000 46.5% 47%, transparent 47.5%);
    filter: blur(1px) drop-shadow(0 0 15px #9e48eb) drop-shadow(0 0 34px rgba(155, 61, 232, 0.8));
}

.entry-loader.is-charging .magic-emblem {
    animation: emblem-awaken 3.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.entry-loader.is-charging .emblem-fill {
    animation: magic-fill 3.8s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.entry-copy {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(94vw, 1100px);
    text-align: center;
    transform: translate(-50%, -50%);
}

.entry-status,
.entry-welcome {
    margin: 0;
    letter-spacing: 0.18em;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.entry-status {
    color: rgba(231, 219, 237, 0.72);
    font-size: clamp(0.72rem, 1.1vw, 0.9rem);
    transform: translateY(clamp(185px, 31vw, 245px));
    animation: status-breathe 1.8s ease-in-out infinite;
}

.entry-welcome {
    position: absolute;
    inset: 50% auto auto 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: max-content;
    max-width: 94vw;
    font-size: 4rem;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.entry-loader.is-welcoming .entry-status {
    opacity: 0;
    transform: translateY(206px);
    animation: none;
}

.entry-loader.is-status-hidden .entry-status {
    opacity: 0;
    transform: translateY(206px);
    animation: none;
}

.entry-loader.is-welcoming .entry-welcome {
    opacity: 1;
}

.entry-welcome span {
    display: inline-block;
    opacity: 0;
    filter: blur(28px);
}

.entry-welcome .welcome-kanji {
    color: #d6c39a;
    font-size: 8rem;
    transform: translate(20px, -10px);
}

.entry-welcome .welcome-gap {
    width: clamp(8px, 2vw, 28px);
}

.entry-loader.is-welcoming .entry-welcome span:not(.welcome-gap) {
    animation: welcome-letter-gather 1s ease-in-out forwards;
}

.entry-loader.is-welcome-settled .entry-welcome span:not(.welcome-gap) {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
}

.entry-welcome span:nth-child(1) { --start-x: -300px; --start-y: -100px; animation-delay: 0.2s !important; }
.entry-welcome span:nth-child(2) { --start-x: 200px; --start-y: 150px; animation-delay: 0.4s !important; }
.entry-welcome span:nth-child(3) { --start-x: -250px; --start-y: 200px; animation-delay: 0.6s !important; }
.entry-welcome span:nth-child(4) { --start-x: 180px; --start-y: -130px; animation-delay: 0.8s !important; }
.entry-welcome span:nth-child(6) { --start-x: -220px; --start-y: -170px; animation-delay: 1.2s !important; }
.entry-welcome span:nth-child(7) { --start-x: 250px; --start-y: 120px; animation-delay: 1.6s !important; }
.entry-welcome span:nth-child(8) { --start-x: -170px; --start-y: 180px; animation-delay: 1.4s !important; }
.entry-welcome span:nth-child(9) { --start-x: 200px; --start-y: -100px; animation-delay: 1.6s !important; }
.entry-welcome span:nth-child(10) { --start-x: -210px; --start-y: -140px; animation-delay: 1.8s !important; }
.entry-welcome span:nth-child(11) { --start-x: 230px; --start-y: 160px; animation-delay: 1.9s !important; }

@keyframes welcome-letter-gather {
    0% {
        opacity: 0;
        filter: blur(100px);
        transform: translate(var(--start-x), var(--start-y)) scale(0.5);
    }
    50% {
        opacity: 0.8;
        filter: blur(30px);
    }
    100% {
        opacity: 1;
        filter: none;
        transform: none;
    }
}

@keyframes welcome-letter-gather-sharp {
    0% {
        opacity: 0;
        filter: none;
        transform: translate(var(--start-x), var(--start-y)) scale(0.7);
    }
    50% {
        opacity: 0.8;
        filter: none;
    }
    100% {
        opacity: 1;
        filter: none;
        transform: none;
    }
}

@keyframes magic-fill {
    0% { clip-path: inset(100% 0 0); opacity: 0.25; }
    72% { opacity: 0.88; }
    100% { clip-path: inset(0 0 0); opacity: 1; }
}

@keyframes emblem-awaken {
    0% { color: rgba(195, 159, 218, 0.14); filter: drop-shadow(0 0 2px transparent); }
    70% { color: rgba(193, 121, 246, 0.72); }
    100% { color: #d9b4ff; filter: drop-shadow(0 0 11px #9e48eb) drop-shadow(0 0 32px rgba(155, 61, 232, 0.65)); }
}

@keyframes final-emblem-glow {
    0% {
        filter:
            blur(0)
            brightness(1)
            drop-shadow(0 0 12px rgba(166, 81, 235, 0.42));
        transform: translateY(0) scale(1);
    }
    55% {
        filter:
            blur(0)
            brightness(1.35)
            drop-shadow(0 0 24px rgba(181, 102, 255, 0.9))
            drop-shadow(0 0 52px rgba(181, 102, 255, 0.54));
        transform: translateY(0) scale(1.025);
    }
    100% {
        filter:
            blur(0)
            brightness(1.18)
            drop-shadow(0 0 18px rgba(213, 189, 130, 0.74))
            drop-shadow(0 0 40px rgba(181, 102, 255, 0.46));
        transform: translateY(0) scale(1);
    }
}

@keyframes status-breathe {
    50% { opacity: 0.5; }
}

@keyframes entry-particles {
    to { transform: translate3d(30px, -70px, 0); }
}

button,
a {
    color: inherit;
    font: inherit;
}

.site-header {
    position: fixed;
    z-index: 50;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: var(--header-height);
    padding: 8px 24px;
    background: rgba(5, 23, 26, 0.92);
    border-bottom: 1px solid rgba(213, 189, 130, 0.26);
    backdrop-filter: blur(12px);
}

.brand {
    text-decoration: none;
    font-size: 1.75rem;
    font-weight: 700;
}

.global-nav {
    display: flex;
    justify-content: center;
    gap: clamp(12px, 1.4vw, 26px);
}

.global-nav > a {
    position: relative;
    isolation: isolate;
    text-decoration: none;
    font-size: clamp(0.68rem, 0.82vw, 0.86rem);
    white-space: nowrap;
    transition:
        color 0.65s ease,
        letter-spacing 1s cubic-bezier(0.16, 1, 0.3, 1),
        text-shadow 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-nav > a::before {
    content: "☾";
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    color: rgba(178, 105, 241, 0.28);
    font-size: 3.6rem;
    opacity: 0;
    filter: blur(12px);
    transform: translate(-50%, -50%) rotate(-32deg) scale(0.28);
    transition:
        opacity 0.85s ease,
        filter 1s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-nav > a:hover,
.global-nav > a:focus-visible {
    color: #e2c9ff;
    letter-spacing: 0.2em;
    text-shadow:
        0 0 7px rgba(190, 122, 247, 0.95),
        0 0 22px rgba(166, 84, 237, 0.72),
        0 0 44px rgba(166, 84, 237, 0.38);
}

.global-nav > a:hover::before,
.global-nav > a:focus-visible::before {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) rotate(0) scale(1);
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
}

.social-links a {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    opacity: 0.72;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-links a:hover,
.social-links a:focus-visible {
    opacity: 1;
    transform: translateY(-2px) scale(1.08);
}

.social-links img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-links-mobile {
    display: none;
}

.sound-toggle {
    position: fixed;
    z-index: 80;
    top: calc(var(--header-height) + 14px);
    right: 16px;
    display: grid;
    width: 50px;
    height: 50px;
    padding: 9px;
    place-items: center;
    align-items: center;
    background: rgba(4, 25, 28, 0.58);
    border: 1px solid rgba(226, 198, 149, 0.3);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        opacity 0.3s ease,
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.3s ease,
        background-color 0.3s ease,
        box-shadow 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.sound-toggle img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.sound-toggle [data-sound-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
    border-color: rgba(226, 198, 149, 0.72);
    background: rgba(17, 42, 45, 0.78);
    box-shadow: 0 0 18px rgba(120, 77, 174, 0.42);
    transform: scale(1.06);
}

.sound-toggle:hover img,
.sound-toggle:focus-visible img {
    filter: drop-shadow(0 0 7px rgba(182, 123, 255, 0.72));
    transform: scale(1.06);
}

.sound-toggle[aria-pressed="true"] {
    opacity: 0.74;
}

.game-shell {
    position: fixed;
    inset: var(--header-height) 0 0;
    overflow: hidden;
}

.scene-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
}

.scene-viewport::-webkit-scrollbar {
    display: none;
}

.lobby-scene {
    position: absolute;
    top: -3%;
    left: 50%;
    width: auto;
    height: 106%;
    aspect-ratio: 1873 / 840;
    min-height: 540px;
    overflow: hidden;
    --look-x: 0px;
    --look-y: 0px;
    --look-rotate: 0deg;
    background: url("/assets/images/backgrounds/mansion-lobby.png") center / 100% 100% no-repeat;
    transform: translate3d(calc(-50% + var(--look-x)), var(--look-y), 0);
    transform-origin: center;
    will-change: transform;
}

.lobby-scene[data-map-current="boundary"] {
    aspect-ratio: 1896 / 830;
    background-image: url("/assets/images/backgrounds/boundary-gallery.png");
}

.lobby-scene[data-map-current="lobby"] .boundary-hotspot,
.lobby-scene[data-map-current="boundary"] .hotspot-news,
.lobby-scene[data-map-current="boundary"] .hotspot-movie,
.lobby-scene[data-map-current="boundary"] .hotspot-world,
.lobby-scene[data-map-current="boundary"] .hotspot-music,
.lobby-scene[data-map-current="boundary"] .hotspot-contract {
    display: none;
}

.lobby-scene::before {
    content: "";
    position: absolute;
    inset: -8%;
    pointer-events: none;
    background:
        radial-gradient(circle at 38% 38%, rgba(255, 202, 105, 0.12), transparent 12%),
        radial-gradient(circle at 74% 50%, rgba(255, 178, 76, 0.1), transparent 10%),
        linear-gradient(110deg, transparent 36%, rgba(153, 222, 229, 0.09) 48%, transparent 59%);
    mix-blend-mode: screen;
    animation: wandering-light 9s ease-in-out infinite alternate;
}

.scene-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(1, 8, 10, 0.18), transparent 25%, transparent 68%, rgba(1, 7, 8, 0.64)),
        radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.5));
}

.hotspot {
    position: absolute;
    display: grid;
    place-items: center;
    width: 74px;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid rgba(239, 218, 160, 0.7);
    border-radius: 50%;
    background: rgba(3, 18, 20, 0.45);
    box-shadow: 0 0 0 8px rgba(213, 189, 130, 0.08), 0 0 30px rgba(213, 189, 130, 0.3);
    cursor: pointer;
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.3s ease,
        box-shadow 0.3s ease;
    animation: pulse 2.8s ease-in-out infinite;
}

.hotspot::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(239, 218, 160, 0.5);
    border-radius: inherit;
}

.hotspot span {
    position: absolute;
    top: calc(100% + 10px);
    padding: 4px 9px;
    background: rgba(3, 18, 20, 0.78);
    font-size: 0.72rem;
    white-space: nowrap;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-selected {
    background: rgba(147, 112, 43, 0.6);
    box-shadow: 0 0 0 12px rgba(213, 189, 130, 0.1), 0 0 58px rgba(213, 189, 130, 0.62);
}

.hotspot-news { left: 10.5%; top: 35%; }
.hotspot-movie { left: 21%; top: 58%; }
.hotspot-world { left: 50%; top: 25%; transform: translateX(-50%); }
.hotspot-music { left: 80%; top: 50%; }
.hotspot-contract { left: 91%; top: 69%; }
.hotspot-violet-portal { left: 8%; top: 43%; }
.hotspot-boundary-archive { left: 50%; top: 43%; transform: translateX(-50%); }
.hotspot-return-lobby { left: 84%; top: 43%; }

.hotspot-world:hover,
.hotspot-world:focus-visible,
.hotspot-world.is-selected,
.hotspot-boundary-archive:hover,
.hotspot-boundary-archive:focus-visible,
.hotspot-boundary-archive.is-selected {
    transform: translateX(-50%);
}

.iris-thought {
    position: absolute;
    z-index: 8;
    left: 58%;
    bottom: 60%;
    width: max-content;
    max-width: min(380px, 36vw);
    min-width: 0;
    padding: 22px 28px;
    color: #28231d;
    background:
        linear-gradient(135deg, rgba(248, 245, 234, 0.97), rgba(225, 218, 199, 0.96));
    border: 1px solid rgba(177, 147, 83, 0.86);
    border-radius: 3px;
    box-shadow:
        inset 0 0 0 5px rgba(177, 147, 83, 0.12),
        0 14px 34px rgba(0, 0, 0, 0.48);
    filter: none;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px);
}

.iris-thought::before {
    content: "";
    position: absolute;
    right: 20%;
    bottom: -11px;
    width: 20px;
    height: 20px;
    background: #e7e0cd;
    border-right: 1px solid rgba(177, 147, 83, 0.86);
    border-bottom: 1px solid rgba(177, 147, 83, 0.86);
    transform: rotate(45deg);
}

.iris-thought p {
    position: relative;
    z-index: 2;
    margin: 0;
    text-align: center;
    font-family: var(--serif);
    font-size: clamp(0.74rem, 0.9vw, 0.94rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.7;
    line-break: strict;
    overflow-wrap: normal;
    word-break: auto-phrase;
    text-wrap: pretty;
}

.thought-dot {
    display: none;
}

.thought-dot-small {
    right: 18%;
    bottom: -34px;
    width: 12px;
    height: 12px;
}

.thought-dot-large {
    right: 23%;
    bottom: -21px;
    width: 20px;
    height: 20px;
}

.iris-thought.is-visible {
    animation: thought-cloud 7s ease-in-out forwards;
}

.iris-thought.is-visible .thought-dot-small {
    animation: thought-dot-pop 7s 0s ease-in-out forwards;
}

.iris-thought.is-visible .thought-dot-large {
    animation: thought-dot-pop 7s 0.18s ease-in-out forwards;
}

.guide-ui {
    position: fixed;
    z-index: 20;
    inset: var(--header-height) 0 0;
    pointer-events: none;
}

.guide-ui::before {
    content: "";
    position: fixed;
    z-index: 3;
    inset: var(--header-height) 0 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0, 5, 7, 0);
    backdrop-filter: blur(0);
    transition: background-color 0.32s ease, backdrop-filter 0.32s ease, visibility 0.32s;
}

.guide-ui.is-confirming::before {
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 5, 7, 0.76);
    backdrop-filter: blur(3px);
}

.guide-portrait {
    position: absolute;
    z-index: 4;
    right: auto;
    left: 65%;
    bottom: 0;
    width: clamp(280px, 38vw, 440px);
    height: clamp(380px, 59vh, 890px);
    overflow: hidden;
    filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.65));
    transform: translateX(-50%);
    cursor: pointer;
}

.guide-portrait.is-entry-hidden {
    opacity: 0;
    pointer-events: none;
}

.guide-portrait:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -8px;
}

.guide-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 17%;
    opacity: 0.92;
    filter: saturate(0.65) contrast(1.08);
    mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
    animation: iris-breathe 4.8s ease-in-out infinite;
}

.dialogue-box {
    position: relative;
    position: absolute;
    z-index: 2;
    right: 5vw;
    bottom: 28px;
    left: 5vw;
    width: 90vw;
    min-height: 210px;
    margin: 0;
    padding: 34px clamp(38px, 5vw, 72px);
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(4, 22, 24, 0.96), rgba(10, 37, 41, 0.93));
    border: 1px solid rgba(213, 189, 130, 0.75);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.55s,
        min-height 0.3s ease,
        background-color 0.3s ease;
}

.dialogue-box.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(72px);
}

.dialogue-box::before,
.dialogue-box::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(213, 189, 130, 0.18);
    pointer-events: none;
}

.dialogue-cancel {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: 20px;
    padding: 7px 12px;
    color: rgba(239, 232, 215, 0.76);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(213, 189, 130, 0.35);
    cursor: pointer;
}

.dialogue-cancel[hidden] {
    display: none;
}

.dialogue-cancel:hover,
.dialogue-cancel:focus-visible {
    color: #071012;
    background: var(--gold);
}

.speaker {
    margin: 0 0 9px;
    color: var(--gold);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
}

.dialogue {
    margin: 0;
    font-size: clamp(1rem, 1.3vw, 1.22rem);
    line-height: 1.85;
}

.dialogue.is-typing::after {
    content: "｜";
    color: var(--gold);
    animation: cursor-blink 0.8s steps(1) infinite;
}

.dialogue-actions {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 28px;
}

.confirmation-detail {
    max-width: 54ch;
    margin: 20px auto 0;
    color: rgba(239, 232, 215, 0.76);
    font-size: 0.9rem;
    line-height: 1.8;
    text-align: left;
}

.confirmation-detail[hidden] {
    display: none;
}

.dialogue-actions[hidden] {
    display: none;
}

.dialogue-actions button {
    min-width: 140px;
    padding: 11px 28px;
    border: 1px solid rgba(213, 189, 130, 0.62);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.dialogue-box.is-confirming {
    position: fixed;
    z-index: 4;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(680px, 90vw);
    min-height: 300px;
    padding: 44px 52px;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.78);
}

.dialogue-box.is-confirming .speaker,
.dialogue-box.is-confirming .continue-mark {
    display: none;
}

.dialogue-actions button:hover,
.dialogue-actions button:focus-visible {
    color: #071012;
    background: var(--gold);
}

.continue-mark {
    position: absolute;
    right: 18px;
    bottom: 10px;
    color: var(--gold);
    font-size: 0.7rem;
    animation: bounce 1.4s infinite;
}

.location-label {
    position: fixed;
    z-index: 15;
    top: calc(var(--header-height) + 28px);
    left: 30px;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 15px 22px 17px;
    background: linear-gradient(90deg, rgba(3, 18, 20, 0.9), rgba(3, 18, 20, 0.5));
    border-left: 3px solid var(--gold);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.location-label span {
    color: var(--gold);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
}

.location-label strong {
    margin-top: 2px;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    letter-spacing: 0.12em;
}

.copyright {
    position: fixed;
    z-index: 15;
    right: 18px;
    bottom: 8px;
    margin: 0;
    font-family: sans-serif;
    font-size: 0.62rem;
    opacity: 0.65;
}

.swipe-hint {
    display: none;
}

.transition-screen {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    visibility: hidden;
    background: #020809;
    opacity: 0;
    transition: 0.65s ease;
}

.transition-screen.is-active {
    visibility: visible;
    opacity: 1;
}

.transition-screen p {
    color: var(--gold);
    letter-spacing: 0.25em;
}

.content-modal {
    position: fixed;
    z-index: 40;
    inset: var(--header-height) 0 0;
    display: grid;
    place-items: start center;
    padding: 24px 5vw;
    background: rgba(0, 5, 7, 0.82);
    backdrop-filter: blur(6px);
    overflow: hidden;
}

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

.content-modal-panel {
    position: relative;
    box-sizing: border-box;
    width: min(900px, 92vw);
    max-height: calc(100dvh - var(--header-height) - 48px);
    overflow: auto;
    padding: clamp(36px, 6vw, 76px);
    color: var(--ivory);
    background:
        linear-gradient(145deg, rgba(7, 30, 33, 0.98), rgba(4, 15, 18, 0.99)),
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(213, 189, 130, 0.025) 35px);
    border: 1px solid rgba(213, 189, 130, 0.72);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.76);
}

.content-modal-panel::before {
    content: "";
    position: absolute;
    inset: 10px;
    pointer-events: none;
    border: 1px solid rgba(213, 189, 130, 0.18);
}

.content-modal-close {
    position: fixed;
    z-index: 41;
    top: calc(var(--header-height) + 16px);
    right: max(18px, 4vw);
    width: 48px;
    height: 48px;
    color: var(--ivory);
    font-size: 1.35rem;
    border: 1px solid rgba(213, 189, 130, 0.68);
    background: rgba(4, 15, 18, 0.96);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
    cursor: pointer;
    transition:
        color 0.35s ease,
        border-color 0.4s ease,
        background-color 0.4s ease,
        box-shadow 0.5s ease,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-modal-close:hover,
.content-modal-close:focus-visible {
    color: #f4e5ff;
    background: rgba(40, 17, 54, 0.98);
    border-color: rgba(190, 124, 236, 0.82);
    box-shadow: 0 0 26px rgba(139, 65, 188, 0.3);
    transform: rotate(6deg) scale(1.06);
}

.content-modal-kicker {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
}

.content-modal h2 {
    margin: 0 0 28px;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.content-modal-body {
    line-height: 2;
}

.content-modal-body p {
    margin: 0 0 1.5em;
}

.lobby-news-list {
    display: grid;
    gap: 8px;
}

.lobby-news-archive {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.lobby-news-item {
    display: grid;
    grid-template-columns: 112px 74px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    color: var(--ivory);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(213, 189, 130, 0.2);
    transition:
        color 0.4s ease,
        background-color 0.5s ease,
        border-color 0.5s ease,
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.7s ease;
}

.lobby-news-item:hover,
.lobby-news-item:focus-visible {
    color: #f5e7ff;
    background: rgba(118, 50, 160, 0.14);
    border-color: rgba(190, 124, 236, 0.6);
    box-shadow: 0 0 26px rgba(139, 65, 188, 0.14);
    transform: translateX(6px);
}

.lobby-news-date {
    color: var(--gold);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.lobby-news-category {
    padding: 2px 6px;
    color: rgba(224, 195, 244, 0.82);
    font-size: 0.62rem;
    text-align: center;
    border: 1px solid rgba(190, 124, 236, 0.35);
}

.lobby-news-item strong {
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.65;
}

.lobby-news-all {
    display: table;
    margin: 28px auto 0;
    padding: 10px 20px;
    color: var(--ivory);
    text-decoration: none;
    border: 1px solid rgba(213, 189, 130, 0.52);
    transition: color 0.4s ease, border-color 0.4s ease, box-shadow 0.6s ease;
}

.lobby-news-all:hover,
.lobby-news-all:focus-visible {
    color: #f5e7ff;
    border-color: rgba(190, 124, 236, 0.78);
    box-shadow: 0 0 26px rgba(139, 65, 188, 0.22);
}

.lobby-news-empty {
    text-align: center;
}

@media (max-width: 620px) {
    .lobby-news-item {
        grid-template-columns: 1fr auto;
        gap: 8px 12px;
        padding: 14px;
    }

    .lobby-news-category {
        justify-self: end;
    }

    .lobby-news-item strong {
        grid-column: 1 / -1;
    }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 7px rgba(213, 189, 130, 0.06), 0 0 22px rgba(213, 189, 130, 0.18); }
    50% { box-shadow: 0 0 0 13px rgba(213, 189, 130, 0.02), 0 0 42px rgba(213, 189, 130, 0.48); }
}

@keyframes bounce {
    50% { transform: translateY(4px); }
}

@keyframes thought-cloud {
    0%, 5% { opacity: 0; transform: translate(-50%, 14px); }
    16%, 72% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

@keyframes thought-dot-pop {
    0%, 5% { opacity: 0; transform: scale(0); }
    11%, 72% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.6); }
}

@keyframes cursor-blink {
    50% { opacity: 0; }
}

@keyframes wandering-light {
    from { opacity: 0.45; transform: translate3d(-1.2%, 0, 0) scale(1); }
    to { opacity: 0.9; transform: translate3d(1.2%, -0.8%, 0) scale(1.03); }
}

@keyframes iris-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.006); }
}

@media (max-width: 900px) {
    :root {
        --header-height: 58px;
    }

    .entry-welcome {
        display: block;
        width: auto;
        height: 80vh;
        max-width: none;
        max-height: 82vh;
        font-size: 4rem;
        line-height: 1.5;
        letter-spacing: 0.2rem;
        writing-mode: vertical-rl;
        text-orientation: upright;
    }

    .entry-welcome span {
        margin-block: 0.08em;
    }

    .entry-welcome .welcome-gap {
        display: block;
        width: 0;
        height: 1.5em;
    }

    .entry-welcome .welcome-kanji {
        position: static;
        display: inline-block;
        font-size: 8rem;
        transform: none;
    }

    .entry-welcome span:nth-child(7) {
        margin-inline-end: -1.1rem;
    }

    .entry-loader.is-welcoming:not(.is-welcome-settled) .entry-welcome span:nth-child(10) {
        animation-name: welcome-letter-gather-sharp;
    }

    .entry-status {
        transform: translateY(185px);
    }

    .entry-loader.is-welcoming .entry-status,
    .entry-loader.is-status-hidden .entry-status {
        transform: translateY(171px);
    }

    .entry-progress {
        top: calc(46% + 124px);
        grid-template-columns: 1fr 3.2em;
        gap: 9px;
        width: min(68vw, 290px);
    }

    .site-header {
        padding: 6px 16px;
    }

    .sound-toggle {
        z-index: 52;
        top: 8px;
        right: 64px;
        width: 42px;
        height: 42px;
        padding: 8px;
        background: transparent;
        border-color: transparent;
        border-radius: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .sound-toggle:hover,
    .sound-toggle:focus-visible {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .content-modal-close {
        top: calc(var(--header-height) + 14px);
        right: 16px;
    }

    .brand {
        font-size: 1.4rem;
    }

    .global-nav {
        position: fixed;
        z-index: 45;
        top: var(--header-height);
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        height: calc(100dvh - var(--header-height));
        padding: 30px 22px;
        background: #05171a;
        border-bottom: 0;
        box-shadow: 0 24px 50px rgba(0, 0, 0, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-18px);
        transition:
            opacity 0.48s cubic-bezier(0.16, 1, 0.3, 1),
            transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
            visibility 0.48s;
    }

    .global-nav a {
        width: min(88vw, 420px);
        padding: 14px 8px;
        text-align: center;
        font-size: 1rem;
        border-bottom: 0;
    }

    .social-links-desktop {
        display: none;
    }

    .global-nav .social-links-mobile {
        display: flex;
        width: auto;
        margin-top: 24px;
        gap: 22px;
    }

    .global-nav .social-links-mobile a {
        width: 28px;
        height: 28px;
        padding: 0;
    }

    .site-header.is-menu-open .global-nav {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .menu-button {
        display: block;
        position: relative;
        z-index: 51;
        min-width: 42px;
        min-height: 42px;
        cursor: pointer;
    }

    .scene-viewport {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        touch-action: pan-x;
    }

    .lobby-scene {
        position: relative;
        flex: 0 0 auto;
        top: 0;
        left: 0;
        width: auto;
        height: 100%;
        background-position: center;
        transform: none !important;
        transition: none;
    }

    .hotspot {
        width: 62px;
    }

    .guide-ui {
        inset: var(--header-height) 0 0;
    }

    .guide-portrait {
        right: auto;
        left: 60%;
        bottom: 0;
        width: auto;
        height: min(40vh, 630px);
        aspect-ratio: 390 / 630;
        transform: translateX(-50%);
    }

    .iris-thought {
        left: 61%;
        bottom: 58%;
        width: max-content;
        max-width: min(300px, 76vw);
        padding: 22px 26px;
    }

    .dialogue-box {
        right: 5vw;
        bottom: 18px;
        left: 5vw;
        width: 90vw;
        min-height: 174px;
        padding: 24px 26px;
    }

    .dialogue-actions {
        gap: 12px;
    }

    .dialogue-actions button {
        min-width: 105px;
    }

    .dialogue-box.is-confirming {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: 88vw;
        min-height: 260px;
        padding: 34px 24px;
    }

    .location-label {
        top: calc(var(--header-height) + 12px);
        left: 12px;
        min-width: 150px;
        padding: 10px 15px 12px;
    }

    .location-label strong {
        font-size: 1.15rem;
    }

    .swipe-hint {
        position: fixed;
        left: 50%;
        bottom: 10px;
        display: block;
        margin: 0;
        padding: 5px 12px;
        color: rgba(255, 255, 255, 0.75);
        background: rgba(0, 0, 0, 0.45);
        font-size: 0.68rem;
        transform: translateX(-50%);
    }

    .copyright {
        display: none;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
