
html, body {
    margin: 0;
    width: 100%;
    height: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    padding: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.28)),
        url("images/forest.png") center / cover no-repeat fixed;
    font-family: "Lora", serif;
}

.story-box {
    position: relative;
    width: min(760px, 94vw);
    padding: 22px 30px;
    background: rgba(0,0,0,.60);
    border: 2px solid rgba(255,215,0,.75);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.55), inset 0 0 24px rgba(255,215,0,.03);
    backdrop-filter: blur(4px);
    text-align: center;
}

.story-box h1 {
    margin: 8px 0 14px;
    color: #ffd84d;
    font-family: "Cinzel", serif;
    font-size: clamp(34px, 5vw, 46px);
    line-height: 1.1;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255,215,70,.45);
}

.story-box h2 {
    font-family: "Cinzel", serif;
}

.story-box > p {
    max-width: 620px;
    margin: 8px auto;
    font-size: 16px;
    line-height: 1.5;
}


.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 8px;
}

.stats p {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
}


.back-button {
    margin-top: 14px;
}

.back-button a,
.back-link {
    color: #d8d8d8;
    text-decoration: none;
    font-family: "Lora", serif;
    font-size: 13px;
    transition: .2s ease;
}

.back-button a:hover,
.back-link:hover {
    color: #ffd84d;
}

.choices,
.left-path-choices {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 20px;
}

.choices a,
.left-path-choices a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 155px;
    min-height: 52px;
    padding: 10px 14px;
    background: linear-gradient(135deg,#e8b900,#ffd83d,#e8b900);
    color: #151000;
    border: 1px solid #fff0a0;
    border-radius: 11px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(0,0,0,.35), inset 0 0 8px rgba(255,255,255,.18);
    transition: .2s ease;
}

.left-path-choices a {
    width: 175px;
}

.choices a:hover,
.left-path-choices a:hover {
    transform: translateY(-3px) scale(1.03);
    background: linear-gradient(135deg,#f2c527,#ffe771,#f2c527);
    box-shadow: 0 0 18px rgba(255,215,80,.45);
}

.utility-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0 8px;
}

.use-potion-button,
.buy-potion-button {
    display: inline-block;
    width: auto !important;
    min-width: 0 !important;
    padding: 7px 16px;
    margin: 4px auto 7px;
    border-radius: 9px;
    font-family: "Lora", serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

.use-potion-button {
    background: rgba(8,32,18,.78);
    color: #dffff0;
    border: 1px solid rgba(100,220,145,.75);
    box-shadow: 0 0 9px rgba(70,220,120,.12);
}

.use-potion-button:hover {
    color: #fff;
    border-color: #9cffb5;
    background: rgba(60,150,85,.18);
    box-shadow: 0 0 16px rgba(80,235,125,.32);
    transform: translateY(-2px);
}

.buy-potion-button {
    width: 250px !important;
    padding: 12px 18px;
    background: linear-gradient(135deg,#173b28,#287249,#173b28);
    color: #ddffe7;
    border: 1px solid #65d692;
    font-family: "Cinzel", serif;
}

.buy-potion-button:hover {
    background: linear-gradient(135deg,#215a38,#35945b,#215a38);
    color: #fff;
    border-color: #94ffb5;
    box-shadow: 0 0 20px rgba(80,235,130,.5);
    transform: translateY(-2px) scale(1.025);
}

.hp-section,
.enemy-hp-section {
    width: min(520px,92%);
    margin: 8px auto;
}

.hp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    color: #eee;
    font-family: "Cinzel", serif;
    font-size: 13px;
    font-weight: 700;
}

.hp-bar {
    width: 100%;
    height: 16px;
    overflow: hidden;
    background: rgba(0,0,0,.72);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,.65);
}

.hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,#32bd5d,#8cff9e);
    border-radius: 999px;
    transition: width .35s ease, background .35s ease;
    box-shadow: 0 0 8px rgba(80,255,120,.3);
}

.enemy-bar .hp-fill {
    background: linear-gradient(90deg,#bd2525,#ff7474);
    box-shadow: 0 0 8px rgba(255,55,55,.3);
}


#enemy-box {
    margin-top: 12px;
    padding: 14px;
    background: rgba(0,0,0,.43);
    border: 1px solid rgba(180,40,40,.48);
    border-radius: 14px;
}

#enemy-box h2 {
    margin: 3px 0 7px;
    font-size: 20px;
}

#enemy-box p {
    margin: 5px 0;
    font-size: 14px;
}

#combat-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

#combat-buttons button {
    padding: 8px 13px;
    background: rgba(17,10,14,.92);
    color: #f0f0f0;
    border: 1px solid rgba(190,55,55,.70);
    border-radius: 8px;
    font-family: "Lora", serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

#combat-buttons button:hover {
    background: rgba(190,55,55,.2);
    border-color: #e45b5b;
    transform: translateY(-2px);
}

.fight-again,
.back-link {
    display: block;
    width: fit-content;
    margin: 12px auto;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    transition: .2s ease;
}

.fight-again {
    background: linear-gradient(135deg,#e8b900,#ffd83d,#e8b900);
    color: #171200;
    border: 1px solid #fff0a0;
}

.fight-again:hover {
    transform: scale(1.04);
    box-shadow: 0 0 16px rgba(255,215,80,.45);
}


#notification {
    position: fixed;
    right: -380px;
    bottom: 22px;
    width: min(320px,88vw);
    min-height: 72px;
    padding: 14px 18px;
    background: rgba(18,18,23,.96);
    border-left: 4px solid #ffd84d;
    border-radius: 7px;
    box-shadow: 0 7px 24px rgba(0,0,0,.6);
    z-index: 10000;
    transition: right .4s ease;
}

#notifTitle {
    color: #ffd84d;
    font-family: "Cinzel", serif;
    font-size: 17px;
    font-weight: 700;
}

#notifText {
    margin-top: 5px;
    color: #ddd;
    font-size: 14px;
}


.merchant-shop {
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(0,0,0,.54),rgba(0,0,0,.54)),
        url("images/merchant-bg.png");
    background-size: cover;
    background-position: center;
}

.merchant-shop::before {
    content: "";
    position: absolute;
    inset: -8px;
    background: inherit;
    filter: blur(5px);
    transform: scale(1.04);
    z-index: 0;
    pointer-events: none;
}

.merchant-shop > * {
    position: relative;
    z-index: 1;
}

#potion-purchases {
    color: #ffe58c;
    font-family: "Cinzel", serif;
    font-size: 14px;
    font-weight: 700;
}

/* Dark-shop entrance */
#dark-shop-button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: block;
    width: fit-content;
    margin: 14px auto;
    padding: 12px 23px;
    background: linear-gradient(135deg,#241034,#4c1b70,#241034);
    color: #debaff;
    border: 1px solid #a762d5;
    border-radius: 10px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(145,65,220,.3);
    animation: dark-shop-pulse 2.6s ease-in-out infinite;
    transition: .25s ease;
}

#dark-shop-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 52%;
    height: 100%;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);
    transform: skewX(-20deg);
    animation: dark-shop-sweep 2.9s ease-in-out infinite;
    pointer-events: none;
}

#dark-shop-button:hover {
    color: #fff;
    border-color: #d29aff;
    background: linear-gradient(135deg,#35134e,#6c249a,#35134e);
    box-shadow: 0 0 18px rgba(175,90,255,.75),0 0 35px rgba(145,55,235,.32);
    transform: translateY(-3px) scale(1.04);
    animation: none;
}

@keyframes dark-shop-pulse {
    0%,100% { box-shadow: 0 0 8px rgba(145,65,220,.22),0 0 18px rgba(120,45,210,.08); }
    50% { box-shadow: 0 0 16px rgba(175,80,250,.56),0 0 32px rgba(135,45,220,.18); }
}

@keyframes dark-shop-sweep {
    0% { left: -100%; opacity: 0; }
    18% { opacity: 1; }
    52% { left: 140%; opacity: 0; }
    100% { left: 140%; opacity: 0; }
}

.dark-shop-page {
    background-image:
        linear-gradient(rgba(0,0,0,.46),rgba(0,0,0,.54)),
        url("images/darkshop-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.dark-shop {
    width: min(820px,95vw);
}

.dark-shop h1 {
    color: #d94b4b;
    text-shadow: 0 0 13px rgba(190,20,20,.55);
}

.merchant-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 9px auto;
}

.merchant-image img {
    display: block;
    width: min(330px,62vw);
    max-height: 200px;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    border: 2px solid rgba(180,40,40,.7);
    box-shadow: 0 8px 26px rgba(0,0,0,.78),0 0 22px rgba(130,0,0,.3);
}


