body.adventure-background-active {
    background: #7ccdf4;
}

body.adventure-background-active .screen {
    z-index: 1;
}

.adventure-background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: #8bd8ff;
}

.adventure-background-world {
    position: absolute;
    inset: -6% -10%;
    z-index: 0;
    background-image: url("../assets/images/背景画.png");
    background-repeat: repeat-x;
    background-size: auto 112%;
    background-position: 62% center;
    transform: translate3d(0, 0, 0) scale(1.06);
    animation: adventureWorldWalk 28s linear infinite;
    filter: saturate(1.05) contrast(1.02);
}

.adventure-background-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(circle at 76% 16%, rgba(255, 248, 168, 0.34), transparent 16%),
        radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.14), transparent 26%),
        linear-gradient(90deg, rgba(12, 36, 26, 0.18), transparent 42%, rgba(20, 61, 42, 0.10)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(17, 52, 26, 0.18));
}

.adventure-sun {
    position: absolute;
    top: 8%;
    right: 16%;
    z-index: 1;
    width: 112px;
    height: 112px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, #fffce0 0 18%, #ffe86c 45%, rgba(255, 207, 43, 0.40) 70%, transparent 72%);
    box-shadow:
        0 0 44px rgba(255, 241, 139, 0.72),
        0 0 110px rgba(255, 220, 82, 0.44);
    opacity: 0.86;
    animation: adventureSunPulse 4.8s ease-in-out infinite alternate;
}

.adventure-cloud {
    position: absolute;
    z-index: 2;
    width: var(--cloud-width, 180px);
    height: calc(var(--cloud-width, 180px) * 0.34);
    left: var(--cloud-left, 20%);
    top: var(--cloud-top, 18%);
    opacity: var(--cloud-opacity, 0.62);
    filter: blur(0.2px);
    animation: adventureCloudDrift var(--cloud-speed, 42s) linear infinite;
}

.adventure-cloud::before,
.adventure-cloud::after {
    content: "";
    position: absolute;
    inset: 28% 0 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
        26px -24px 0 10px rgba(255, 255, 255, 0.72),
        76px -30px 0 22px rgba(255, 255, 255, 0.76),
        126px -20px 0 12px rgba(255, 255, 255, 0.68);
}

.adventure-cloud::after {
    inset: 40% 8% 0 18%;
    opacity: 0.36;
    filter: blur(10px);
}

.adventure-canvas {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
}

.adventure-foreground-grass {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 4;
    height: 22%;
    background:
        linear-gradient(180deg, transparent 0 20%, rgba(95, 170, 64, 0.18) 46%, rgba(37, 116, 45, 0.46) 100%),
        repeating-linear-gradient(83deg, transparent 0 12px, rgba(178, 235, 96, 0.20) 13px 15px, transparent 16px 30px),
        repeating-linear-gradient(97deg, transparent 0 15px, rgba(54, 149, 55, 0.30) 16px 18px, transparent 19px 34px);
    transform-origin: center bottom;
    animation: adventureGrassSway 2.7s ease-in-out infinite alternate;
}

.adventure-slime-stage {
    position: absolute;
    left: clamp(70px, 18vw, 260px);
    bottom: clamp(54px, 9vh, 118px);
    z-index: 6;
    width: clamp(122px, 14vw, 190px);
    height: clamp(98px, 11vw, 150px);
    transform-origin: center bottom;
    animation: adventureSlimeHop 1.05s ease-in-out infinite;
}

.adventure-slime {
    position: absolute;
    inset: 8% 0 0;
    border-radius: 48% 52% 42% 45% / 58% 58% 38% 40%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.92) 0 8%, transparent 9%),
        radial-gradient(circle at 23% 33%, rgba(255, 255, 255, 0.52) 0 5%, transparent 6%),
        radial-gradient(circle at 42% 34%, rgba(255, 255, 182, 0.62) 0 16%, transparent 25%),
        linear-gradient(140deg, #d9ff6c 0%, #a4f25a 32%, #65c94a 66%, #3f923b 100%);
    border: 3px solid rgba(28, 92, 34, 0.62);
    box-shadow:
        inset -16px -18px 22px rgba(32, 112, 39, 0.32),
        inset 10px 12px 18px rgba(255, 255, 170, 0.46),
        0 18px 26px rgba(25, 82, 32, 0.24);
    animation: adventureSlimeSquish 1.05s ease-in-out infinite;
}

.adventure-slime::before,
.adventure-slime::after {
    content: "";
    position: absolute;
    top: 48%;
    width: 13%;
    height: 22%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 42% 24%, #fff 0 18%, transparent 19%),
        radial-gradient(circle at 50% 74%, rgba(150, 255, 168, 0.42) 0 18%, transparent 20%),
        #102c25;
}

