*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    /* ---- Cozy candlelit-library palette ---- */
    --bg-base:        #16110d;   /* espresso black */
    --bg-elevated:     #201812;   /* panel base */
    --bg-panel:        #2a2018;   /* raised card */
    --bg-panel-soft:   rgba(42, 32, 24, 0.55);

    --accent:          #e0a458;   /* warm amber */
    --accent-hover:    #f2bd75;   /* lit amber */
    --accent-deep:     #c9713f;   /* terracotta */
    --accent-ember:    #b5502f;   /* deep ember, for danger/emphasis */

    --text-primary:    #f3e8d8;   /* warm cream */
    --text-muted:      #cbb79f;   /* soft tan */
    --text-faint:      #9c8871;

    --border-warm:     rgba(224, 164, 88, 0.35);
    --border-soft:     rgba(243, 232, 216, 0.12);
    --glow-amber:      0 0 28px rgba(224, 164, 88, 0.16);
    --shadow-deep:      0 12px 32px rgba(0, 0, 0, 0.45);

    --clr-base: #16110d;
    --clr-base1: #e0a458;
    --clr-base2: #2a2018;
    --clr-secondary: #e0a458;
    --clr-secondary1: #f2bd75;
    --clr-secondary2: #d99a55;
    --clr-accent: #c9713f;
    --clr-white1: #f3e8d8;
    --clr-black1: #16110d;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
}

body{
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(320px, 100vw, 100%);
    gap: 0.2rem;
    min-height: 100dvh;
    height: auto;
    color: var(--text-primary);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(224, 164, 88, 0.07), transparent 55%),
        radial-gradient(ellipse at 85% 30%, rgba(201, 113, 63, 0.06), transparent 50%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 6px);
    background-attachment: fixed;
    background-size: cover, cover, auto;
}

.header1{
    width: 100%;
    height: 80px;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--border-warm);
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
}
.footer1{
    width: 100%;
    height: 80px;
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--border-warm);
}
.title_container{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    width: clamp(100px, 90vw, 250px);
    height: 60px;
}
.head_title{
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    width: clamp(250px, 100%, 150px);
}
.logo1{
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--accent-hover), var(--accent-deep));
    color: #1a130d;
    box-shadow: 0 0 0 3px rgba(224, 164, 88, 0.25), var(--glow-amber);
    border-radius: 0.6rem;
    font-family: var(--font-display);
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    font-size: 2rem;
} .logo1 span:nth-child(1){
    display: inline-block;
    transform: scaleX(-1);
} .logo1 span:nth-child(2){
    font-size: 1.5rem;
    transform: translateY(2px);
}

.home_container{
    width: 100%;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.main_container{
    position: relative;
    background: linear-gradient(155deg, var(--bg-panel) 0%, var(--bg-elevated) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-warm);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-deep), var(--glow-amber);
    width: min(700px, 95%);
    max-width: 100%;
    height: clamp(100px, 50vh, 300px);
}

.container1{
    display: flex;
    width: 100%;
    height: 90%;
    margin: 1rem;
    gap: 1rem;
}

.createRev_btn, .review_btn{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    gap: 1rem;
    cursor: pointer;
    border-radius: 1rem;
    color: var(--text-primary);
    fill: var(--text-primary);

    transition: background-color 0.35s ease, box-shadow 0.35s ease, transform 0.15s ease;
}

.createRev_btn h5, .review_btn h5{
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.06em;
    transition: font-size 0.25s ease, font-weight 0.25s ease, color 0.25s ease;
}

.createRev_btn:active h5, .review_btn:active h5{
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-hover);
}

.createRev_btn:active, .review_btn:active{
    transform: scale(0.98);
}

.createRev_btn:hover, .review_btn:hover{
    background-color: rgba(224, 164, 88, 0.08);
    box-shadow: inset 0 0 0 1px var(--border-warm);
}

.createRev_btn:hover h5, .review_btn:hover h5{
    color: var(--accent-hover);
}

.createRev_btn:hover .createRev_svg, .review_btn:hover .review_svg{
    fill: var(--accent-hover);
}

.createRev_svg{
    width: 40%;
    height: 40%;
    fill: var(--accent);
    transition: fill 0.25s ease;
}

.review_svg{
    width: 40%;
    height: 40%;
    fill: var(--accent);
    transition: fill 0.25s ease;
}
/* --------TEXT AREA----------- */

.input_rev{
    position: absolute;
    opacity: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 0;
    height: 0;
    gap: 1rem;

    transition: opacity 0.5s ease, transform 0.5s ease;
} .input_rev.inputRevFade{
    opacity: 1;
    width: min(700px, 95%);
    max-width: 100%;
    height: clamp(100px, 50vh, 700px);
    border: 1px solid var(--border-warm);
    border-radius: 1.25rem;
    backdrop-filter: blur(14px);
    background-color: var(--bg-panel-soft);
    box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.06);
}

