@font-face {
    font-family: UIFont;
    src: url("../demomedia/demofonts/garamond/EBGaramond-Medium.ttf");
    font-display: swap;
  }

  @font-face {
    font-family: Step1Font;
    src: url("../demomedia/demofonts/playfair/PlayfairDisplay-Regular.ttf");
    font-display: swap;
  }

  @font-face {
    font-family: bookFont;
    src: url("../demomedia/demofonts/playfair/PlayfairDisplay-Italic.ttf");
    font-display: swap;
  }

*{
    margin: 0;
    padding:0
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* background-image: url("demomedia/storydemomedia/StoryDemo_1.jpeg");
    object-fit: cover; */
}

#story_bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#story_bg_img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    /* filter: brightness();  */
    /* mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 1) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 1) 100%); */
}

/* Specific styling for non-initial background states */
#story_bg_img[src*="story_bg.png"] {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-position: center;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

#story_bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

#text_step_1 {
    position: absolute;
    top: 10%;
    left: 0;
    right: 0;
    margin: auto;
    width: 80%;
    font-family: Step1Font;
    font-size: 28px;
    color: #fff;
    letter-spacing: 1.2;
}

.step1choice {
    position: absolute;
    font-family: UIFont;
    z-index: 10;
    top: 30%;
    width: 20%;
    /* height: 50px; */
    font-family: UIFont;
    /* background: linear-gradient(120deg, #5a2a0c, #793a14, #5a2a0c); Simulated mahogany grain */
    background-image: url("../demomedia/storydemomedia/mahogoany.avif");
    color: #cfa880; /* Goldish text for contrast */
    font-size: 18px;
    font-weight: bold;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-transform: uppercase;
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.5),  /* Engraved inner shadow */
        inset -4px -4px 8px rgba(255, 255, 255, 0.2), /* Subtle light reflection */
        2px 2px 5px rgba(0, 0, 0, 0.7); /* Beveled outer shadow */
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.8); /* Embossed text effect */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.step1choice:hover {
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.7),  /* Deeper inner shadow for pressed effect */
        inset -6px -6px 12px rgba(255, 255, 255, 0.1); 
    transform: translateY(2px); /* Simulate button press */
    text-shadow: 0 0 1px #ffcc00, 0 0 1px #ffcc00, 0 0 2px #ff9900;
}


#choice_1_1 {
    left: 5%
}

#choice_1_2 {
    left: 0;
    right: 0;
    margin: auto;
}

#choice_1_3 {
    right: 5%
}

#storyText, .choice, #storyImg, #instText {
    position: absolute;
    z-index: 10;
    font-family: bookFont;
    font-size: 28px;
}

#storyText {
    color: #4a2200;
    top: 20%;
    /* left: 20%; */
    width: 30%;
    
    line-height: 40px;
}

#instText {
    top: 50%;
    /* left: 20%; */
    width: 30%;
    color: #4a2200;
    line-height: 40px;
}

#storyImg {
    top: 25%;
    right: 45%;
    width: auto;
    height: 75%;
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
    mix-blend-mode: darken;
    border: 4px solid #cfa880;
    border-image: repeating-linear-gradient(
        45deg,
        #cfa880 0px,
        #cfa880 3px,
        #8B6914 3px,
        #8B6914 6px,
        #DAA520 6px,
        #DAA520 9px,
        #cfa880 9px,
        #cfa880 12px
    ) 4;
    box-sizing: border-box;
}

.choice {
    bottom: 20%;

}

#choice_1 {
    left: 20%;
    width: 10%;
}

#choice_2 {
    left: 32%;
    width: 10%;
}

.illuminated-button {
    font-family: 'Uncial Antiqua', serif; /* Medieval-style font */
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    padding: 12px 20px;
    display: inline-block;
    /* border: 3px solid #8B0000; 
    border-radius: 8px;
    background: linear-gradient(145deg, #e6c07b, #c09f60);  */
    color: #4a2200; /* Deep brown for ink */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    /* box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); */
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}


/* Hover effect */
.illuminated-button:hover {
    /* background: linear-gradient(145deg, #f0d090, #c09f60);  */
    color: #5b1b00; /* Darker ink */
    /* border-color: #5b1b00;  */
    text-shadow: 2px 2px 3px #cfa880;
}

/* Glowing effect on hover */
.illuminated-button:hover::before {
    opacity: 1;
}

/* Pressed effect */
.illuminated-button:active {
    box-shadow: inset 2px 2px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(2px);
}

/* Story Menu Styles */
#storyMenu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 250px;
    background: rgba(26, 20, 15, 0.9);
    border-right: 2px solid #cfa880;
    transform: translateX(-250px);
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

#storyMenu:hover,
#storyMenu.open {
    transform: translateX(0);
}

#menuToggle {
    position: fixed;
    left: 10px;
    top: 10px;
    font-size: 30px;
    color: #cfa880;
    cursor: pointer;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    background: rgba(26, 20, 15, 0.9);
    border-radius: 5px;
    z-index: 102;
    transition: transform 0.3s ease;
}

body.menu-open #menuToggle {
    transform: translateX(250px);
}

#menuContent {
    padding: 15px;
    height: calc(100% - 30px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cfa880 rgba(26, 20, 15, 0.5);
}

#menuContent::-webkit-scrollbar {
    width: 8px;
}

#menuContent::-webkit-scrollbar-track {
    background: rgba(26, 20, 15, 0.5);
}

#menuContent::-webkit-scrollbar-thumb {
    background-color: #cfa880;
    border-radius: 4px;
}

