.panel-game {
    position: relative;
    height: 100%;
}

.panel-intro {
    display: none;
    height: 100%;
    padding: 20px 16px 36px;
}

.panel-intro.active {
    display: grid;
    place-items: center;
}

.intro-shell {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 22px;
    padding: 24px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 248, 230, 0.96), rgba(255, 207, 226, 0.96));
}

.intro-scene {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    border: 4px solid var(--ui-blue);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.75), transparent 16%),
        linear-gradient(180deg, #79d1ff 0%, #c9f1ff 35%, #fce8a4 100%);
}

.intro-tree {
    position: absolute;
    left: 50%;
    bottom: -40px;
    width: 180px;
    height: 120%;
    transform: translateX(-50%);
    border: 5px solid #4c2c14;
    border-radius: 90px;
    background: repeating-linear-gradient(90deg, var(--tree-bark) 0, var(--tree-bark) 18px, var(--tree-shadow) 18px, var(--tree-shadow) 32px);
}

.intro-tree::before,
.intro-tree::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 82px;
    border-radius: 999px;
    background: radial-gradient(circle at 50% 30%, #77ce72, var(--leaf-dark));
}

.intro-tree::before {
    top: 110px;
    right: 120px;
}

.intro-tree::after {
    top: 220px;
    left: 120px;
}

.intro-card {
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 18px 8px;
}

.intro-card .overlay-title,
.intro-card .overlay-text,
.intro-card .overlay-lead {
    text-align: left;
}