.inputRev_container{
    display: flex;
    flex-direction: row-reverse;
    height: 100%;
    width: 100%;
    gap: 1rem;
    padding: 1rem;
}

.input_rev_head{
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    color: var(--accent);
    background-color: transparent;
    border-bottom: 1px solid var(--border-warm);
    padding-bottom: 0.6rem;
    width: 100%;
    text-align: center;
}

.textInput{
    width: 70%;
    background-color: rgba(22, 17, 13, 0.55);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    border-radius: 0.6rem;
    padding: 0.8rem;
    font-family: var(--font-body);
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
} .textInput::placeholder{
    color: var(--text-faint);
} .textInput:focus{
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224, 164, 88, 0.12);
} .textInput.textInputToggle{
    width: 70%;
    height: 100%;
    display: inline-block;
} .textInput.textInputToggleClose{
    width: 0;
    height: 0;
    display: none;
}

.inputRev_btns{
    width: 30%;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    gap: 0.6rem;
}

.save_btn{
    opacity: 0;
    height: 0;
    display: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #1a130d;
    background: linear-gradient(160deg, var(--accent-hover), var(--accent));
    border: none;
    border-radius: 0.6rem;
    box-shadow: var(--glow-amber);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
} .save_btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(224, 164, 88, 0.32);
} .save_btn:active{
    transform: scale(0.97);
}

.clip_btn, .closeInputRev_btn{
    height: 34px;
    opacity: 0;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    color: #1a130d;
    background-color: var(--accent-deep);
    border: none;
    border-radius: 0.6rem;
    transition: background-color 0.2s ease, transform 0.15s ease;
} .clip_btn:hover, .closeInputRev_btn:hover{
    background-color: var(--accent-hover);
} .clip_btn:active, .closeInputRev_btn:active{
    transform: scale(0.97);
} .clip_btn.clipButtonFade, .closeInputRev_btn.clipButtonFade{
    opacity: 1;
}

.clip_area{
    color: var(--text-primary);
    line-height: 1.9;
}

.clip_area .word-btn{
    cursor: pointer;
    color: var(--text-primary);
    background: transparent;
    border: none;
    font: inherit;
    border-radius: 0.25rem;
    padding: 0 0.1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
} .clip_area .word-btn:hover{
    background-color: rgba(224, 164, 88, 0.15);
} .word-btn.selected{
    text-decoration: underline;
    text-decoration-color: var(--accent);
    color: var(--accent-hover);
    background-color: rgba(224, 164, 88, 0.18);
} .clip_area.clipAreaToggle{
    width: 100%;
    height: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-soft);
    border-radius: 0.6rem;
    overflow-y: auto;
} .clip_area.clipAreaToggleOff{
    width: 0px;
    border: none;
}

/* --------------------REVIEW SECTION---------------- */

.start_review{
    position: absolute;

    flex-direction: column;
    align-items: center;
    opacity: 0;
    width: 0%;
    height: 0%;
    border-radius: 1.25rem;

    color: var(--text-primary);
    background-color: var(--bg-elevated);

    transition: opacity 0.45s ease, transform 0.45s ease;
} .start_review.startRevFade{
    z-index: 2;
    opacity: 1;
    width: clamp(320px, 95vw, 1000px);
    height: clamp(120px, 95vh, 700px);
    border: 1px solid var(--border-warm);
    box-shadow: var(--shadow-deep), var(--glow-amber);
}

.head_section{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    width: 100%;
    height: 20%;
    border-bottom: 1px solid var(--border-soft);
}
.progress-info{
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 1.4rem;
}

.question_area{
    overflow-y: auto;
    hyphens: auto;
    align-items: center;
    text-indent: 1rem;
    padding: 1rem;
    margin-left: 2rem;
    margin-right: 2rem;
    width: 90%;
    height: 90%;
    line-height: 1.7;
    color: var(--text-primary);
    font-size: clamp(1rem, 3vw, 2.5rem);
}

.results-container{
    padding: 15px 0;
    font-family: var(--font-body);
    font-size: clamp(1rem, 1vw, 3rem);
    background-color: transparent;
    color: var(--text-primary);
}
.results-container h2{
    font-family: var(--font-display);
    color: var(--accent);
}
.results-container h3{
    color: var(--accent-hover);
}

.question-result{
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent-deep);
    border-radius: 0.6rem;
    background-color: var(--bg-panel-soft);
    padding: 1rem;
    margin: 1rem;
}

.restart-btn{
    font-family: var(--font-body);
    font-weight: 700;
    color: #1a130d;
    background: linear-gradient(160deg, var(--accent-hover), var(--accent));
    cursor: pointer;
    width: 200px;
    height: 40px;
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--glow-amber);
    transition: transform 0.15s ease;
} .restart-btn:hover{
    transform: translateY(-1px);
} .restart-btn:active{
    transform: scale(0.97);
}