.menu-branch {
    margin-bottom: 10px;
}

.branch-header {
    font-family: UIFont;
    color: #cfa880;
    padding: 12px 15px;
    background: rgba(90, 42, 12, 0.8);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    position: relative;
}

.branch-header::after {
    content: '▶';
    position: absolute;
    right: 15px;
    transition: transform 0.2s ease;
}

.menu-branch.expanded .branch-header::after {
    transform: rotate(90deg);
}

.branch-header:hover {
    background: rgba(121, 58, 20, 0.9);
    transform: translateX(3px);
}

.branch-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 15px;
}

.menu-branch.expanded .branch-content {
    max-height: 500px;
}

.menu-item {
    font-family: UIFont;
    color: #cfa880;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(90, 42, 12, 0.6);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

.menu-item:hover {
    background: rgba(121, 58, 20, 0.8);
    transform: translateX(5px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.child-item {
    margin-left: 0;
}

.grand-child-item {
    margin-left: 15px;
    background: rgba(90, 42, 12, 0.4);
    font-size: 13px;
}

.library-item {
    margin-bottom: 15px;
    background: rgba(121, 58, 20, 0.9);
    font-weight: bold;
    border: 1px solid #cfa880;
}

.menu-item.visited {
    background: rgba(60, 30, 10, 0.8) !important;
    color: #b8956f !important;
    border-left: 3px solid #8B6914 !important;
}

.branch-header.visited {
    background: rgba(80, 40, 15, 0.9) !important;
    color: #b8956f !important;
    border-left: 3px solid #8B6914 !important;
}

.library-item.visited {
    background: rgba(80, 40, 15, 0.9) !important;
    color: #b8956f !important;
    border-left: 3px solid #8B6914 !important;
}

#conclusionBtn {
    top: 80%;
    left: 56%;
    width: 16%;
    text-align: center;
    height: 16px;
    /* padding: 12px 20px; */
    /* background: linear-gradient(145deg, #FFD700, #DAA520); */
    background-color: #2F1B14;
    border: 2px solid #B8860B;
    color: #cfa880;
    font-weight: bold;
}

.conclusion-item {
    background: rgba(255, 215, 0, 0.2) !important;
    color: #FFD700 !important;
    border: 1px solid #DAA520 !important;
    font-weight: bold;
}

.choice.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.menu-item.active {
    background: rgba(207, 168, 128, 0.9) !important;
    color: #2F1B14 !important;
    border-left: 4px solid #FFD700 !important;
}

.branch-header.active {
    background: rgba(207, 168, 128, 0.9) !important;
    color: #2F1B14 !important;
    border-left: 4px solid #FFD700 !important;
}

/* Laptop/Desktop Breakpoint */
@media screen and (min-height: 801px) {
    #text_step_1 {
        top: 12%;
        font-size: 32px;
        width: 75%;
        letter-spacing: 1.5px;
    }
    
    .step1choice {
        top: 35%;
        width: 18%;
        font-size: 20px;
        padding: 15px 30px;
    }
    
    #storyText {
        top: 20%;
        left: 8.5%;
        width: 37%;
        font-size: 28px;
        line-height: 40px;
    }
    
    #instText {
        top: 50%;
        left: 8.5%;
        width: 37%;
        font-size: 24px;
        line-height: 36px;
    }
    
    #storyImg {
        top: 8%;
        left: 56%;
        width: 30%;
        height: auto;
    }
    
    .choice {
        bottom: 20%;
        font-size: 18px;
    }
    
    #choice_1 {
        left: 8.5%;
        width: 15%;
    }
    
    #choice_2 {
        left: 30%;
        width: 15%;
    }
}

/* Tablet Landscape Breakpoint */
@media screen and (min-height: 501px) and (max-height: 800px) and (orientation: landscape) {
    #text_step_1 {
        top: 8%;
        font-size: 24px;
        width: 85%;
    }
    
    .step1choice {
        top: 32%;
        width: 22%;
        font-size: 16px;
        padding: 10px 20px;
    }
    
    #storyText {
        top: 15%;
        left: 5%;
        width: 35%;
        font-size: 22px;
        line-height: 32px;
    }
    
    #instText {
        top: 45%;
        left: 5%;
        width: 35%;
        font-size: 20px;
        line-height: 28px;
    }
    
    #storyImg {
        top: 6%;
        left: 54%;
        width: 35%;
        height: auto;
    }
    
    .choice {
        bottom: 15%;
        font-size: 16px;
    }
    
    #choice_1 {
        left: 5%;
        width: 18%;
    }
    
    #choice_2 {
        left: 25%;
        width: 18%;
    }
}

/* Phone Landscape Breakpoint */
@media screen and (max-height: 500px) and (orientation: landscape) {
    #text_step_1 {
        top: 5%;
        font-size: 20px;
        width: 90%;
    }
    
    .step1choice {
        top: 35%;
        width: 25%;
        font-size: 14px;
        padding: 8px 16px;
    }
    
    #storyText {
        top: 10%;
        right: 54%;
        width: 35%;
        font-size: 16px;
        line-height: 18px;
    }
    
    #instText {
        top: 42%;
        right: 54%;
        width: 35%;
        font-size: 16px;
        line-height: 18px;
    }
    
    #storyImg {
        top: 7%;
        left: 54%;
        width: 31%;
        height: auto;
    }
    
    .choice {
        bottom: 10%;
        font-size: 14px;
        width: 10%
    }
    
    #choice_1 {
        left: 11%;
        width: 15%;
    }
    
    #choice_2 {
        left: 29%;
        width: 15%;
    }
}
