* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #bdefff;
}


/* ==========================================
   GAME CONTAINER
========================================== */

#game-container {
    position: relative;

    width: 75vw;
    height: 75vh;

    margin: auto;

    top: 12.5vh;

    border-radius: 25px;

    overflow: hidden;

    background: #e8faff;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.15);
}


/* ==========================================
   CANVAS
========================================== */

#gameCanvas {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: block;

    cursor: pointer;

    touch-action: none;
}


/* ==========================================
   TOP LEFT TITLE
========================================== */

#game-title {
    position: absolute;

    top: 20px;
    left: 25px;

    z-index: 4;

    pointer-events: none;

    user-select: none;
}

.title-main {
    font-size: 22px;

    font-weight: bold;

    color: #344054;

    letter-spacing: 0.2px;
}

.title-sub {
    margin-top: 4px;

    font-size: 13px;

    color: #667085;
}


/* ==========================================
   START SCREEN
========================================== */

#start-screen {
    position: absolute;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 10;

    background:
        rgba(255, 255, 255, 0.08);
}

.start-card {
    width: 370px;

    max-width: 90%;

    padding: 35px 40px;

    text-align: center;

    background:
        rgba(255, 255, 255, 0.94);

    border-radius: 30px;

    box-shadow:
        0 15px 45px
        rgba(0, 0, 0, 0.12);

    backdrop-filter: blur(6px);

    -webkit-backdrop-filter: blur(6px);
}


/* ==========================================
   START BALLOON
========================================== */

.big-balloon {
    font-size: 65px;

    animation:
        floatingBalloon 2.5s
        ease-in-out
        infinite;

    user-select: none;
}

@keyframes floatingBalloon {

    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0);
    }
}


/* ==========================================
   START TEXT
========================================== */

.start-card h1 {
    margin-top: 8px;

    font-size: 32px;

    color: #ff5f7a;
}

.start-card p {
    margin-top: 12px;

    font-size: 17px;

    line-height: 1.5;

    color: #344054;
}

.start-card .hint {
    font-size: 14px;

    color: #667085;
}


/* ==========================================
   START BUTTON
========================================== */

#start-button {
    margin-top: 25px;

    padding: 14px 32px;

    border: none;

    border-radius: 25px;

    background: #ff6b81;

    color: white;

    font-size: 18px;

    font-weight: bold;

    cursor: pointer;

    box-shadow:
        0 7px 20px
        rgba(255, 107, 129, 0.30);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

#start-button:hover {
    transform: translateY(-2px);

    background: #ff5f77;

    box-shadow:
        0 9px 24px
        rgba(255, 107, 129, 0.36);
}

#start-button:active {
    transform: scale(0.96);

    box-shadow:
        0 4px 12px
        rgba(255, 107, 129, 0.25);
}


/* ==========================================
   HUD
========================================== */

#hud {
    position: absolute;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;

    align-items: center;

    gap: 30px;

    padding: 12px 25px;

    background:
        rgba(255, 255, 255, 0.88);

    border-radius: 20px;

    box-shadow:
        0 5px 18px
        rgba(0, 0, 0, 0.08);

    z-index: 5;

    user-select: none;

    white-space: nowrap;
}

#hud span {
    font-size: 16px;

    color: #344054;
}

#hud strong {
    margin-left: 3px;

    font-size: 18px;

    color: #1d2939;
}


/* ==========================================
   TIMER
========================================== */

#timer {
    transition:
        color 0.4s ease;
}


/* ==========================================
   PAUSE BUTTON
========================================== */

#pause-button {
    position: absolute;

    top: 20px;
    right: 25px;

    width: 42px;
    height: 42px;

    border: none;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.88);

    font-size: 18px;

    cursor: pointer;

    z-index: 6;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.08);

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

#pause-button:hover {
    transform: scale(1.06);

    background:
        rgba(255, 255, 255, 0.98);
}

#pause-button:active {
    transform: scale(0.94);
}


/* ==========================================
   GAME OVER SCREEN
========================================== */

#game-over-screen {
    position: absolute;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    background:
        rgba(189, 239, 255, 0.45);

    backdrop-filter: blur(5px);

    -webkit-backdrop-filter: blur(5px);

    z-index: 20;
}


/* ==========================================
   GAME OVER BOX
========================================== */