.adventure-slime::before {
    left: 28%;
}

.adventure-slime::after {
    right: 28%;
}

.adventure-slime-mouth {
    position: absolute;
    left: 42%;
    top: 62%;
    width: 16%;
    height: 11%;
    z-index: 2;
    border-radius: 20% 20% 60% 60%;
    background: #873243;
    box-shadow: inset 0 -5px 0 rgba(255, 126, 141, 0.78);
}

.adventure-slime-shadow {
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: -5%;
    height: 18%;
    border-radius: 50%;
    background: rgba(40, 98, 32, 0.25);
    filter: blur(4px);
    animation: adventureSlimeShadow 1.05s ease-in-out infinite;
}

.adventure-background-screen {
    position: relative;
    min-height: 100vh;
    color: #fff7d6;
    background: transparent;
}

.adventure-background-panel {
    position: absolute;
    left: 28px;
    top: 24px;
    z-index: 8;
    width: min(420px, calc(100vw - 56px));
    padding: 18px 20px;
    border: 1px solid rgba(255, 241, 176, 0.54);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(19, 86, 70, 0.58), rgba(7, 42, 42, 0.52)),
        rgba(7, 35, 35, 0.30);
    box-shadow: 0 18px 40px rgba(2, 20, 21, 0.30);
    backdrop-filter: blur(6px);
}

.adventure-background-panel h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    color: #fff1ad;
    text-shadow: 0 2px 10px rgba(1, 18, 21, 0.46);
}

.adventure-background-panel p {
    margin: 0 0 14px;
    color: rgba(255, 248, 212, 0.9);
    font-weight: 700;
    line-height: 1.5;
}

.adventure-background-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.adventure-background-btn {
    padding: 10px 14px;
    color: #fff7d6;
    border: 1px solid rgba(255, 236, 159, 0.56);
    border-radius: 8px;
    background: rgba(10, 61, 56, 0.72);
    font-weight: 800;
    cursor: pointer;
}

.adventure-background-btn.primary {
    color: #2d1b04;
    background: linear-gradient(180deg, #fff2a8, #e6b241 52%, #a46b1d);
}

.adventure-background-btn:hover {
    filter: brightness(1.08);
}

.adventure-test-btn {
    position: absolute;
    right: 28px;
    bottom: 24px;
    z-index: 5;
    padding: 11px 16px;
    color: #fff4c7;
    border: 1px solid rgba(255, 233, 151, 0.54);
    border-radius: 999px;
    background: rgba(9, 46, 45, 0.66);
    box-shadow: 0 12px 26px rgba(2, 19, 25, 0.34);
    backdrop-filter: blur(5px);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.adventure-test-btn:hover {
    background: rgba(18, 73, 61, 0.82);
    box-shadow: 0 15px 30px rgba(2, 19, 25, 0.42);
    transform: translateY(-1px);
}

@keyframes adventureWorldWalk {
    from {
        background-position: 62% center;
    }
    to {
        background-position: calc(62% + 560px) center;
    }
}

@keyframes adventureCloudDrift {
    from {
        transform: translate3d(-18vw, 0, 0);
    }
    to {
        transform: translate3d(118vw, 0, 0);
    }
}

@keyframes adventureSunPulse {
    from {
        transform: scale(0.98);
        opacity: 0.78;
    }
    to {
        transform: scale(1.04);
        opacity: 0.92;
    }
}

@keyframes adventureGrassSway {
    from {
        transform: skewX(-1.3deg);
    }
    to {
        transform: skewX(1.3deg);
    }
}

@keyframes adventureSlimeHop {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    42% {
        transform: translate3d(0, -12px, 0);
    }
    58% {
        transform: translate3d(0, -6px, 0);
    }
}

@keyframes adventureSlimeSquish {
    0%, 100% {
        transform: scaleX(1.05) scaleY(0.94);
    }
    28% {
        transform: scaleX(0.96) scaleY(1.06);
    }
    58% {
        transform: scaleX(1.02) scaleY(0.98);
    }
}

@keyframes adventureSlimeShadow {
    0%, 100% {
        transform: scaleX(1.12);
        opacity: 0.28;
    }
    42% {
        transform: scaleX(0.72);
        opacity: 0.14;
    }
}

@media (max-width: 760px) {
    .adventure-test-btn {
        right: 16px;
        bottom: 16px;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .adventure-background-panel {
        left: 16px;
        top: 16px;
        padding: 14px 16px;
    }

    .adventure-background-panel h2 {
        font-size: 1.32rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .adventure-background-world,
    .adventure-cloud,
    .adventure-sun,
    .adventure-foreground-grass,
    .adventure-slime-stage,
    .adventure-slime,
    .adventure-slime-shadow {
        animation: none;
    }
}
