html {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Work Sans", sans-serif;
    overflow: hidden;
}


canvas {
    overflow-y: hidden;
    overflow-x: hidden;
    width: 100vw;
    margin: 0;
    opacity: 50%;
    z-index: -1;
}

#containerzero {
    height: 100vh;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-direction: column;
}

#containerzero button {
    background-color: #EA4C89;
    border-radius: 8px;
    border-style: none;
    box-sizing: border-box;
    color: #FFFFFF;
    cursor: pointer;
    display: inline-block;
    font-family: "Haas Grot Text R Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 20px;
    height: 40px;
    line-height: 20px;
    list-style: none;
    margin: 0;
    outline: none;
    padding: 10px 16px;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: color 100ms;
    vertical-align: baseline;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    font-weight: bold;
}


#containerzero #info {
    font-size: 1rem;
    font-weight: lighter;
    margin-top: 20px;
    position: absolute;
    z-index: 2;
    bottom: 0;
    background: white;
}

#containerzero button:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

.container {
    height: 100vh;
    width: 100vh;
    margin: 0 auto;
    text-align: center;
    visibility: hidden;
    position: relative;
    overflow: hidden;
}

.container div.six {
    top: 10vh;
    z-index: 1;
}

.container div.seven,
.container div.eight {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
}

.container > div {
    position: absolute;
    left: 0;
    right: 0;
    top: 20vh;
}

.one {
    font-size: 4.5rem;
}

.one > img {
    vertical-align: middle;
    margin-bottom: 10px;
    max-width: 100%;
    height: auto;
}

.two {
    font-size: 1.2rem;
    font-weight: lighter;
}

.three {
    font-size: 3rem;
}

.four .text-box {
    width: 600px;
    margin: 0 auto;
    border: 3px solid #aaa;
    border-radius: 5px;
    padding: 10px;
    position: relative;
}

.text-box p {
    margin: 0;
    text-align: left;
}

.text-box span {
    visibility: hidden;
}

.text-box .fake-btn {
    position: absolute;
    right: 5px;
    bottom: 5px;
    color: #fff;
    background-color: rgb(21, 161, 237);
    padding: 5px 8px;
    border-radius: 3px;
}

.five p {
    font-size: 2rem;
    position: absolute;
    left: 0;
    right: 0;
}

.idea-3 strong {
    padding: 3px 5px;
    border-radius: 3px;
    display: inline-block;
}

.five .idea-5 {
    font-size: 4rem;
}

/* Make idea-5 responsive on mobile */
@media (max-width: 480px) {
    .five .idea-5 {
        font-size: 1.4rem;
        line-height: 1.35;
        padding: 0 16px;
        text-align: center;
        white-space: normal;
    }
}

.idea-5 span,
.idea-6 span,
.wish-hbd span {
    display: inline-block;
}

.idea-6 span {
    font-size: 15rem;
}

.six {
    position: relative;
}

.six img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.six .hat {
    position: absolute;
    width: 80px;
    top: -90px;
    left: 91.5%;
    /* transform: scale(0.1); */
}

.baloons img {
    display: inline-block;
    position: absolute;
}

.baloons img:nth-child(even) {
    left: -10%;
}

.baloons img:nth-child(odd) {
    right: -10%;
}

.baloons img:nth-child(3n + 0) {
    left: 30%;
}

.eight svg {
    width: 25px;
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    z-index: -1;
}

.eight svg:nth-child(1) {
    top: 7vh;
    left: 5vw;
    fill: #bd6ecf;
}

.eight svg:nth-child(2) {
    top: 23vh;
    left: 35vw;
    fill: #7dd175;
}

.eight svg:nth-child(3) {
    top: 33vh;
    left: 23vw;
    fill: #349d8b;
}

.eight svg:nth-child(4) {
    top: 43vh;
    left: 57vw;
    fill: #347a9d;
}

.eight svg:nth-child(5) {
    top: 68vh;
    left: 7vw;
    fill: #c66053;
}

.eight svg:nth-child(6) {
    top: 42vh;
    left: 77vw;
    fill: #bfaa40;
}

.eight svg:nth-child(7) {
    top: 68vh;
    left: 83vw;
    fill: #e3bae8;
}

.eight svg:nth-child(8) {
    top: 86vh;
    left: 37vw;
    fill: #8762cb;
}

.eight svg:nth-child(9) {
    top: 94vh;
    left: 87vw;
    fill: #9a90da;
}

.wish-hbd {
    font-size: 3em;
    margin: 0;
    text-transform: uppercase;
}

.wish h5 {
    font-weight: lighter;
    font-size: 2rem;
    margin: 10px 0 0;
}

.nine p {
    font-size: 2rem;
    font-weight: lighter;
}

#replay {
    z-index: 3;
    cursor: pointer;
}

/* Media Queries */
@media screen and (max-height: 1000px) {
    .six .hat {
        left: 40%;
    }
}

@media screen and (max-height: 800px) {
    .six .hat {
        left: 37%;
    }
}

@media screen and (max-height: 700px) {
    .six .hat {
        left: 32%;
    }
}