.closeStartReview_btn{
    cursor: pointer;
    fill: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform ease 0.2s, fill ease 0.2s;
    left: 95%;
    bottom: 91%;
    width: 50px;
    height: 50px;
} .closeStartReview_btn:hover{
    transform: scale(1.1);
    fill: var(--accent);
}

.paragraphQuestion{
    font-family: var(--font-display);
    font-size: 3rem;
}

.guessInput{
    background-color: transparent;
    color: var(--accent-hover);
    font-family: var(--font-display);
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    border: none;
    border-bottom: 2px solid var(--accent);
    box-shadow: none;
    font-size: 2.5rem;
    outline: none;
    transition: border-color 0.2s ease;

    padding: 0;
    width: 300px;
    height: 50px;
} .guessInput:focus{
    border-bottom-color: var(--accent-hover);
}

.next_skip_btn{
    width: 100%;
    height: auto;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding-bottom: 1rem;
}

.next_question, .skip_question{
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #1a130d;
    font-size: 1.15em;
    width: 130px;
    height: 52px;
    margin: 1rem;
    border: none;
    border-radius: 0.6rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.next_question{
    background: linear-gradient(160deg, var(--accent-hover), var(--accent));
    box-shadow: var(--glow-amber);
} .next_question:hover{
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(224, 164, 88, 0.32);
} .next_question:active{
    transform: scale(0.97);
}

.skip_question{
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
} .skip_question:hover{
    color: var(--text-primary);
    border-color: var(--border-warm);
} .skip_question:active{
    transform: scale(0.97);
}

.saved_notes_container{
    z-index: 1;
    opacity: 0;
    position: absolute;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    width: 0px;
    height: 0px;
    color: var(--text-primary);
    border: 1px solid var(--border-warm);
    border-radius: 1.25rem;
    backdrop-filter: blur(14px);
    background-color: var(--bg-panel-soft);
    box-shadow: var(--shadow-deep);

    transition: opacity ease 0.4s;
} .saved_notes_container.SavedNotesContainerToggle{
    opacity: 1;
    display: flex;
    width: min(1000px, 95%);
    max-width: 100%;
    height: min(600px, 90vh);
    overflow: auto;
} .saved_notes_container.SavedNotesContainerClose{
    width: 0px;
    height: 0px;
    height: 0px;
    opacity: 0;
}

.saved_notes_head{
    width: 100%;
    height: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.6rem;
}

.deleteParagraph_btn, .closeSavedNotes_btn{
    cursor: pointer;
    fill: var(--text-muted);
    width: clamp(10px, 10vw, 30px);
    height: clamp(10px, 10vh, 30px);

    transition: transform ease 0.2s, fill ease 0.2s;
} .deleteParagraph_btn:hover, .closeSavedNotes_btn:hover{
    fill: var(--accent);
    transform: scale(1.1);
} .closeSavedNotes_btn {
    justify-self: end;
}


.saved_notes{
    width: 100%;
    height: 100%;
    padding: 0.4rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.printSelected{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    fill: var(--text-muted);
    color: var(--text-muted);
    width: clamp(250px, 10vw, 30px);
    height: clamp(30px, 10vh, 30px);
    font-size: clamp(0.1rem, 2vw, 1rem);
    border-radius: 0.4rem;
    cursor: pointer;
    transition: transform ease 0.2s, fill ease 0.2s;
} .printSelected:hover{
    transform: scale(1.1);
    fill: var(--accent);
    color: var(--accent);
} .printSelected svg{
    fill: currentColor;
}

.btn_container1{
    display: flex;
    gap: 1rem;
    width: clamp(1px, 50vw, 200px);
}

.head_title_savedNotes{
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    color: var(--accent);
    justify-self: center;
    font-size: clamp(1rem, 2vw, 2rem);
}

/* ------------------------OPTION SECTION---------------------------- */

.option_section{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(700px, 95%);
    max-width: 100%;
    height: auto;
    padding: 0.5rem;
}

.tutorial_btn{
    cursor: pointer;
    fill: var(--text-muted);

    transition: transform ease 0.2s, fill ease 0.2s;
} .tutorial_btn:hover{
    transform: scale(1.1);
    fill: var(--accent);
}

.tutorial_modal{
    display: none;
    position: fixed;
    align-items: center;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 7, 5, 0.75);
    animation: fadeIn 0.3s ease;
}
.tutorial_containers{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 500px;
    background-color: var(--bg-base);
}
.display_images{
    width: 600px;
    height: 400px;
    border: 1px solid var(--border-warm);
    border-radius: 1rem;
    box-shadow: var(--shadow-deep);
    background: url(img/tutorial1.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.dot_class{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 50px;
}

#dot1, #dot2, #dot3, #dot4{
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: rgba(224, 164, 88, 0.3);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease;
} .activeDot{
    background-color: var(--accent);
} #dot1{
    background-color: var(--accent);
}

.tutorial_close{
    position: absolute;
    top: 30px;
    right: 50px;
    font-size: 50px;
    color: var(--text-muted);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
} .tutorial_close:hover{
    color: var(--accent);
    transform: scale(1.3);
}

@keyframes fadeIn{
    from{ opacity: 0;}
    to { opacity: 1;}
}

.saved_notes_btn{
    width: clamp(150px, 50vw, 200px);
    height: 44px;
    border-radius: 0.6rem;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1a130d;
    fill: #1a130d;
    background: linear-gradient(160deg, var(--accent-hover), var(--accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--glow-amber);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
} .saved_notes_btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(224, 164, 88, 0.32);
} .saved_notes_btn:active{
    transform: scale(0.97);
}

.paragraph_list{
    font-family: var(--font-body);
    font-size: clamp(0.5rem, 2vw, 1.5rem);
    color: var(--text-primary);
    width: 99%;
    height: auto;
    margin: 0.4rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: 0.6rem;
    background-color: var(--bg-panel);
    display: flex;
    align-items: center;
    cursor: pointer;
    overflow: auto;
    transition: background-color 0.2s ease, border-color 0.2s ease;
} .paragraph_list:hover{
    background-color: rgba(224, 164, 88, 0.1);
    border-color: var(--border-warm);
    color: var(--text-primary);
} .paragraph_list.markAsCheck{
    border: 2px solid var(--accent);
    text-decoration: line-through;
    text-decoration-color: var(--accent-ember);
}

.selectedWord{
    color: var(--accent-hover);
    font-weight: 700;
    font-size: clamp(0.5rem, 2vw, 1.2rem);
}

/* ----------------------------------------------Music Control */
.music-control {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-family: var(--font-body);
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 10px 15px;
    border: 1px solid var(--border-warm);
    border-radius: 0.6rem;
    cursor: pointer;
    z-index: 10000;
    font-weight: 700;
    box-shadow: var(--shadow-deep);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.music-control:hover {
    transform: scale(1.05);
    background-color: rgba(224, 164, 88, 0.15);
    box-shadow: var(--glow-amber);
}

.music-control:active {
    transform: scale(0.95);
}

@media screen and (max-width: 768px) {
    .music-control {
        padding: 8px 12px;
        font-size: 0.9rem;
        bottom: 15px;
        left: 15px;
    }
}

@media screen and (max-width: 480px) {
    .music-control {
        padding: 6px 10px;
        font-size: 0.8rem;
        bottom: 10px;
        left: 10px;
    }
}

/* ------------------------MEDIA QUERIES---------------------------- */

@media screen and (max-width: 768px) {

    .input_rev{
        flex-direction: column;
        align-items: center;
    }

    .input_rev.inputRevFade{
        width: clamp(100px, 90vw, 800px);
        height: clamp(200px, 100vh, 500px);
        border: 1px solid var(--border-warm);
        border-radius: 1.25rem;
        backdrop-filter: blur(14px);
        background-color: var(--bg-panel-soft);
    }

    .textInput{
        width: 100%;
        height: 100%;
    } .textInput.textInputToggle{
        width: 100%;
        height: 100%;
        display: inline-block;
    } .textInput.textInputToggleClose{
        width: 0;
        height: 0;
        display: none;
    }

    .question_area{
        font-size: 1.5rem;
    }
    .guessInput{
        font-size: 1.5rem;
        width: 150px;
        height: 25px;
    }

    /* BUTTONS */

    .closeStartReview_btn{
        width: clamp(10px, 10vw, 50px);
        height: clamp(10px, 10vw, 50px);
    }

}

@media screen and (max-width: 480px) {

    .printSelected{
        font-size: 0;
    }

    .progress-info{
        font-size: 1rem;
    }
     .guessInput{
        font-size: 1rem;
        width: 150px;
        height: 25px;
    }
    .display_images{
        width: 90%;
        height: 50%;
    }

    .tutorial_close{
        right: 10%;
    }
}

@media screen and (max-width: 250px) {

    .title_container{
        width: 100%;
        height: 100%;
    }

    body{
        min-width: 320px;
        height: 100%;
    }
}

/* Facebook browser safety layer */
@supports (-webkit-touch-callout: none) {

  .start_review.startRevFade{
      height: calc(var(--fbvh) * 90);
  }

  .input_rev.inputRevFade{
      height: calc(var(--fbvh) * 80);
  }

  .saved_notes_container.SavedNotesContainerToggle{
      height: calc(var(--fbvh) * 80);
  }
}