
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #17110e;
    font-family: Georgia, serif;
}

.scene {
    position: fixed;
    inset: 0;
    display: none;
    overflow: hidden;
    background: #211711;
}

.scene.active {
    display: block;
}

.scene > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: imageAppear 2s ease forwards;
}

.dialogue {
    position: absolute;
    z-index: 10;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 650px);
    padding: 24px 28px;
    text-align: center;
    color: #fff2df;
    background: rgba(35, 23, 17, 0.89);
    border: 1px solid rgba(255, 218, 172, 0.45);
    border-radius: 17px;
    box-shadow: 0 8px 35px #0008;
    backdrop-filter: blur(7px);
    opacity: 0;
    animation: dialogueAppear 1s ease 2s forwards;
}

.dialogue h1,
.dialogue h2 {
    margin-bottom: 12px;
    font-weight: normal;
}

.dialogue p {
    line-height: 1.7;
    font-size: 16px;
}

button {
    font-family: Georgia, serif;
    cursor: pointer;
    border: none;
    transition: transform 0.25s, background 0.25s;
}

.dialogue button,
.note-card button {
    margin-top: 18px;
    padding: 12px 25px;
    border-radius: 25px;
    color: #fff5e9;
    background: #9a6040;
    font-size: 15px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #bd815a;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#fadeScreen {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 2s ease;
}

.scene-hint {
    position: absolute;
    z-index: 5;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    color: #fff2dc;
    background: rgba(35, 22, 15, 0.78);
    padding: 12px 20px;
    border-radius: 25px;
    text-align: center;
    opacity: 0;
    animation: hintAppear 1s ease 2s forwards;
}

/* NOTES */

.envelope {
    position: absolute;
    z-index: 8;
    width: 65px;
    height: 48px;
    background: #f1d7aa;
    border: 2px solid #b88a5d;
    border-radius: 5px;
    box-shadow: 0 5px 15px #0008;
    color: #a65345;
    font-size: 22px;
    animation: envelopeFloat 2.5s ease-in-out infinite;
}

.envelope::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 23px solid #dfbd8d;
}

.envelope span {
    position: relative;
    z-index: 2;
    top: 8px;
}

.fireplace-envelope {
    left: 24%;
    bottom: 25%;
}

.lantern-envelope {
    left: 22%;
    top: 26%;
}

.note-overlay {
    display: none;
    position: absolute;
    z-index: 50;
    inset: 0;
    padding: 20px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.68);
}

.note-overlay.show {
    display: flex;
    animation: fadeIn 0.7s ease;
}

.note-card {
    width: min(92%, 620px);
    max-height: 82vh;
    overflow-y: auto;
    padding: 30px;
    background: #f5e6c9;
    color: #503725;
    border: 2px solid #c49a6b;
    border-radius: 9px;
    box-shadow: 0 12px 45px #0009;
    text-align: center;
    animation: noteAppear 0.8s ease;
}

.note-title {
    font-size: 25px;
    margin-bottom: 20px;
    color: #86533a;
}

.note-card p {
    font-size: 16px;
    line-height: 1.85;
    text-align: left;
}

.note-card button {
    color: white;
}

/* KITCHEN */

