:root {
    --deep: #7ec8e3;
    /* shallow water */
    --deeper: #5ba3c9;
    /* deep water */
    --wall: #3f6f99;
    /* coral-shadow walls */
    --wall-top: #6fa8d4;
    --foam: #fdf6ee;
    /* foam / paths */
    --shell: #ffd9c0;
    /* pearl/shell accent */
    --kelp: #9fd8b8;
    --coral: #ff9eb5;
    /* collectible glow */
    --ink: #234a63;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
    background:
        radial-gradient(120% 80% at 50% -10%, #bfe9f7 0%, var(--deep) 40%, var(--deeper) 100%);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    user-select: none;
    touch-action: none;
}

/* drifting bubbles */
.bubbles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    animation: rise linear infinite;
}

@keyframes rise {
    to {
        transform: translateY(-110vh) translateX(20px);
        opacity: 0;
    }
}

header {
    z-index: 2;
    text-align: center;
    margin-top: 14px;
    padding: 0 12px;
}

h1 {
    margin: 0;
    font-size: clamp(28px, 8vw, 46px);
    letter-spacing: 1px;
    color: var(--foam);
    text-shadow: 0 2px 0 #4f88ad, 0 6px 14px rgba(35, 74, 99, .4);
}

.tag {
    margin: 2px 0 0;
    font-size: 13px;
    color: #eaf7ff;
    opacity: .9;
}

.hud {
    z-index: 2;
    display: flex;
    gap: 10px;
    margin: 12px 0 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    background: rgba(253, 246, 238, .85);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 8px rgba(35, 74, 99, .25);
    color: var(--ink);
}

.chip b {
    color: #e76f8e;
}

.stage {
    z-index: 2;
    position: relative;
}

canvas {
    background: rgba(253, 246, 238, .5);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(35, 74, 99, .35), inset 0 0 0 4px rgba(255, 255, 255, .6);
    display: block;
    touch-action: none;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 18px;
    background: rgba(91, 163, 201, .78);
    backdrop-filter: blur(3px);
    color: var(--foam);
    text-align: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.overlay h2 {
    margin: 0;
    font-size: clamp(24px, 7vw, 38px);
    text-shadow: 0 2px 6px rgba(35, 74, 99, .5);
}

.overlay p {
    margin: 0;
    max-width: 280px;
    font-size: 15px;
    line-height: 1.4;
}

.btn {
    background: var(--shell);
    color: var(--ink);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 17px;
    padding: 12px 26px;
    border-radius: 999px;
    box-shadow: 0 5px 0 #e7a883;
    transition: transform .08s, box-shadow .08s;
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #e7a883;
}

.hint {
    z-index: 2;
    margin: 10px 0 16px;
    font-size: 12px;
    color: #eaf7ff;
    opacity: .85;
    text-align: center;
}