.dragon-page {
    background-image:
        linear-gradient(rgba(0,0,0,.54),rgba(0,0,0,.60)),
        url("images/dragon-cave-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.dragon-page .story-box {
    width: min(820px,95vw);
}

.dragon-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 9px auto;
    overflow: hidden;
}

.dragon-image img {
    display: block;
    width: min(460px,68vw);
    max-height: 190px;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    border: 2px solid rgba(255,90,40,.72);
    box-shadow: 0 8px 28px rgba(0,0,0,.78),0 0 25px rgba(200,50,20,.3);
}


.keyhunt-page {
    background-image:
        linear-gradient(rgba(0,0,0,.36),rgba(0,0,0,.44)),
        url("images/keyhunt-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.key-hunt {
    max-width: 500px;
    margin: 16px auto;
    padding: 18px;
    background: rgba(0,0,0,.44);
    border: 1px solid rgba(255,215,0,.4);
    border-radius: 15px;
}

#key-click-progress {
    margin: 4px 0 12px;
    color: #f6dc78;
    font-family: "Cinzel", serif;
    font-size: 19px;
    font-weight: 700;
}

.key-button {
    padding: 13px 25px;
    background: linear-gradient(135deg,#17201d,#26332e,#17201d);
    color: #fff;
    border: 2px solid #d4af37;
    border-radius: 11px;
    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 9px rgba(255,215,80,.16);
    transition: .2s ease;
}

.key-button:hover {
    background: linear-gradient(135deg,#263c31,#385547,#263c31);
    color: #ffe979;
    box-shadow: 0 0 20px rgba(255,215,80,.45);
    transform: translateY(-3px);
}

/* Dragon lock button */
#dragon-button {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: 11px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 15px;
    font-weight: 700;
    transition: .25s ease;
}

#dragon-button.locked {
    background: rgba(75,20,20,.84);
    color: #d8d8d8;
    border: 2px solid #8b3a3a;
    cursor: not-allowed;
}

#dragon-button.unlocked {
    background: linear-gradient(135deg,#16532e,#2f9951,#16532e);
    color: #fff;
    border: 2px solid #76ff9b;
    box-shadow: 0 0 14px rgba(80,255,130,.48);
    transform: scale(1.02);
}

#dragon-button.unlocked:hover {
    background: linear-gradient(135deg,#216c3a,#43c76b,#216c3a);
    box-shadow: 0 0 24px rgba(95,255,140,.76);
    transform: translateY(-2px) scale(1.05);
}


.game-over {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.80);
}

.game-over-card {
    width: min(430px,90vw);
    padding: 28px 26px;
    background: linear-gradient(rgba(35,5,10,.98),rgba(10,5,10,.98));
    border: 2px solid #a33b3b;
    border-radius: 16px;
    box-shadow: 0 0 35px rgba(120,0,0,.52);
    text-align: center;
}

.game-over-card h1 {
    margin: 0 0 13px;
    color: #e05a5a;
    font-family: "Cinzel", serif;
    font-size: 30px;
    text-shadow: 0 0 12px rgba(220,50,50,.5);
}

.game-over-card p {
    margin: 9px auto;
    font-size: 15px;
    line-height: 1.55;
}

#revive-count {
    margin-top: 20px;
    color: #f5d76e;
    font-family: "Cinzel", serif;
    font-size: 15px;
    font-weight: 700;
}

.revive-button {
    padding: 13px 24px;
    margin-top: 8px;
    background: linear-gradient(135deg,#24133f,#4a2380,#24133f);
    color: #e7dcff;
    border: 2px solid #8d6aff;
    border-radius: 10px;
    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 13px rgba(130,80,255,.35);
    transition: .2s ease;
}

.revive-button:hover {
    border-color: #b8a2ff;
    box-shadow: 0 0 24px rgba(150,100,255,.68);
    transform: scale(1.04);
}


.story-box.story-ending {
    height: auto !important;
    min-height: 0 !important;
    padding: 22px 30px;
    justify-content: center;
}

.peace-ending,
.treasure-ending {
    display: none;
    width: 100%;
    margin-top: 5px;
    padding: 24px;
    text-align: center;
    border-radius: 16px;
}

.peace-ending {
    background: linear-gradient(rgba(5,30,15,.9),rgba(5,15,10,.96));
    border: 2px solid #6fd28a;
    box-shadow: 0 0 27px rgba(80,220,120,.28);
}

.treasure-ending {
    background: linear-gradient(rgba(45,28,5,.92),rgba(20,12,2,.97));
    border: 2px solid #f1c84b;
    box-shadow: 0 0 25px rgba(255,200,60,.25);
}

.peace-ending h1,
.treasure-ending h1 {
    margin: 0 0 12px;
    font-family: "Cinzel", serif;
    font-size: 30px;
}

.peace-ending h1 {
    color: #9dffb3;
    text-shadow: 0 0 12px rgba(100,255,140,.45);
}

.treasure-ending h1 {
    color: #ffe27a;
    text-shadow: 0 0 12px rgba(255,210,70,.55);
}

.peace-ending p,
.treasure-ending p {
    margin: 8px auto;
    font-size: 16px;
    line-height: 1.5;
}

/* Restore Peace */
.restore-peace-button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-block;
    margin-top: 16px;
    padding: 13px 28px;
    background: linear-gradient(135deg,#18552d,#3ca963,#18552d);
    color: #ebfff0;
    border: 2px solid #83ffa2;
    border-radius: 11px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .7px;
    box-shadow: 0 0 10px rgba(80,255,120,.35);
    animation: peace-pulse 2.6s ease-in-out infinite;
    transition: .25s ease;
}

.restore-peace-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 52%;
    height: 100%;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,.46),transparent);
    transform: skewX(-20deg);
    animation: peace-sweep 3.1s ease-in-out infinite;
    pointer-events: none;
}

.restore-peace-button:hover {
    color: #fff;
    border-color: #b8ffca;
    box-shadow: 0 0 20px rgba(100,255,140,.82),0 0 38px rgba(70,230,110,.34);
    transform: translateY(-3px) scale(1.05);
    animation: none;
}

@keyframes peace-pulse {
    0%,100% { box-shadow: 0 0 8px rgba(80,240,120,.28),0 0 18px rgba(70,220,100,.09); }
    50% { box-shadow: 0 0 18px rgba(100,255,140,.68),0 0 32px rgba(70,230,110,.2); }
}

@keyframes peace-sweep {
    0% { left: -100%; opacity: 0; }
    18% { opacity: 1; }
    52% { left: 140%; opacity: 0; }
    100% { left: 140%; opacity: 0; }
}

/* Treasure button */
.treasure-button {
    position: relative;
    overflow: hidden;
    display: inline-block;
    margin-top: 15px;
    padding: 13px 30px;
    background: linear-gradient(135deg,#a66d08,#ffd84d,#fff0a0,#ffd84d,#a66d08);
    background-size: 250% 100%;
    color: #392400;
    border: 2px solid #fff1a2;
    border-radius: 12px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .8px;
    box-shadow: 0 0 12px rgba(255,215,60,.52),0 0 25px rgba(255,190,25,.22);
    animation: treasure-shine 2.3s ease-in-out infinite;
    transition: .25s ease;
}

.treasure-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 20px rgba(255,230,100,.9),0 0 40px rgba(255,190,30,.45);
}

@keyframes treasure-shine {
    0% { background-position: 100% 0; }
    50% { background-position: 0% 0; }
    100% { background-position: 100% 0; }
}


.peace-page {
    min-height: 100vh;
    padding: 18px;
    background:
        linear-gradient(rgba(20,55,30,.16),rgba(5,30,15,.28)),
        url("images/peace-bg.png") center / cover no-repeat fixed;
}

.peace-screen {
    width: min(760px,92vw);
    padding: 32px 42px;
    background: rgba(5,25,12,.74);
    border: 2px solid rgba(150,230,165,.75);
    border-radius: 22px;
    box-shadow: 0 15px 45px rgba(0,0,0,.48),0 0 30px rgba(100,220,120,.16);
    backdrop-filter: blur(5px);
    text-align: center;
}

.peace-icon { font-size: 42px; margin-bottom: 3px; }

.peace-content h1 {
    margin: 0 0 18px;
    color: #d0ffd8;
    font-family: "Cinzel", serif;
    font-size: clamp(38px,5vw,52px);
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(120,255,150,.43);
}