.kitchen-scene {
    background:
        radial-gradient(ellipse at 50% 38%, #98704e, transparent 55%),
        linear-gradient(120deg, #352219, #67442f 50%, #2b1c16);
}

.kitchen-window {
    position: absolute;
    width: 31%;
    height: 40%;
    top: 5%;
    right: 8%;
    border: 13px solid #4a2b1d;
    background: linear-gradient(#273c43, #52624c);
}

.kitchen-shelf {
    position: absolute;
    top: 17%;
    left: 7%;
    width: 30%;
    padding: 15px;
    display: flex;
    justify-content: space-around;
    background: #583522;
    border-bottom: 10px solid #392116;
    color: #ffe1a8;
    font-size: 28px;
}

.kitchen-counter {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 18%;
    background: linear-gradient(#80553a, #44291d);
    border-top: 12px solid #a8754f;
}

.kitchen-content {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    width: min(92%, 760px);
    padding: 28px;
    text-align: center;
    color: #fff0dc;
    background: rgba(40, 24, 16, 0.93);
    border: 1px solid #bd9167;
    border-radius: 20px;
    box-shadow: 0 10px 40px #0008;
}

.eyebrow {
    color: #e8bd91;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.kitchen-heading h1 {
    font-size: 28px;
    font-weight: normal;
    margin-bottom: 12px;
}

.kitchen-heading p {
    line-height: 1.6;
}

.activity-step {
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

/* COLOURED MUGS */

.mug-options {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    margin: 25px 0 18px;
}

.mug-choice {
    width: 145px;
    min-height: 165px;
    padding: 15px 10px;
    border-radius: 16px;
    background: #f2e3d0;
    color: #563b2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 3px solid transparent;
}

.mug-choice.selected {
    border-color: #e4b078;
    background: #fff2df;
    box-shadow: 0 0 20px #e4b07855;
}

.mug-name {
    font-size: 14px;
}

.mug-illustration {
    position: relative;
    display: block;
    width: 72px;
    height: 75px;
    border-radius: 8px 8px 20px 20px;
    box-shadow: inset -8px -5px 12px #0002, 0 6px 8px #0002;
}

.cream-cup {
    background: linear-gradient(90deg, #c8ae89, #f5e4c5 48%, #d8c09b);
}

.pink-cup {
    background: linear-gradient(90deg, #bd7785, #f3b9c0 48%, #d98e9b);
}

.brown-cup {
    background: linear-gradient(90deg, #633a2b, #a66c4b 48%, #75432f);
}

.cup-top {
    position: absolute;
    top: -5px;
    left: -3px;
    width: 78px;
    height: 14px;
    border-radius: 50%;
    background: #5c3829;
    border: 4px solid #e8d3b4;
}

.pink-cup .cup-top { border-color: #edb4bd; }
.brown-cup .cup-top { border-color: #996349; }

.cup-handle {
    position: absolute;
    right: -25px;
    top: 15px;
    width: 30px;
    height: 37px;
    border: 8px solid;
    border-radius: 50%;
    border-left: 0;
}

.cream-cup .cup-handle { border-color: #d8c09b; }
.pink-cup .cup-handle { border-color: #d98e9b; }
.brown-cup .cup-handle { border-color: #75432f; }

.cup-heart {
    position: absolute;
    top: 25px;
    left: 25px;
    color: #fff0dc;
    font-size: 23px;
}

.activity-button {
    margin-top: 15px;
    padding: 12px 26px;
    border-radius: 25px;
    color: #fff5e9;
    background: #9a6040;
    font-size: 15px;
}

.small-instruction {
    margin-bottom: 15px;
    color: #f5d8b6;
}

.ingredient-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.ingredient {
    min-width: 110px;
    padding: 14px 12px;
    border-radius: 13px;
    background: #f2e3d0;
    color: #563b2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 3px solid transparent;
}

.ingredient.selected {
    border-color: #e4b078;
    background: #fff2df;
}

.ingredient-picture {
    font-size: 32px;
}

#ingredientCount,
#stirMessage {
    margin: 12px;
    color: #f5d8b6;
}

.stir-cup {
    position: relative;
    width: 100px;
    height: 95px;
    margin: 22px auto;
    border-radius: 8px 8px 27px 27px;
    background: linear-gradient(90deg, #d4a982, #f4d5b2 48%, #c99770);
    box-shadow: inset -8px -5px 12px #0002, 0 8px 15px #0003;
    animation: cupWobble 2s ease-in-out infinite;
}

.stir-liquid {
    position: absolute;
    top: 3px;
    left: -4px;
    width: 108px;
    height: 18px;
    border-radius: 50%;
    background: #603b2b;
    border: 4px solid #e8c5a2;
}

.stir-handle {
    position: absolute;
    right: -35px;
    top: 20px;
    width: 42px;
    height: 48px;
    border: 10px solid #d9b18d;
    border-left: 0;
    border-radius: 50%;
}

.stir-spoon {
    position: absolute;
    top: -22px;
    left: 55px;
    width: 5px;
    height: 65px;
    background: #d9c5a1;
    border-radius: 5px;
    transform: rotate(18deg);
}

.stir-progress {
    height: 11px;
    width: 70%;
    margin: 20px auto;
    border-radius: 20px;
    background: #73513d;
    overflow: hidden;
}

#stirFill {
    width: 0;
    height: 100%;
    background: #eab77d;
    border-radius: 20px;
    transition: width 0.3s ease;
}

.finished-drink {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.finished-mug {
    position: relative;
    width: 90px;
    height: 78px;
    border-radius: 8px 8px 24px 24px;
    background: linear-gradient(90deg, #d4a982, #f4d5b2 48%, #c99770);
    box-shadow: inset -8px -5px 12px #0002, 0 8px 15px #0003;
}

.finished-liquid {
    position: absolute;
    top: 3px;
    left: -4px;
    width: 98px;
    height: 17px;
    border-radius: 50%;
    background: #603b2b;
    border: 4px solid #e8c5a2;
}

.finished-handle {
    position: absolute;
    right: -34px;
    top: 17px;
    width: 40px;
    height: 45px;
    border: 9px solid #d9b18d;
    border-left: 0;
    border-radius: 50%;
}

.finished-marshmallows {
    position: absolute;
    top: -17px;
    left: 20px;
    color: white;
    font-size: 23px;
    letter-spacing: 2px;
}

#serveStep h2 {
    font-weight: normal;
    margin: 8px;
}

/* SNOW: CLIPPED TO WINDOW GLASS */

.window-glass {
    position: absolute;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

/* Glass panes in the supplied 5th-scene image */
.left-glass {
    left: 35.5%;
    top: 0;
    width: 18.5%;
    height: 82%;
}

.right-glass {
    left: 57.2%;
    top: 0;
    width: 37.8%;
    height: 82%;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 5px #ffffff, 0 0 10px #d9f2ff;
    pointer-events: none;
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.window-hint {
    top: 7%;
}

/* GOODBYE */

.end-goodbye {
    font-size: 44px !important;
    font-weight: bold !important;
    letter-spacing: 5px;
    color: #ffe0ae;
    text-shadow: 0 0 20px #f5b96c;
}

/* ANIMATIONS */

@keyframes imageAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dialogueAppear {
    from {
        opacity: 0;
        transform: translate(-50%, 25px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes hintAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes noteAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes envelopeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes snowfall {
    0% {
        top: -20px;
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(18px) rotate(180deg);
    }
    100% {
        top: 105%;
        transform: translateX(-10px) rotate(360deg);
    }
}

@keyframes cupWobble {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@media (max-width: 600px) {
    .dialogue {
        bottom: 4%;
        padding: 18px;
    }

    .dialogue p {
        font-size: 14px;
    }

    .kitchen-content {
        padding: 16px;
        top: 48%;
    }

    .kitchen-heading h1 {
        font-size: 22px;
    }

    .mug-options {
        gap: 9px;
    }

    .mug-choice {
        width: 105px;
        min-height: 145px;
        padding: 10px 5px;
    }

    .note-card {
        padding: 22px 18px;
    }

    .note-card p {
        font-size: 14px;
        line-height: 1.7;
    }

    .note-title {
        font-size: 21px;
    }

    .end-goodbye {
        font-size: 34px !important;
    }
}
