@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
    --blue: #0877e8;
    --blue-deep: #0754b8;
    --ink: #07142d;
    --muted: #6480a0;
    --sky: #eef7ff;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.bubble-game-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: #eaf5ff;
    color: var(--ink);
    font-family: "DM Sans", Arial, sans-serif;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

.game-shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .95), transparent 32%),
        linear-gradient(180deg, #f5fbff 0%, #eaf6ff 54%, #d9efff 100%);
}

.game-topbar {
    position: relative;
    z-index: 50;
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-brand {
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.game-brand strong {
    color: var(--blue);
}

.game-brand small {
    display: block;
    font-size: 7px;
    letter-spacing: .2em;
    color: #8195ad;
    margin-top: -1px;
}

.brand-mark {
    width: 29px;
    height: 29px;
    position: relative;
    display: inline-block;
}

.brand-mark i {
    position: absolute;
    width: 6px;
    border-radius: 4px;
    bottom: 3px;
    background: var(--blue);
}

.brand-mark i:nth-child(1) {
    height: 13px;
    left: 2px;
}

.brand-mark i:nth-child(2) {
    height: 20px;
    left: 11px;
}

.brand-mark i:nth-child(3) {
    height: 27px;
    left: 20px;
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-stats div {
    min-width: 68px;
    padding: 8px 13px;
    border: 1px solid rgba(75, 133, 183, .15);
    border-radius: 13px;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(10px);
    text-align: center;
}

.game-stats span {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7890aa;
}

.game-stats strong {
    display: block;
    margin-top: 2px;
    font-family: "Manrope", sans-serif;
    font-size: 16px;
}

.game-intro {
    position: relative;
    z-index: 20;
    width: min(650px, calc(100% - 40px));
    margin: 7vh auto 0;
    text-align: center;
    transition: opacity .45s ease, transform .45s ease;
}

.game-intro.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.game-intro h1,
.game-over h2 {
    margin: 14px 0 13px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(48px, 7vw, 86px);
    line-height: .94;
    letter-spacing: -.065em;
}

.game-intro h1 em,
.game-over h2 em {
    color: var(--blue);
    font-style: normal;
}

.game-intro p {
    max-width: 510px;
    margin: 0 auto 25px;
    color: #63809f;
    font-size: 15px;
    line-height: 1.65;
}

.play-button {
    border: 0;
    border-radius: 999px;
    padding: 14px 22px 14px 25px;
    background: var(--ink);
    color: white;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(7, 20, 45, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.play-button span {
    display: inline-block;
    margin-left: 12px;
    font-size: 18px;
    transition: transform .2s ease;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 17px 34px rgba(7, 20, 45, .22);
}

.play-button:hover span {
    transform: translateX(4px);
}

.hint {
    margin-top: 16px;
    color: #91a7bd;
    font-size: 11px;
}

.hint span {
    color: var(--blue);
    margin-right: 5px;
}

.play-area {
    position: fixed;
    z-index: 10;
    inset: 82px 0 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

.play-area.active {
    opacity: 1;
    pointer-events: auto;
}

.sky-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(3px);
    pointer-events: none;
}

.glow-one {
    width: 48vw;
    height: 48vw;
    left: -18vw;
    top: 10%;
    background: rgba(115, 198, 255, .15);
}

.glow-two {
    width: 35vw;
    height: 35vw;
    right: -10vw;
    bottom: -5vw;
    background: rgba(55, 143, 255, .12);
}

.stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .65;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(55, 120, 180, .4);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    50% {
        opacity: .18;
        transform: scale(.55);
    }
}

.bubble-field {
    position: absolute;
    inset: 0;
}

.bubble {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 50%;
    background:
        radial-gradient(circle at 29% 22%, rgba(255, 255, 255, .95) 0 4%, transparent 5%),
        radial-gradient(circle at 38% 34%, rgba(255, 255, 255, .5), transparent 23%),
        radial-gradient(circle at 65% 70%, rgba(96, 186, 255, .09), transparent 54%),
        rgba(255, 255, 255, .27);
    box-shadow:
        inset -10px -12px 22px rgba(77, 169, 235, .07),
        inset 8px 8px 18px rgba(255, 255, 255, .7),
        0 9px 25px rgba(45, 127, 186, .08);
    transform: translate(-50%, -50%);
    transition: transform .18s ease, opacity .2s ease;
    animation: floatBubble var(--float-time) ease-in-out infinite alternate;
    will-change: transform;
}

.bubble:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

@keyframes floatBubble {
    from {
        margin-top: -7px;
    }

    to {
        margin-top: 8px;
    }
}

.bubble.hiding {
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.35);
}

.creature {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 42%;
    min-width: 28px;
    min-height: 28px;
    max-width: 62px;
    max-height: 62px;
    transform: translate(-50%, -50%);
    animation: creatureBob .9s ease-in-out infinite alternate;
    filter: drop-shadow(0 7px 6px rgba(28, 111, 175, .18));
    pointer-events: none;
}

@keyframes creatureBob {
    from {
        transform: translate(-50%, -54%) rotate(-3deg);
    }

    to {
        transform: translate(-50%, -46%) rotate(3deg);
    }
}

.creature-body {
    position: absolute;
    inset: 13% 8% 3%;
    border-radius: 47% 53% 44% 56%;
    background: linear-gradient(145deg, #8fe4ff, #368fe9);
    box-shadow: inset 5px 5px 9px rgba(255, 255, 255, .5);
}

.creature-eye {
    position: absolute;
    top: 29%;
    width: 16%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #07142d;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .85);
}

.creature-eye.left {
    left: 27%;
}

.creature-eye.right {
    right: 27%;
}

.creature-mouth {
    position: absolute;
    left: 50%;
    top: 52%;
    width: 24%;
    height: 12%;
    border-bottom: 2px solid #0754b8;
    border-radius: 0 0 50% 50%;
    transform: translateX(-50%);
}

.creature-antenna {
    position: absolute;
    width: 22%;
    height: 30%;
    top: -8%;
    border-top: 2px solid #368fe9;
}

.creature-antenna.left {
    left: 26%;
    transform: rotate(-28deg);
}

.creature-antenna.right {
    right: 26%;
    transform: rotate(28deg);
}

.creature-antenna::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #368fe9;
    top: -4px;
}

.creature-antenna.left::after {
    left: -3px;
}

.creature-antenna.right::after {
    right: -3px;
}

.pop-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: popRing .5s ease-out forwards;
    pointer-events: none;
}

@keyframes popRing {
    to {
        width: 130px;
        height: 130px;
        opacity: 0;
        border-width: 1px;
    }
}

.particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: white;
    left: 50%;
    top: 50%;
    animation: particle .55s ease-out forwards;
}

@keyframes particle {
    to {
        transform: translate(var(--dx), var(--dy)) scale(.1);
        opacity: 0;
    }
}

.round-message {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 30;
    text-align: center;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(32, 106, 160, .07);
    white-space: nowrap;
}

.round-message strong {
    font-size: 12px;
    margin-right: 5px;
}

.round-message span {
    color: #718ba4;
    font-size: 11px;
}

.pause-button {
    position: absolute;
    right: 25px;
    bottom: 25px;
    z-index: 40;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(75, 133, 183, .15);
    border-radius: 50%;
    background: rgba(255, 255, 255, .75);
    color: var(--ink);
    backdrop-filter: blur(10px);
}

.game-over {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 30px;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, .95), rgba(229, 244, 255, .92) 65%),
        #eaf5ff;
}