.epilogue {
    max-width: 620px;
    margin: 11px auto;
    color: #f3fff5;
    font-size: 17px;
    line-height: 1.6;
}

.epilogue-divider { margin: 18px 0; color: #a7efb2; font-size: 22px; }
.final-line { color: #d5ffdc; font-family: "Cinzel",serif; font-size: 17px; line-height: 1.65; }

.return-button {
    display: inline-block;
    margin-top: 18px;
    padding: 11px 22px;
    background: linear-gradient(135deg,#1d6032,#369b52,#1d6032);
    color: #fff;
    border: 1px solid #8bf0a0;
    border-radius: 10px;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 14px;
    font-weight: 700;
    transition: .25s ease;
}

.return-button:hover {
    background: linear-gradient(135deg,#287b40,#4bc56b,#287b40);
    border-color: #b0ffc0;
    box-shadow: 0 0 22px rgba(100,255,140,.58);
    transform: translateY(-2px) scale(1.03);
}



.merchant-ending-choices {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 20px;
}



.cursed-wand-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 230px;
    min-height: 54px;

    padding: 13px 22px;

    border: 2px solid #c45cff;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #1a0829,
            #4b125f,
            #1a0829
        );

    color: #f3d9ff;

    text-decoration: none;

    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: bold;

    letter-spacing: 0.8px;

    overflow: hidden;

    box-shadow:
        0 0 10px rgba(179, 65, 255, 0.35),
        0 0 25px rgba(137, 38, 190, 0.22);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;

    animation: cursedWandPulse 2.5s ease-in-out infinite;
}


/* Dark magical shimmer */

.cursed-wand-button::after {
    content: "";

    position: absolute;

    top: -40%;
    bottom: -40%;

    left: -45%;

    width: 24%;

    transform: skewX(-22deg);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 220, 255, 0.60),
            transparent
        );

    animation: cursedWandSweep 3.2s ease-in-out infinite;

    pointer-events: none;
}


/* Hover */

.cursed-wand-button:hover {
    transform: translateY(-4px) scale(1.04);

    border-color: #edb4ff;

    color: white;

    box-shadow:
        0 0 15px rgba(202, 95, 255, 0.65),
        0 0 38px rgba(167, 53, 220, 0.55),
        0 8px 25px rgba(0, 0, 0, 0.45);
}


/* Click */

.cursed-wand-button:active {
    transform: translateY(0) scale(0.98);
}


/* =====================================================
   CURSED WAND ANIMATIONS
   ===================================================== */

@keyframes cursedWandPulse {

    0%,
    100% {
        box-shadow:
            0 0 10px rgba(179, 65, 255, 0.30),
            0 0 25px rgba(137, 38, 190, 0.18);
    }

    50% {
        box-shadow:
            0 0 18px rgba(207, 91, 255, 0.65),
            0 0 38px rgba(157, 44, 212, 0.45);
    }

}


@keyframes cursedWandSweep {

    0% {
        left: -45%;
    }

    55%,
    100% {
        left: 130%;
    }

}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 600px) {

    .merchant-ending-choices {
        flex-direction: column;
    }

    .cursed-wand-button,
    .restore-peace-button {
        width: min(300px, 85vw);
    }

}
/* =====================================================
   BAD ENDING
   ===================================================== */

.bad-ending-page {
    margin: 0;
    width: 100%;
    height: 100vh;

    overflow: hidden;

    font-family: "Lora", serif;

    background:
        linear-gradient(
            rgba(12, 0, 18, 0.72),
            rgba(4, 0, 8, 0.90)
        ),
        url("images/darkshop-bg.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    color: #f1dfff;
}


.bad-ending-screen {
    position: relative;

    width: 100%;
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}


.bad-ending-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at center,
            transparent 15%,
            rgba(45, 0, 65, 0.35) 50%,
            rgba(0, 0, 0, 0.82) 100%
        );

    pointer-events: none;
}


.bad-ending-content {
    position: relative;
    z-index: 2;

    width: min(720px, 90vw);

    padding: 36px 40px;

    text-align: center;

    background:
        linear-gradient(
            rgba(15, 4, 22, 0.88),
            rgba(7, 1, 12, 0.94)
        );

    border: 2px solid rgba(197, 91, 255, 0.75);

    border-radius: 18px;

    box-shadow:
        0 0 25px rgba(145, 40, 190, 0.30),
        0 0 70px rgba(80, 0, 110, 0.30),
        0 20px 50px rgba(0, 0, 0, 0.60);

    animation: badEndingAppear 1.2s ease-out both;
}


/* Symbol */

.bad-ending-symbol {
    font-size: 42px;

    color: #d888ff;

    text-shadow:
        0 0 12px rgba(216, 136, 255, 0.7),
        0 0 30px rgba(157, 50, 220, 0.45);

    animation: curseGlow 2s ease-in-out infinite;
}


/* Label */

.bad-ending-label {
    margin: 8px 0 4px;

    font-family: "Cinzel", serif;

    font-size: 14px;

    font-weight: bold;

    letter-spacing: 0.28em;

    color: #c883ef;
}


/* Main title */

.bad-ending-content h1 {
    margin: 5px 0 15px;

    font-family: "Cinzel", serif;

    font-size: clamp(35px, 6vw, 58px);

    letter-spacing: 0.05em;

    color: #eed4ff;

    text-shadow:
        0 2px 0 #2d0d3a,
        0 0 20px rgba(205, 101, 255, 0.50);
}


/* Divider */

.bad-ending-divider {
    display: flex;

    align-items: center;

    gap: 12px;

    width: min(500px, 80%);

    margin: 0 auto 22px;
}


.bad-ending-divider span {
    flex: 1;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(204, 120, 255, 0.75)
        );
}


.bad-ending-divider span:last-child {
    background:
        linear-gradient(
            90deg,
            rgba(204, 120, 255, 0.75),
            transparent
        );
}


.bad-ending-divider b {
    color: #dda0ff;

    font-size: 10px;
}


/* Story */

.bad-ending-story {
    max-width: 600px;

    margin: 10px auto;

    font-size: 16px;

    line-height: 1.6;

    color: #e5d1eb;
}


.final-line {
    margin-top: 22px;

    color: #f0d5ff;

    font-weight: 500;

    text-shadow:
        0 0 9px rgba(193, 91, 238, 0.28);
}


/* Final message */

.bad-ending-title {
    margin-top: 25px;

    padding: 14px;

    font-family: "Cinzel", serif;

    font-size: clamp(14px, 2vw, 18px);

    font-weight: bold;

    letter-spacing: 0.08em;

    color: #d994ff;

    border-top: 1px solid rgba(200, 119, 255, 0.3);
    border-bottom: 1px solid rgba(200, 119, 255, 0.3);

    text-shadow:
        0 0 12px rgba(205, 102, 255, 0.45);
}


/* Return button */

.bad-ending-button {
    position: relative;

    display: inline-flex;

    justify-content: center;
    align-items: center;

    margin-top: 27px;

    min-width: 230px;

    padding: 13px 24px;

    border: 2px solid #ad58d4;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #260d34,
            #57216d,
            #260d34
        );

    color: #f1dcff;

    text-decoration: none;

    font-family: "Cinzel", serif;

    font-size: 15px;

    font-weight: bold;

    letter-spacing: 0.05em;

    box-shadow:
        0 0 15px rgba(170, 73, 217, 0.35);

    transition: 0.25s ease;
}


.bad-ending-button:hover {
    transform: translateY(-3px);

    border-color: #e1a6ff;

    box-shadow:
        0 0 25px rgba(194, 94, 247, 0.65);
}


/* =====================================================
   BAD ENDING ANIMATIONS
   ===================================================== */

@keyframes badEndingAppear {

    from {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


@keyframes curseGlow {

    0%,
    100% {
        transform: scale(1);

        text-shadow:
            0 0 12px rgba(216, 136, 255, 0.55),
            0 0 25px rgba(157, 50, 220, 0.35);
    }

    50% {
        transform: scale(1.08);

        text-shadow:
            0 0 18px rgba(232, 171, 255, 0.85),
            0 0 38px rgba(171, 61, 232, 0.65);
    }

}


/* Mobile */

@media (max-width: 600px) {

    .bad-ending-content {
        padding: 28px 22px;
    }

    .bad-ending-story {
        font-size: 15px;
    }

    .bad-ending-title {
        font-size: 13px;
    }

}
/* =====================================================
   DRAGON FINAL CHOICE
   ===================================================== */

.dragon-ending-choices {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 24px;
}


/* =========================
   TREASURE CHOICE
   ========================= */

.treasure-choice-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 240px;
    min-height: 60px;

    padding: 14px 24px;

    border-radius: 13px;
    border: 2px solid #ffe18a;

    background:
        linear-gradient(
            135deg,
            #7d5100,
            #e1a817,
            #7d5100
        );

    color: #fff8d9;

    text-decoration: none;

    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: bold;

    letter-spacing: 0.06em;

    box-shadow:
        0 0 12px rgba(255, 206, 76, 0.45),
        0 0 30px rgba(255, 191, 42, 0.25);

    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.treasure-choice-button::after {
    content: "";

    position: absolute;

    top: -50%;
    bottom: -50%;

    left: -45%;

    width: 22%;

    transform: skewX(-22deg);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.7),
            transparent
        );

    animation: treasureChoiceShine 3.2s ease-in-out infinite;
}