.intro-countdown {
    display: inline-grid;
    place-items: center;
    width: 120px;
    height: 120px;
    margin-top: 12px;
    border: 4px solid var(--ui-blue);
    border-radius: 50%;
    background: linear-gradient(180deg, #fff7cb, #ffbfd8);
    color: var(--ui-red);
    font-size: 3rem;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.intro-actor {
    position: absolute;
    width: 140px;
    height: 200px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.intro-head {
    position: absolute;
    top: 0;
    left: 28px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 4px solid var(--ui-blue);
    overflow: hidden;
    background: linear-gradient(180deg, #ffd7bd, #ffbf99);
}

.intro-head::before {
    content: "";
    position: absolute;
    inset: -8px 6px 24px;
    border-radius: 50% 50% 34% 34%;
    background: #2d1d1a;
    z-index: 1;
}

.intro-body {
    position: absolute;
    left: 22px;
    bottom: 10px;
    width: 90px;
    height: 118px;
    border: 4px solid var(--ui-blue);
    border-radius: 28px 28px 18px 18px;
    background: linear-gradient(180deg, #1f2937, #4b5563);
}

.character-anni .intro-head::before {
    background: #8a4a33;
}

.character-anni .intro-body {
    background: linear-gradient(180deg, #ef7f8f, #f3b4a8);
}

.intro-climber {
    left: calc(50% - 180px);
    bottom: 36px;
}

.intro-partner-wrap {
    position: absolute;
    right: 42px;
    top: 42px;
    width: 220px;
    height: 220px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.intro-partner-wrap .speech-bubble {
    top: 0;
    left: auto;
    right: 0;
    transform: none;
}

.intro-partner {
    right: 42px;
    top: 70px;
}

.intro-scene[data-scene="bottom"] .intro-partner-wrap {
    opacity: 0;
    transform: translateY(-40px) scale(0.85);
}

.intro-scene[data-scene="top"] .intro-climber,
.intro-scene[data-scene="countdown"] .intro-climber {
    opacity: 0.2;
    transform: scale(0.92);
}

.intro-scene[data-scene="countdown"] .intro-partner-wrap {
    transform: translateY(8px) scale(1.02);
}

.world {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sky-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.75), transparent 18%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.camera {
    position: absolute;
    inset: 0;
}

.tree {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(420px, 62vw);
    height: 100%;
    transform: translateX(-50%);
}

.tree-trunk {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 160px;
    height: 100%;
    transform: translateX(-50%);
    border-radius: 80px;
    background:
        repeating-linear-gradient(90deg,
            var(--tree-bark) 0,
            var(--tree-bark) 16px,
            var(--tree-shadow) 16px,
            var(--tree-shadow) 28px);
    border: 5px solid #4c2c14;
}

.branch-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.branch {
    position: absolute;
    width: 170px;
    height: 22px;
    border-radius: 20px;
    background: #6b3d1e;
    border: 3px solid #4c2c14;
}

.branch::after {
    content: "";
    position: absolute;
    width: 108px;
    height: 64px;
    bottom: 10px;
    border-radius: 60px;
    background: radial-gradient(circle at 50% 30%, #77ce72, var(--leaf-dark));
}

.branch.left {
    right: 184px;
}

.branch.left::after {
    right: 26px;
}

.branch.right {
    left: 184px;
}

.branch.right::after {
    left: 26px;
}

.player {
    position: absolute;
    left: 50%;
    bottom: 92px;
    width: 112px;
    height: 150px;
    transform: translateX(-50%);
    transition: left 0.22s ease, bottom 0.22s ease, transform 0.18s ease;
    z-index: 3;
}

.player.lane-left {
    left: calc(50% - 150px);
}

.player.lane-right {
    left: calc(50% + 150px);
}

.player.is-jumping {
    transform: translateX(-50%) translateY(-22px) rotate(-6deg);
}

.player.is-hit {
    filter: saturate(0.2);
}

.sprite-face,
.sprite-body,
.partner {
    position: absolute;
}

.sprite-face {
    top: 2px;
    left: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--ui-blue);
    overflow: hidden;
    background: linear-gradient(180deg, #ffd7bd, #ffbf99);
}

.sprite-body {
    left: 20px;
    bottom: 6px;
    width: 68px;
    height: 94px;
    border-radius: 22px 22px 14px 14px;
    border: 3px solid var(--ui-blue);
    background: linear-gradient(180deg, #1f2937, #4b5563);
}

.player.character-anni .sprite-body,
.partner.character-anni {
    background: linear-gradient(180deg, #ef7f8f, #f3b4a8);
}

.player.character-anni .sprite-face::before,
.partner.character-anni::before {
    background: #8a4a33;
}

.sprite-face::before,
.partner::before {
    content: "";
    position: absolute;
    inset: -6px 4px 18px;
    border-radius: 50% 50% 34% 34%;
    background: #2d1d1a;
    z-index: 1;
}

.partner {
    bottom: 0;
    left: 0;
    width: 92px;
    height: 120px;
    border-radius: 26px 26px 16px 16px;
    border: 3px solid var(--ui-blue);
    background: linear-gradient(180deg, #1f2937, #4b5563);
    overflow: visible;
}

.partner::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--ui-blue);
    background: linear-gradient(180deg, #ffd7bd, #ffbf99);
    z-index: 0;
}

.partner .face-details {
    top: 10px;
    left: 20px;
    width: 52px;
    height: 52px;
    inset: auto;
}

.bubble-target {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 180px;
    z-index: 4;
}

.speech-bubble {
    position: absolute;
    top: -72px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 16px;
    border: 3px solid var(--ui-blue);
    border-radius: 24px;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.apple-layer,
.easter-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

.apple {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 46% 46%;
    border: 3px solid #8d1d1d;
    background: radial-gradient(circle at 30% 30%, #ffd6d6, #e53935 65%);
}

.apple.potato {
    border-color: #815d2a;
    background: radial-gradient(circle at 30% 30%, #e6d2a2, #b1853f 65%);
}

.hud-bottom {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 24px;
    background: rgba(255, 248, 230, 0.92);
}

.panel-game .partner {
    opacity: 0.45;
    transform: scale(0.88);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.panel-game.is-near-top .partner {
    opacity: 1;
    transform: scale(1);
}

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

.control-button {
    min-width: 100px;
}

.progress-wrap {
    min-width: 220px;
}

.progress-bar {
    width: min(360px, 55vw);
    height: 18px;
    margin-top: 6px;
    overflow: hidden;
    border: 3px solid var(--ui-blue);
    border-radius: 999px;
    background: #fff;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--ui-red), var(--ui-yellow));
}

.controls-hint {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
    font-size: 0.92rem;
}

.floating-birds,
.flying-bee,
.tree-eyes {
    position: absolute;
}

.floating-birds {
    width: 84px;
    height: 34px;
    border-top: 4px dashed var(--ui-blue);
    border-radius: 50%;
}

.flying-bee {
    width: 34px;
    height: 24px;
    border: 3px solid var(--ui-blue);
    border-radius: 16px;
    background: repeating-linear-gradient(90deg, #ffd54f 0, #ffd54f 10px, #1f2937 10px, #1f2937 16px);
}

.tree-eyes {
    left: 50%;
    top: 54%;
    width: 140px;
    height: 44px;
    transform: translateX(-50%);
}

.tree-eyes::before,
.tree-eyes::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 22px;
    top: 0;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--ui-blue);
}

.tree-eyes::before {
    left: 18px;
}

.tree-eyes::after {
    right: 18px;
}

.tree-eyes span {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 60px;
    height: 10px;
    transform: translateX(-50%);
    border-bottom: 4px solid var(--ui-blue);
    border-radius: 0 0 50px 50px;
}

@media (max-width: 720px) {
    .panel-intro {
        height: 100%;
        padding: 16px;
    }

    .intro-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .intro-scene {
        min-height: 420px;
    }

    .intro-climber {
        left: calc(50% - 150px);
    }

    .intro-partner-wrap {
        right: 14px;
    }

    .intro-card .overlay-title,
    .intro-card .overlay-text,
    .intro-card .overlay-lead {
        text-align: center;
    }

    .panel-game {
        height: 100%;
    }

    .hud-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-bar {
        width: 100%;
    }

    .controls-hint {
        text-align: left;
    }

    .desktop-controls {
        width: 100%;
    }

    .control-button {
        flex: 1;
        min-width: 0;
    }
}