.game-over[hidden],
.pause-overlay[hidden] {
    display: none;
}

.game-over h2 {
    font-size: clamp(44px, 6vw, 74px);
}

.final-score {
    margin: 20px auto;
}

.final-score span {
    display: block;
    color: #7b94ad;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 800;
}

.final-score strong {
    display: block;
    font-family: "Manrope", sans-serif;
    font-size: 64px;
    line-height: 1;
    color: var(--blue);
}

.game-over p {
    color: #718aa2;
    margin-bottom: 24px;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.back-link {
    color: #718aa2;
    font-size: 12px;
    text-decoration: none;
}

.back-link:hover {
    color: var(--blue);
}

.pause-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(7, 20, 45, .16);
    backdrop-filter: blur(10px);
}

.pause-card {
    width: min(370px, calc(100% - 36px));
    padding: 35px;
    border-radius: 25px;
    text-align: center;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 25px 70px rgba(7, 45, 80, .18);
}

.pause-orb {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f5ff;
    color: var(--blue);
    font-weight: 800;
}

.pause-card h2 {
    margin: 0 0 7px;
    font-family: "Manrope", sans-serif;
}

.pause-card p {
    color: #7890a8;
    margin: 0 0 20px;
}

.game-footer {
    position: absolute;
    z-index: 20;
    bottom: 16px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    color: #91a7bb;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .13em;
}

@media (max-width: 700px) {
    .game-topbar {
        width: calc(100% - 24px);
        min-height: 70px;
    }

    .game-brand small {
        display: none;
    }

    .game-stats {
        gap: 4px;
    }

    .game-stats div {
        min-width: 53px;
        padding: 6px 8px;
    }

    .game-stats span {
        font-size: 7px;
    }

    .game-stats strong {
        font-size: 13px;
    }

    .game-intro {
        margin-top: 8vh;
    }

    .game-intro h1 {
        font-size: clamp(46px, 15vw, 68px);
    }

    .game-intro p {
        font-size: 14px;
    }

    .play-area {
        inset: 70px 0 0;
    }

    .round-message {
        bottom: 24px;
        max-width: calc(100% - 90px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .round-message span {
        display: none;
    }

    .pause-button {
        right: 15px;
        bottom: 18px;
    }

    .game-footer {
        display: none;
    }
}