.treasure-choice-button:hover {
    transform: translateY(-4px) scale(1.04);

    box-shadow:
        0 0 18px rgba(255, 220, 100, 0.75),
        0 0 42px rgba(255, 190, 45, 0.5);
}


/* =========================
   NO EVIL / GUARDIAN
   ========================= */

.guardian-choice-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 240px;
    min-height: 60px;

    padding: 14px 24px;

    border-radius: 13px;
    border: 2px solid #7dff9c;

    background:
        linear-gradient(
            135deg,
            #123d22,
            #267847,
            #123d22
        );

    color: #eaffef;

    text-decoration: none;

    font-family: "Cinzel", serif;
    font-size: 16px;
    font-weight: bold;

    letter-spacing: 0.1em;

    box-shadow:
        0 0 12px rgba(86, 235, 123, 0.38),
        0 0 30px rgba(43, 177, 83, 0.22);

    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.guardian-choice-button::after {
    content: "";

    position: absolute;

    top: -50%;
    bottom: -50%;

    left: -45%;

    width: 22%;

    transform: skewX(-22deg);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(220,255,228,0.6),
            transparent
        );

    animation: guardianChoiceShine 3.7s ease-in-out infinite;
}


.guardian-choice-button:hover {
    transform: translateY(-4px) scale(1.04);

    box-shadow:
        0 0 18px rgba(104, 255, 142, 0.72),
        0 0 42px rgba(55, 201, 94, 0.45);
}


/* =========================
   FINAL CHOICE TEXT
   ========================= */

.final-choice-text {
    color: #a6ffb8;

    font-family: "Cinzel", serif;

    font-weight: bold;

    text-shadow:
        0 0 12px rgba(104, 255, 139, 0.3);
}


/* =========================
   ANIMATIONS
   ========================= */

@keyframes treasureChoiceShine {

    0% {
        left: -45%;
    }

    55%,
    100% {
        left: 130%;
    }

}


@keyframes guardianChoiceShine {

    0% {
        left: -45%;
    }

    55%,
    100% {
        left: 130%;
    }

}


/* Mobile */

@media (max-width: 600px) {

    .dragon-ending-choices {
        flex-direction: column;
    }

    .treasure-choice-button,
    .guardian-choice-button {
        width: min(310px, 85vw);
    }

}
/* =====================================================
   GUARDIAN TRUE ENDING
   ===================================================== */

.guardian-ending-page {
    margin: 0;

    width: 100%;
    height: 100vh;

    overflow: hidden;

    font-family: "Lora", serif;

    color: #eaffef;

    background:
        linear-gradient(
            rgba(5, 25, 13, 0.45),
            rgba(3, 14, 8, 0.75)
        ),
        url("images/forest.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


.guardian-ending-screen {
    position: relative;

    width: 100%;
    height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}


.guardian-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at center,
            transparent 15%,
            rgba(0, 45, 18, 0.22) 55%,
            rgba(0, 0, 0, 0.62) 100%
        );
}


.guardian-content {
    position: relative;
    z-index: 2;

    width: min(720px, 90vw);

    padding: 34px 40px;

    text-align: center;

    background:
        linear-gradient(
            rgba(6, 31, 17, 0.84),
            rgba(3, 18, 10, 0.94)
        );

    border: 2px solid rgba(112, 231, 139, 0.72);

    border-radius: 18px;

    box-shadow:
        0 0 30px rgba(62, 201, 102, 0.25),
        0 0 70px rgba(25, 110, 53, 0.2),
        0 20px 50px rgba(0, 0, 0, 0.55);

    animation: guardianAppear 1.2s ease-out both;
}


.guardian-symbol {
    font-size: 45px;

    text-shadow:
        0 0 18px rgba(113, 255, 145, 0.7);

    animation: guardianGlow 2.5s ease-in-out infinite;
}


.guardian-label {
    margin: 8px 0 4px;

    font-family: "Cinzel", serif;

    font-size: 14px;

    letter-spacing: 0.25em;

    color: #8fffab;
}


.guardian-content h1 {
    margin: 5px 0 15px;

    font-family: "Cinzel", serif;

    font-size: clamp(35px, 6vw, 58px);

    letter-spacing: 0.04em;

    color: #d8ffe1;

    text-shadow:
        0 2px 0 #123d20,
        0 0 20px rgba(107, 255, 142, 0.35);
}


.guardian-divider {
    width: min(500px, 80%);

    margin: 0 auto 22px;

    display: flex;
    align-items: center;

    gap: 12px;
}


.guardian-divider span {
    flex: 1;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(121, 255, 157, 0.7)
        );
}


.guardian-divider span:last-child {
    background:
        linear-gradient(
            90deg,
            rgba(121, 255, 157, 0.7),
            transparent
        );
}


.guardian-divider b {
    color: #adffc0;
}


.guardian-content > p {
    max-width: 590px;

    margin: 10px auto;

    font-size: 16px;

    line-height: 1.6;

    color: #d6ebdb;
}


.guardian-final-text {
    margin-top: 22px !important;

    color: #b5ffc6 !important;

    font-weight: bold;

    text-shadow:
        0 0 10px rgba(101, 255, 139, 0.35);
}


.guardian-title {
    margin: 24px auto 10px;

    padding: 13px;

    border-top: 1px solid rgba(119, 255, 152, 0.3);
    border-bottom: 1px solid rgba(119, 255, 152, 0.3);

    font-family: "Cinzel", serif;

    font-size: clamp(15px, 2vw, 20px);

    font-weight: bold;

    letter-spacing: 0.14em;

    color: #a6ffb9;

    text-shadow:
        0 0 14px rgba(100, 255, 137, 0.4);
}


.guardian-return-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 230px;

    margin-top: 25px;

    padding: 13px 24px;

    border: 2px solid #77e895;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #123d22,
            #287746,
            #123d22
        );

    color: #edfff2;

    text-decoration: none;

    font-family: "Cinzel", serif;

    font-size: 15px;

    font-weight: bold;

    box-shadow:
        0 0 16px rgba(91, 231, 122, 0.35);

    transition: 0.25s ease;
}


.guardian-return-button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 0 28px rgba(97, 255, 133, 0.65);
}


@keyframes guardianAppear {

    from {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


@keyframes guardianGlow {

    0%,
    100% {
        transform: scale(1);

        text-shadow:
            0 0 12px rgba(113, 255, 145, 0.45);
    }

    50% {
        transform: scale(1.08);

        text-shadow:
            0 0 25px rgba(113, 255, 145, 0.85);
    }

}
#enemy-box {
    position: relative;
}
#enemy-box.sword-hit {
    animation: swordHit 0.42s ease-out;
}
#enemy-box.sword-hit::after {
    content: "⚔️";
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 46px;
    transform: translate(-50%,-50%) rotate(-25deg);
    color: white;
    text-shadow: 0 0 8px white, 0 0 20px #bfe8ff;
    pointer-events: none;
    animation:swordSlash 0.42s ease-out;
}
#enemy-box.heavy-hit {
    animation: heavyHit 0.55s ease-out;
}
#enemy-box.heavy-hit::after {
    content: "💥";
    position: absolute;
    left: 50%;
    top: 48%;
    font-size: 58px;
    transform: translate(-50%,-50%);
    pointer-events: none;
    animation:heavyHitEffect 0.55s ease-out;
}
.story-box.player-hit {
    animation: playerHit 0.42s ease-out;
}
.story-box.player-hit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,40,40,.18);
    box-shadow: inset 0 0 35px rgba(255,30,30,.18);
    pointer-events: none;
    animation:damageFlash 0.42s ease-out;
}
.damage-number{
    position: absolute;
    left: 50%;
    top: 35%;
    z-index: 20;
    transform: translate(-50%,0);
    font-family: "Cinzel", serif;
    font-size: 27px;
    font-weight: bold;
    color: #ffdfdf;
    text-shadow: 0 0 8px #ff1f1f,0 0 18px rgba(255,50,50,.8);
    pointer-events: none;
    animation:damageFloat 0.8s ease-out forwards;
}
.damage-number.heavy-damage {
    font-size: 34px;
    color: #fff2cf;
    text-shadow:
    0 0 10px #ff7b00,
    0 0 25px rgba(255,80,0,0.8);
}
.story-box.low-health {
    animation: lowHealthPulse 1.1s ease-out infinite;
}
@keyframes swordHit {
    0% { transform: translateX(0) rotate(0);}
    18% { transform: translateX(13px) rotate(1deg);}
    45% { transform: translateX(-9px) rotate(-1deg);}
    70% { transform: translateX(5px);}
    100% { transform: translateX(0);  }  
}