@media screen and (max-height: 850px) and (max-width: 450px) {
    .six .hat {
        left: 32%;
    }
}

@media screen and (max-width: 500px) {
    .container {
        width: 90%;
    }

    .four .text-box {
        width: 90%;
    }

    .text-box .fake-btn {
        right: 5px;
        bottom: -38px;
    }

    .idea-5 span {
        display: block;
    }

    .idea-6 span {
        font-size: 10rem;
    }

    .six .hat {
        width: 50px;
        top: -20px;
    }

    .wish-hbd {
        font-size: 2.2em;
    }

    .wish h5 {
        font-size: 1.4rem;
    }

    .nine p {
        font-size: 1.5rem;
        font-weight: lighter;
    }
}


.cake {
    position: absolute;
    width: 250px;
    height: 200px;
    top: 50%;
    left: 50%;
    margin-top: -70px;
    margin-left: -125px;
}

.plate {
    width: 270px;
    height: 110px;
    position: absolute;
    bottom: -10px;
    left: -10px;
    background-color: #ccc;
    border-radius: 50%;
    box-shadow: 0 2px 0 #b3b3b3, 0 4px 0 #b3b3b3, 0 5px 40px rgba(0, 0, 0, 0.5);
}

.cake > * {
    position: absolute;
}

.layer {
    position: absolute;
    display: block;
    width: 250px;
    height: 100px;
    border-radius: 50%;
    background-color: #553c13;
    box-shadow: 0 2px 0px #6a4b18, 0 4px 0px #33240b, 0 6px 0px #32230b, 0 8px 0px #31230b, 0 10px 0px #30220b, 0 12px 0px #2f220b, 0 14px 0px #2f210a, 0 16px 0px #2e200a, 0 18px 0px #2d200a, 0 20px 0px #2c1f0a, 0 22px 0px #2b1f0a, 0 24px 0px #2a1e09, 0 26px 0px #2a1d09, 0 28px 0px #291d09, 0 30px 0px #281c09;
}

.layer-top {
    top: 0px;
}

.layer-middle {
    top: 33px;
}

.layer-bottom {
    top: 66px;
}

.icing {
    top: 2px;
    left: 5px;
    background-color: #f0e4d0;
    width: 240px;
    height: 90px;
    border-radius: 50%;
}

.icing:before {
    content: "";
    position: absolute;
    top: 4px;
    right: 5px;
    bottom: 6px;
    left: 5px;
    background-color: #f4ebdc;
    box-shadow: 0 0 4px #f6efe3, 0 0 4px #f6efe3, 0 0 4px #f6efe3;
    border-radius: 50%;
    z-index: 1;
}

.drip {
    display: block;
    width: 50px;
    height: 60px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    background-color: #f0e4d0;
}

.drip1 {
    top: 53px;
    left: 5px;
    transform: skewY(15deg);
    height: 48px;
    width: 40px;
}

.drip2 {
    top: 69px;
    left: 181px;
    transform: skewY(-15deg);
}

.drip3 {
    top: 54px;
    left: 90px;
    width: 80px;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}

.candle {
    background-color: #7B020B;
    width: 16px;
    height: 50px;
    border-radius: 8px/4px;
    top: -20px;
    left: 50%;
    margin-left: -8px;
    z-index: 10;
}

.candle:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 8px;
    border-radius: 50%;
    background-color: #ad030f;
}

.flame {
    position: absolute;
    background-color: orange;
    width: 15px;
    height: 35px;
    border-radius: 10px 10px 10px 10px/25px 25px 10px 10px;
    top: -34px;
    left: 50%;
    margin-left: -7.5px;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
    transform-origin: 50% 90%;
    animation: flicker 1s ease-in-out alternate infinite;
}

@keyframes flicker {
    0% {
        transform: skewX(5deg);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), 0 0 20px rgba(255, 165, 0, 0.2), 0 0 60px rgba(255, 165, 0, 0.2), 0 0 80px rgba(255, 165, 0, 0.2);
    }
    25% {
        transform: skewX(-5deg);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
    }
    50% {
        transform: skewX(10deg);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.3), 0 0 20px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 165, 0, 0.3);
    }
    75% {
        transform: skewX(-10deg);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.4), 0 0 20px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.4), 0 0 80px rgba(255, 165, 0, 0.4);
    }
    100% {
        transform: skewX(5deg);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
    }
}

.prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-align: center;
    z-index: 2;
    background: #2a1d09;
    padding: 10px;
    border-radius: 10px;
    display: inline-flex;
    width: fit-content;
    white-space: nowrap;
}


@media screen and (max-width: 500px) {
    .container {
        width: 100vw;   /* ✅ fix mobile layout */
    }
}

@media screen and (max-width: 500px) {
  /* Give the six scene more vertical room */
  .container div.six {
    top: 6vh;                 /* move slightly up */
  }

  /* Make the wish block fit on phone screens */
  .wish {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .wish h5 {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 10px 0 0;
    white-space: pre-line;    /* show \n\n */
    word-break: break-word;

    /* ✅ prevents clipping: scroll inside if needed */
    max-height: 38vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