#game-over-box {
    width: 350px;

    max-width: 90%;

    padding: 35px;

    text-align: center;

    background:
        rgba(255, 255, 255, 0.96);

    border-radius: 25px;

    box-shadow:
        0 15px 45px
        rgba(0, 0, 0, 0.15);

    animation:
        gameOverAppear 0.3s ease-out;
}

@keyframes gameOverAppear {

    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ==========================================
   GAME OVER TEXT
========================================== */

#game-over-box h1 {
    font-size: 34px;

    color: #ff5f7a;
}

.game-over-subtitle {
    margin-top: 8px;

    margin-bottom: 20px;

    color: #667085;

    font-size: 15px;
}


/* ==========================================
   RESULT ROWS
========================================== */

.result-row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 12px 15px;

    margin: 7px 0;

    border-radius: 12px;

    background: #f8fafc;

    color: #344054;
}

.result-row strong {
    color: #1d2939;

    font-size: 18px;
}


/* ==========================================
   RESTART BUTTON
========================================== */

#restart-button {
    margin-top: 20px;

    padding: 13px 28px;

    border: none;

    border-radius: 25px;

    background: #ff6b81;

    color: white;

    font-size: 17px;

    font-weight: bold;

    cursor: pointer;

    box-shadow:
        0 7px 20px
        rgba(255, 107, 129, 0.30);

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

#restart-button:hover {
    transform: translateY(-2px);

    background: #ff5f77;

    box-shadow:
        0 9px 24px
        rgba(255, 107, 129, 0.36);
}

#restart-button:active {
    transform: scale(0.96);

    box-shadow:
        0 4px 12px
        rgba(255, 107, 129, 0.25);
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    body {
        background: #bdefff;
    }

    #game-container {

        width: 100vw;
        height: 100vh;

        top: 0;

        margin: 0;

        border-radius: 0;

        box-shadow: none;
    }


    /* TITLE */

    #game-title {
        top: 15px;
        left: 15px;
    }

    .title-main {
        font-size: 18px;
    }

    .title-sub {
        font-size: 12px;
    }


    /* HUD */

    #hud {

        top: 15px;

        gap: 15px;

        padding: 10px 15px;

        border-radius: 16px;
    }

    #hud span {
        font-size: 14px;
    }

    #hud strong {
        font-size: 16px;
    }


    /* PAUSE */

    #pause-button {

        top: 15px;

        right: 15px;

        width: 40px;
        height: 40px;
    }


    /* START CARD */

    .start-card {

        width: 90%;

        padding: 30px 20px;

        border-radius: 25px;
    }

    .big-balloon {
        font-size: 55px;
    }

    .start-card h1 {
        font-size: 27px;
    }

    .start-card p {
        font-size: 15px;
    }


    /* GAME OVER */

    #game-over-box {

        width: 90%;

        padding: 30px 22px;

        border-radius: 23px;
    }

    #game-over-box h1 {
        font-size: 29px;
    }

    .result-row {
        padding: 11px 13px;
    }

    #restart-button {
        font-size: 16px;

        padding: 12px 25px;
    }
}


/* ==========================================
   VERY SMALL SCREENS
========================================== */

@media (max-width: 380px) {

    #hud {
        gap: 9px;

        padding: 9px 11px;
    }

    #hud span {
        font-size: 12px;
    }

    #hud strong {
        font-size: 14px;
    }

    #pause-button {
        width: 36px;
        height: 36px;

        font-size: 16px;
    }

    .start-card h1 {
        font-size: 24px;
    }
}


/* ==========================================
   LANDSCAPE MOBILE
========================================== */

@media (max-height: 500px) and (max-width: 900px) {

    #game-container {
        width: 100vw;
        height: 100vh;

        top: 0;

        border-radius: 0;
    }

    .start-card {
        padding: 18px 25px;
    }

    .big-balloon {
        font-size: 42px;
    }

    .start-card h1 {
        font-size: 23px;
    }

    .start-card p {
        margin-top: 7px;

        font-size: 13px;
    }

    #start-button {
        margin-top: 12px;

        padding: 10px 25px;

        font-size: 15px;
    }

    #game-over-box {
        padding: 20px 25px;
    }
}


/* ==========================================
   ACCESSIBILITY
========================================== */

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 3px solid rgba(255, 95, 122, 0.35);

    outline-offset: 3px;
}