/* =====================================================
   THE LOST FOREST — FIT EVERYTHING ON SCREEN
   Keeps scrolling disabled and preserves the design.
   ===================================================== */

/* Long button labels must stay inside the screen */
.choices a,
.left-path-choices a,
#dark-shop-button,
#dragon-button,
.fight-again,
.back-link,
.cursed-wand-button,
.restore-peace-button,
.treasure-button,
.treasure-choice-button,
.guardian-choice-button,
.bad-ending-button,
.guardian-return-button,
.buy-potion-button,
.use-potion-button,
.key-button,
.revive-button,
#combat-buttons button {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

/* Make the layout more compact on typical laptop screens */
@media (max-height: 900px) {
    body {
        padding: 10px;
        overflow: hidden;
        align-items: center;
    }

    .story-box {
        padding: 13px 20px;
    }

    .story-box h1 {
        font-size: clamp(27px, 4.4vh, 38px);
        line-height: 1.05;
        margin: 4px 0 8px;
        letter-spacing: 0.7px;
    }

    .story-box h2 {
        margin: 5px 0;
    }

    .story-box > p {
        font-size: clamp(12px, 1.7vh, 14px);
        line-height: 1.3;
        margin: 4px auto;
    }

    .stats {
        gap: 6px 12px;
        margin-bottom: 4px;
    }

    .stats p {
        font-size: 12px;
    }

    .merchant-image,
    .dragon-image {
        margin: 4px auto;
    }

    .merchant-image img {
        width: min(280px, 45vw);
        max-height: 15vh;
        object-fit: contain;
    }

    .dragon-image img {
        width: min(360px, 50vw);
        max-height: 15vh;
        object-fit: contain;
    }

    .utility-row {
        margin: 0 0 3px;
    }

    .use-potion-button,
    .buy-potion-button {
        padding: 5px 10px;
        margin: 2px auto 4px;
        font-size: 12px;
    }

    .hp-section,
    .enemy-hp-section {
        margin: 4px auto;
    }

    .hp-label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .hp-bar {
        height: 12px;
    }

    #enemy-box {
        margin-top: 6px;
        padding: 8px;
    }

    #enemy-box h2 {
        font-size: 16px;
        margin: 2px 0 4px;
    }

    #enemy-box p {
        font-size: 12px;
        margin: 3px 0;
    }

    #combat-buttons {
        gap: 6px;
        margin-top: 5px;
    }

    #combat-buttons button {
        padding: 6px 9px;
        font-size: 12px;
    }

    /* Merchant and treasure endings */
    .story-box.story-ending {
        padding: 11px 16px;
    }

    .peace-ending,
    .treasure-ending {
        padding: 11px;
        margin-top: 3px;
    }

    .peace-ending h1,
    .treasure-ending h1 {
        font-size: clamp(22px, 3.6vh, 28px);
        margin: 0 0 6px;
    }

    .peace-ending p,
    .treasure-ending p {
        font-size: clamp(12px, 1.6vh, 14px);
        line-height: 1.3;
        margin: 4px auto;
    }

    .merchant-ending-choices,
    .dragon-ending-choices {
        gap: 8px;
        margin-top: 10px;
    }

    .cursed-wand-button,
    .restore-peace-button,
    .treasure-choice-button,
    .guardian-choice-button {
        min-width: 0;
        min-height: 42px;
        padding: 8px 12px;
        font-size: clamp(12px, 1.65vh, 14px);
        letter-spacing: 0;
    }

    .treasure-button,
    .fight-again,
    .back-link,
    .bad-ending-button,
    .guardian-return-button {
        padding: 8px 12px;
        font-size: clamp(12px, 1.7vh, 15px);
        margin-top: 7px;
    }
}

/* Very short screens: compact the content further */
@media (max-height: 680px) {
    body {
        padding: 5px;
    }

    .story-box {
        padding: 8px 13px;
    }

    .story-box h1 {
        font-size: clamp(22px, 4vh, 30px);
        line-height: 1;
        margin: 2px 0 5px;
    }

    .story-box > p {
        font-size: 11px;
        line-height: 1.18;
        margin: 2px auto;
    }

    .stats {
        gap: 4px 9px;
        margin-bottom: 2px;
    }

    .stats p {
        font-size: 11px;
    }

    .merchant-image img,
    .dragon-image img {
        max-height: 11vh;
    }

    .story-box.story-ending {
        padding: 7px 10px;
    }

    .peace-ending,
    .treasure-ending {
        padding: 7px;
        margin-top: 2px;
    }

    .peace-ending h1,
    .treasure-ending h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .peace-ending p,
    .treasure-ending p {
        font-size: 11px;
        line-height: 1.2;
        margin: 2px auto;
    }

    #enemy-box {
        padding: 5px;
        margin-top: 4px;
    }

    #combat-buttons {
        gap: 4px;
        margin-top: 4px;
    }

    #combat-buttons button {
        padding: 5px 7px;
        font-size: 11px;
    }

    .cursed-wand-button,
    .restore-peace-button,
    .treasure-choice-button,
    .guardian-choice-button {
        min-height: 36px;
        padding: 6px 8px;
        font-size: 11px;
        margin-top: 5px;
    }
}

/* Narrow screens: fit buttons inside the game window */
@media (max-width: 600px) {
    body {
        padding: 6px;
    }

    .story-box {
        width: 100%;
        padding: 12px 10px;
    }

    .choices,
    .left-path-choices {
        gap: 8px;
        margin-top: 10px;
    }

    .choices a,
    .left-path-choices a {
        width: auto;
        flex: 1 1 125px;
        padding: 8px;
        font-size: 13px;
    }

    /* Let ending buttons share the available width */
    .merchant-ending-choices,
    .dragon-ending-choices {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 7px;
    }

    .cursed-wand-button,
    .restore-peace-button,
    .treasure-choice-button,
    .guardian-choice-button {
        width: auto;
        flex: 1 1 42%;
        min-width: 0;
        padding: 8px;
        font-size: 12px;
        letter-spacing: 0;
    }

    #dark-shop-button,
    #dragon-button,
    .treasure-button,
    .bad-ending-button,
    .guardian-return-button {
        max-width: 100%;
        padding: 8px 10px;
        font-size: 12px;
        letter-spacing: 0;
    }
}

/* =====================================================
   DARK SHOP — LARGER MERCHANT, SAME NO-SCROLL LAYOUT
   ===================================================== */

@media (max-height: 900px) {

    /* Give the merchant image more room */
    .dark-shop-page .merchant-image {
        margin: 5px auto;
    }

    .dark-shop-page .merchant-image img {
        width: min(330px, 55vw);
        max-height: min(180px, 22vh);
        height: auto;
        object-fit: contain;
    }

    /* Recover vertical space from introductory text */
    .dark-shop-page #merchant-intro p {
        margin: 3px auto;
        line-height: 1.22;
    }
}

/* Short screens: keep the image visible without
   letting it consume the space needed by the fight */
@media (max-height: 680px) {

    .dark-shop-page .merchant-image img {
        width: min(310px, 50vw);
        max-height: min(135px, 22vh);
        object-fit: contain;
    }

    .dark-shop-page #merchant-intro p {
        margin: 2px auto;
        font-size: 11px;
        line-height: 1.15;
    }
}

/* =====================================================
   DRAGON PAGE — RESTORE IMAGE SIZE
   ===================================================== */

@media (max-height: 900px) {
    .dragon-page .dragon-image {
        margin: 6px auto;
    }

    .dragon-page .dragon-image img {
        width: min(460px, 65vw);
        max-height: min(190px, 24vh);
        height: auto;
        object-fit: contain;
    }
}

@media (max-height: 680px) {
    .dragon-page .dragon-image img {
        width: min(420px, 60vw);
        max-height: min(150px, 22vh);
        height: auto;
        object-fit: contain;
    }
}

/* =====================================================
   GUARDIAN TRUE ENDING — EPIC, COMPACT, NO SCROLL
   ===================================================== */

.guardian-ending-page {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.guardian-ending-screen {
    width: 100%;
    height: 100vh;
    min-height: 0;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.guardian-content {
    box-sizing: border-box;
    width: min(720px, 92vw);
    padding: clamp(14px, 2.5vh, 26px)
             clamp(18px, 3.5vw, 34px);
}

/* Glowing guardian symbol */
.guardian-symbol {
    font-size: clamp(30px, 4.5vh, 40px);
}

.guardian-label {
    margin: 5px 0 3px;
    font-size: clamp(10px, 1.6vh, 13px);
    letter-spacing: 0.2em;
}

/* Dramatic heading, scaled for screen height */
.guardian-content h1 {
    font-size: clamp(26px, 5.5vh, 48px);
    line-height: 1.05;
    margin: 4px 0 10px;
    letter-spacing: 0.03em;
}

.guardian-divider {
    margin: 0 auto 12px;
    gap: 9px;
}

/* Tighter story spacing preserves the atmosphere */
.guardian-content > p {
    font-size: clamp(12px, 1.8vh, 15px);
    line-height: 1.4;
    margin: 6px auto;
}

.guardian-final-text {
    margin-top: 13px !important;
}

.guardian-title {
    margin: 15px auto 7px;
    padding: 9px;
    font-size: clamp(12px, 1.9vh, 18px);
    letter-spacing: 0.08em;
    line-height: 1.25;
}

/* Final return button */
.guardian-return-button {
    box-sizing: border-box;
    width: min(260px, 100%);
    min-width: 0;
    margin-top: 12px;
    padding: 10px 16px;
    font-size: clamp(12px, 1.8vh, 14px);
    white-space: normal;
    line-height: 1.25;
}

/* Extra compact layout for short laptop screens */
@media (max-height: 680px) {
    .guardian-content {
        padding: 10px 14px;
    }

    .guardian-symbol {
        font-size: 27px;
    }

    .guardian-label {
        margin: 2px 0;
        font-size: 10px;
    }

    .guardian-content h1 {
        font-size: clamp(22px, 4.2vh, 29px);
        margin: 3px 0 6px;
    }

    .guardian-divider {
        margin-bottom: 7px;
    }

    .guardian-content > p {
        font-size: 11px;
        line-height: 1.22;
        margin: 3px auto;
    }

    .guardian-final-text {
        margin-top: 7px !important;
    }

    .guardian-title {
        margin: 7px auto 4px;
        padding: 6px;
        font-size: 11px;
        line-height: 1.2;
    }

    .guardian-return-button {
        margin-top: 7px;
        padding: 7px 10px;
        font-size: 11px;
    }
}

/* =====================================================
   PEACE RESTORED — GUARDIAN-STYLE ANIMATION
   ===================================================== */

/* Cinematic entrance for the entire Peace ending */
.peace-screen {
    animation: guardianAppear 1.2s ease-out both;
}

/* Give the peace symbol the Guardian's magical glow */
.peace-icon {
    animation: guardianGlow 2.5s ease-in-out infinite;
}

/* =====================================================
   FOLLOW THE FIREFLY — SUBTLE MAIN-CHOICE LINK
   ===================================================== */

.firefly-invitation {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 13px auto 0;
}

.firefly-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 8px 15px;
    border: 1px solid rgba(222, 207, 151, .25);
    border-radius: 999px;
    background: rgba(11, 28, 19, .40);
    color: #e8e1c7;
    text-decoration: none;
    text-align: left;
    transition:
        background .25s ease,
        border-color .25s ease,
        box-shadow .25s ease,
        transform .25s ease;
    animation: fireflyInvitationGlow 4s ease-in-out infinite;
}

.firefly-link:hover {
    background: rgba(34, 58, 36, .72);
    border-color: rgba(237, 217, 155, .58);
    box-shadow: 0 0 18px rgba(226, 207, 133, .12);
    transform: translateY(-1px);
}

.firefly-link:focus-visible {
    outline: 2px solid #e8dba5;
    outline-offset: 4px;
}

.firefly-link-icon {
    color: #f0d991;
    font-size: 17px;
    line-height: 1;
    text-shadow: 0 0 9px rgba(241, 214, 128, .42);
}

.firefly-link-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.firefly-link-copy strong {
    color: #f0e5c4;
    font-family: "Cinzel", serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .025em;
}

.firefly-link-copy small {
    color: #bfcbb5;
    font-family: "Lora", serif;
    font-size: 10px;
}

.firefly-link-arrow {
    margin-left: 3px;
    color: #c7cda8;
    font-size: 12px;
    opacity: .7;
    transition: transform .2s ease, opacity .2s ease;
}

.firefly-link:hover .firefly-link-arrow {
    transform: translate(2px, -2px);
    opacity: 1;
}

@keyframes fireflyInvitationGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(226, 207, 133, 0);
    }
    50% {
        box-shadow: 0 0 12px rgba(226, 207, 133, .055);
    }
}

@media (max-width: 600px) {
    .firefly-invitation {
        margin-top: 10px;
    }

    .firefly-link {
        padding: 7px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .firefly-link {
        animation: none;
    }
}
/* THE LOST FOREST — subtle button + frame polish only
   Add this at the VERY END of your existing style.css.
   Does not change backgrounds, images, text, layout, or game logic. */

/* Softer antique-gold frame; keep the existing forest backdrop and panel. */
.story-box {
    border: 1px solid rgba(220, 202, 151, 0.72) !important;
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(238, 222, 174, 0.08),
        inset 0 0 24px rgba(255, 215, 0, 0.025) !important;
}

/* Main path choices and gameplay action buttons. */
.story-box .choices a,
.story-box .left-path-choices a,
.story-box .action-panel button,
.story-box .use-potion-button,
.story-box .buy-potion-button,
.story-box #combat-buttons button,
.story-box .fight-again,
.story-box .back-link,
.story-box .back-button a,
.reset-button {
    border: 1px solid rgba(218, 194, 126, 0.78) !important;
    border-radius: 8px !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 245, 210, 0.10),
        0 3px 9px rgba(0, 0, 0, 0.28) !important;
    transition:
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease,
        transform 180ms ease !important;
}

/* Keep the game's gold identity, but make the path buttons less plasticky. */
.story-box .choices a,
.story-box .left-path-choices a {
    background: linear-gradient(180deg, #d9bd6e 0%, #bda052 100%) !important;
    border-color: rgba(255, 235, 177, 0.88) !important;
    color: #172219 !important;
    text-shadow: none !important;
}

.story-box .choices a:hover,
.story-box .left-path-choices a:hover {
    background: linear-gradient(180deg, #ead18a 0%, #cfb568 100%) !important;
    border-color: #f5e3ae !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.20),
        0 5px 14px rgba(0, 0, 0, 0.35),
        0 0 12px rgba(220, 190, 112, 0.12) !important;
    transform: translateY(-1px) !important;
}

/* A coordinated, quieter finish for the utility and action buttons. */
.story-box .action-panel button,
.story-box .use-potion-button,
.story-box .buy-potion-button,
.story-box #combat-buttons button,
.story-box .fight-again,
.reset-button {
    background-image: linear-gradient(180deg, rgba(43, 67, 48, 0.97), rgba(21, 39, 28, 0.98)) !important;
    border-color: rgba(201, 181, 119, 0.72) !important;
    color: #eee3c3 !important;
}

.story-box .action-panel button:hover,
.story-box .use-potion-button:hover,
.story-box .buy-potion-button:hover,
.story-box #combat-buttons button:hover,
.story-box .fight-again:hover,
.reset-button:hover {
    background-image: linear-gradient(180deg, rgba(61, 87, 59, 0.99), rgba(30, 53, 36, 0.99)) !important;
    border-color: #e4d19a !important;
    color: #fff4d4 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 245, 210, 0.13),
        0 5px 13px rgba(0, 0, 0, 0.35) !important;
    transform: translateY(-1px) !important;
}

.story-box .choices a:active,
.story-box .left-path-choices a:active,
.story-box .action-panel button:active,
.story-box .use-potion-button:active,
.story-box .buy-potion-button:active,
.story-box #combat-buttons button:active,
.story-box .fight-again:active,
.story-box .back-button a:active,
.reset-button:active {
    transform: translateY(0) !important;
}

.story-box .choices a:focus-visible,
.story-box .left-path-choices a:focus-visible,
.story-box .action-panel button:focus-visible,
.story-box .use-potion-button:focus-visible,
.story-box .buy-potion-button:focus-visible,
.story-box #combat-buttons button:focus-visible,
.story-box .fight-again:focus-visible,
.story-box .back-button a:focus-visible,
.reset-button:focus-visible {
    outline: 2px solid #f0dfad !important;
    outline-offset: 3px !important;
}

/* The reset action stays distinct without overpowering the page. */
.reset-button {
    border-color: rgba(190, 135, 113, 0.72) !important;
}
.reset-button:hover {
    border-color: #d7a18b !important;
}

@media (prefers-reduced-motion: reduce) {
    .story-box .choices a,
    .story-box .left-path-choices a,
    .story-box .action-panel button,
    .story-box .use-potion-button,
    .story-box .buy-potion-button,
    .story-box #combat-buttons button,
    .story-box .fight-again,
    .story-box .back-button a,
    .reset-button {
        transition: none !important;
    }
}

/* Back navigation remains secondary, but gets a deliberate hit area. */
.story-box .back-button a,
.story-box .back-link {
    display: inline-block !important;
    padding: 7px 12px !important;
    background: rgba(17, 32, 23, 0.52) !important;
    border-color: rgba(192, 179, 133, 0.48) !important;
    color: #d9d8c9 !important;
    text-decoration: none !important;
}

.story-box .back-button a:hover,
.story-box .back-link:hover {
    background: rgba(45, 65, 47, 0.72) !important;
    border-color: rgba(226, 207, 150, 0.82) !important;
    color: #f1e4b9 !important;
}
root {
    --forest-ink: #09150f;
    --forest-panel: rgba(13, 29, 21, 0.94);
    --forest-panel-soft: rgba(23, 43, 31, 0.70);
    --forest-line: rgba(210, 199, 150, 0.20);
    --forest-line-strong: rgba(218, 202, 143, 0.42);
    --forest-gold: #dfd09a;
    --forest-gold-bright: #f1e5bc;
    --forest-text: #e9e5d7;
    --forest-muted: #b5c0ad;
    --forest-dim: #849583;
    --forest-serif: "Lora", Georgia, serif;
    --forest-display: "Cinzel", Georgia, serif;
}

html { min-height: 100%; background: var(--forest-ink); }
body.forest-page {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: clamp(22px, 4vw, 54px) clamp(14px, 3vw, 34px);
    overflow-x: hidden;
    color: var(--forest-text);
    font-family: var(--forest-serif);
    background:
        radial-gradient(ellipse at 50% -12%, rgba(94, 124, 76, 0.24), transparent 52%),
        radial-gradient(ellipse at 5% 78%, rgba(37, 76, 48, 0.18), transparent 38%),
        radial-gradient(ellipse at 98% 55%, rgba(113, 100, 57, 0.10), transparent 34%),
        linear-gradient(150deg, #08140e 0%, #102219 48%, #0a1710 100%);
    background-attachment: fixed;
}
body.forest-page::before {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    inset: 13px;
    border: 1px solid rgba(218, 207, 166, 0.10);
    border-radius: 17px;
}
body.forest-page::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    width: min(62vw, 680px);
    height: min(62vw, 680px);
    right: -24vw;
    top: -30vw;
    border: 1px solid rgba(219, 204, 151, 0.06);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(219, 204, 151, 0.018), 0 0 0 65px rgba(219, 204, 151, 0.015);
}
body.forest-page--deep {
    background:
        radial-gradient(ellipse at 50% -12%, rgba(90, 111, 82, 0.17), transparent 52%),
        radial-gradient(ellipse at 10% 82%, rgba(45, 77, 57, 0.16), transparent 40%),
        linear-gradient(150deg, #07110d 0%, #102018 51%, #09150f 100%);
}
body.forest-page--conifer {
    background:
        radial-gradient(ellipse at 72% -8%, rgba(155, 129, 68, 0.17), transparent 48%),
        radial-gradient(ellipse at 8% 82%, rgba(51, 93, 56, 0.17), transparent 40%),
        linear-gradient(150deg, #0a1710 0%, #17281b 50%, #0b1710 100%);
}

body.forest-page .story-box {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(780px, 100%);
    max-width: 780px;
    margin: auto;
    padding: clamp(22px, 4.4vw, 46px);
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--forest-line-strong);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(19, 39, 27, 0.96), var(--forest-panel) 54%, rgba(11, 25, 18, 0.97));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(245, 235, 196, 0.055);
    backdrop-filter: blur(12px);
}
body.forest-page .story-box::before {
    content: "";
    position: absolute;
    pointer-events: none;
    inset: 9px;
    border: 1px solid rgba(224, 213, 172, 0.075);
    border-radius: 13px;
}
body.forest-page .story-box > * { position: relative; }

body.forest-page .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 14px;
    padding: 0;
}
body.forest-page .stats p {
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 7px;
    border: 1px solid rgba(204, 199, 160, 0.13);
    border-radius: 10px;
    background: rgba(3, 12, 8, 0.23);
    color: #d9decf;
    font-family: var(--forest-serif);
    font-size: clamp(10px, 1.4vw, 12px);
    line-height: 1.5;
    white-space: normal;
}
body.forest-page .stats p::first-letter { color: var(--forest-gold); }
body.forest-page .utility-row {
    display: flex;
    justify-content: center;
    margin: 0 0 20px;
}
body.forest-page .use-potion-button,
body.forest-page .action-panel button,
body.forest-page .reset-button {
    border: 1px solid rgba(218, 204, 151, 0.28);
    border-radius: 9px;
    background: rgba(17, 37, 25, 0.88);
    color: #e5dfc9;
    font-family: var(--forest-display);
    font-size: 11px;
    letter-spacing: 0.035em;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
body.forest-page .use-potion-button { padding: 9px 15px; }
body.forest-page .use-potion-button:hover,
body.forest-page .action-panel button:hover,
body.forest-page .reset-button:hover {
    transform: translateY(-1px);
    border-color: rgba(233, 217, 160, 0.57);
    background: rgba(45, 68, 43, 0.92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}
body.forest-page button:focus-visible,
body.forest-page a:focus-visible,
body.forest-page summary:focus-visible {
    outline: 2px solid #f0df9d;
    outline-offset: 4px;
}

body.forest-page .story-header { margin: 0 auto 19px; }
body.forest-page .story-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 0 0 13px;
    color: #b8bd91;
    font-family: var(--forest-display);
    font-size: 9px;
    letter-spacing: 0.21em;
    line-height: 1.7;
}
body.forest-page .story-eyebrow span { color: #d5c58a; font-size: 10px; }
body.forest-page h1 {
    margin: 0 auto;
    color: var(--forest-gold-bright);
    font-family: var(--forest-display);
    font-size: clamp(29px, 5vw, 47px);
    font-weight: 500;
    letter-spacing: 0.035em;
    line-height: 1.22;
    text-wrap: balance;
    text-shadow: 0 4px 30px rgba(213, 195, 126, 0.10);
}
body.forest-page .story-deck {
    max-width: 47ch;
    margin: 13px auto 0;
    color: #b9c3ae;
    font-size: clamp(13px, 1.8vw, 15px);
    font-style: italic;
    line-height: 1.75;
}
body.forest-page .story-prose {
    max-width: 60ch;
    margin: 20px auto 0;
}
body.forest-page .story-prose p {
    margin: 0 auto 11px;
    color: #dddccf;
    font-family: var(--forest-serif);
    font-size: clamp(14px, 1.9vw, 16px);
    font-weight: 400;
    line-height: 1.9;
    text-wrap: pretty;
}
body.forest-page .story-prose p:last-child { margin-bottom: 0; }
body.forest-page .path-section { margin-top: 27px; }
body.forest-page .section-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 13px;
}
body.forest-page .section-heading h2 {
    flex: 0 0 auto;
    margin: 0;
    color: #c8c6a2;
    font-family: var(--forest-display);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    line-height: 1.6;
    text-transform: uppercase;
}
body.forest-page .section-rule { width: min(68px, 13%); height: 1px; background: linear-gradient(90deg, transparent, rgba(213, 200, 145, 0.43)); }
body.forest-page .section-rule:last-child { transform: rotate(180deg); }
body.forest-page .choices.choices--paths {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
}
body.forest-page .choice-card {
    display: flex;
    align-items: center;
    gap: 13px;
    box-sizing: border-box;
    min-width: 0;
    min-height: 84px;
    padding: 16px 15px;
    border: 1px solid rgba(202, 202, 157, 0.22);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 59, 39, 0.62), rgba(11, 25, 17, 0.68));
    color: var(--forest-text);
    text-align: left;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(245, 239, 205, 0.025);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
body.forest-page .choice-card:hover {
    transform: translateY(-3px);
    border-color: rgba(228, 211, 151, 0.53);
    background: linear-gradient(135deg, rgba(51, 76, 47, 0.78), rgba(17, 36, 23, 0.85));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.17), inset 0 1px 0 rgba(245, 239, 205, 0.06);
}
body.forest-page .choice-symbol {
    display: grid;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 1px solid rgba(218, 204, 151, 0.20);
    border-radius: 50%;
    background: rgba(4, 15, 9, 0.27);
    color: var(--forest-gold);
    font-size: 21px;
}
body.forest-page .choice-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
body.forest-page .choice-copy strong { color: #eee5c9; font-family: var(--forest-display); font-size: clamp(10px, 1.45vw, 12px); font-weight: 500; line-height: 1.5; }
body.forest-page .choice-copy small { color: #aebaaa; font-family: var(--forest-serif); font-size: 11px; line-height: 1.55; }
body.forest-page .choice-arrow { flex: 0 0 auto; align-self: flex-start; color: #c5bd92; font-size: 13px; opacity: 0.68; transition: transform 180ms ease, opacity 180ms ease; }
body.forest-page .choice-card:hover .choice-arrow { transform: translate(2px, -2px); opacity: 1; }
body.forest-page .choice-card--danger .choice-symbol { color: #d3b49a; border-color: rgba(179, 121, 88, 0.28); }
body.forest-page .choice-card--lantern .choice-symbol,
body.forest-page .choice-card--sunlit .choice-symbol,
body.forest-page .choice-card--discovery .choice-symbol { color: #e4d296; }
body.forest-page .choice-card--gate { border-color: rgba(194, 171, 110, 0.31); }

body.forest-page .discoveries { margin-top: 24px; }
body.forest-page .section-heading--quiet { margin-bottom: 10px; }
body.forest-page .section-heading--quiet h2 { color: #9da990; font-size: 9px; letter-spacing: 0.12em; }
body.forest-page .section-heading--quiet .section-rule { opacity: 0.66; }
body.forest-page .game-firefly-invitation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
}
body.forest-page .game-firefly-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    padding: 12px 10px;
    border: 1px solid rgba(207, 202, 160, 0.15);
    border-radius: 10px;
    background: rgba(5, 17, 10, 0.28);
    color: #e4dfca;
    text-align: left;
    text-decoration: none;
    animation: none;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
body.forest-page .game-firefly-link:hover { transform: translateY(-2px); border-color: rgba(222, 208, 154, 0.42); background: rgba(37, 60, 39, 0.53); box-shadow: none; }
body.forest-page .game-firefly-icon { flex: 0 0 auto; color: #d8c98f; font-size: 18px; line-height: 1; text-shadow: 0 0 12px rgba(232, 209, 133, 0.18); animation: none; }
body.forest-page .game-firefly-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
body.forest-page .game-firefly-copy strong { color: #ded9c1; font-family: var(--forest-display); font-size: 9px; font-weight: 500; line-height: 1.5; }
body.forest-page .game-firefly-copy small { color: #98a895; font-family: var(--forest-serif); font-size: 10px; line-height: 1.45; }
body.forest-page .game-firefly-arrow { flex: 0 0 auto; color: #bdb58b; font-size: 12px; opacity: 0.7; }

body.forest-page .gate-warning {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    max-width: 56ch;
    margin: 24px auto 0;
    padding: 15px 17px;
    border: 1px solid rgba(190, 159, 99, 0.34);
    border-left: 2px solid rgba(211, 181, 116, 0.70);
    border-radius: 10px;
    background: linear-gradient(100deg, rgba(102, 78, 40, 0.17), rgba(17, 32, 21, 0.28));
    text-align: left;
}
body.forest-page .gate-warning__mark { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(211, 181, 116, 0.22); border-radius: 8px; color: #e1c988; font-size: 18px; }
body.forest-page .gate-warning__label { margin: 0 0 4px; color: #d4bf86; font-family: var(--forest-display); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
body.forest-page .gate-warning__text { margin: 0; color: #c8c7b5; font-size: 12px; line-height: 1.7; }
body.forest-page .gate-warning__text strong { color: #e9dfc2; font-weight: 600; }

body.forest-page .actions-disclosure { margin-top: 23px; border-top: 1px solid rgba(204, 199, 160, 0.12); padding-top: 16px; text-align: left; }
body.forest-page .actions-disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #aeb69e; cursor: pointer; font-family: var(--forest-display); font-size: 10px; letter-spacing: 0.09em; list-style: none; }
body.forest-page .actions-disclosure summary::-webkit-details-marker { display: none; }
body.forest-page .actions-disclosure summary span { color: var(--forest-gold); font-size: 17px; transition: transform 180ms ease; }
body.forest-page .actions-disclosure[open] summary span { transform: rotate(45deg); }
body.forest-page .action-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin-top: 13px; }
body.forest-page .action-panel button { min-height: 41px; padding: 9px 10px; font-size: 10px; }
body.forest-page .back-navigation { margin-top: 27px; padding-top: 18px; border-top: 1px solid rgba(204, 199, 160, 0.12); }
body.forest-page .back-navigation a { display: inline-flex; align-items: center; gap: 9px; color: #aebaa5; font-family: var(--forest-display); font-size: 10px; letter-spacing: 0.04em; text-decoration: none; transition: color 180ms ease; }
body.forest-page .back-navigation a:hover { color: var(--forest-gold-bright); }
body.forest-page .back-navigation a span { color: #d4c58e; font-size: 15px; }

body.forest-page .reset-button {
    position: relative;
    z-index: 1;
    align-self: center;
    margin: 18px auto 0;
    padding: 9px 14px;
    font-size: 10px;
    background: rgba(7, 18, 12, 0.68);
}
body.forest-page #notification {
    z-index: 9500;
    font-family: var(--forest-serif);
}

@media (max-width: 640px) {
    body.forest-page { justify-content: flex-start; padding: 18px 12px 26px; }
    body.forest-page::before { inset: 7px; border-radius: 12px; }
    body.forest-page .story-box { padding: 23px 17px; border-radius: 15px; }
    body.forest-page .story-box::before { inset: 6px; border-radius: 10px; }
    body.forest-page .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    body.forest-page .stats p { padding: 9px 7px; font-size: 11px; }
    body.forest-page .story-eyebrow { font-size: 8px; letter-spacing: 0.14em; gap: 7px; }
    body.forest-page .story-header { margin-bottom: 16px; }
    body.forest-page .story-prose { margin-top: 17px; }
    body.forest-page .path-section { margin-top: 23px; }
    body.forest-page .choices.choices--paths { gap: 8px; }
    body.forest-page .choice-card { align-items: flex-start; gap: 9px; min-height: 88px; padding: 12px 10px; }
    body.forest-page .choice-symbol { flex-basis: 29px; width: 29px; height: 29px; font-size: 17px; }
    body.forest-page .choice-copy strong { font-size: 9px; }
    body.forest-page .choice-copy small { font-size: 10px; }
    body.forest-page .choice-arrow { font-size: 11px; }
    body.forest-page .game-firefly-invitation { grid-template-columns: 1fr; }
    body.forest-page .game-firefly-link { padding: 11px 12px; }
    body.forest-page .game-firefly-copy strong { font-size: 10px; }
    body.forest-page .game-firefly-copy small { font-size: 10px; }
}
@media (max-width: 390px) {
    body.forest-page .choices.choices--paths { grid-template-columns: 1fr; }
    body.forest-page .choice-card { min-height: 70px; align-items: center; }
    body.forest-page .section-heading { gap: 7px; }
    body.forest-page .section-heading h2 { font-size: 9px; letter-spacing: 0.08em; }
}
@media (max-height: 740px) and (min-width: 641px) {
    body.forest-page { justify-content: flex-start; }
    body.forest-page .story-box { padding-top: 26px; padding-bottom: 26px; }
    body.forest-page .story-header { margin-bottom: 14px; }
    body.forest-page .path-section { margin-top: 20px; }
    body.forest-page .game-firefly-link { padding-top: 9px; padding-bottom: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    body.forest-page *, body.forest-page *::before, body.forest-page *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
