p {
    color: blue;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    padding: 0;
    background: #b7d0ff;
    touch-action: none;
}

h1 {
    text-align: center;
    font-family: "Rubik Mono One", monospace;
    font-weight: 400;
    font-style: normal;
    color: #95b0e22d;
    font-size: clamp(6rem, 10vw, 3.2rem);
    line-height: 1em;
    user-select: none;
}

* {
    font-family: "Quicksand";
}

.welcome {
    display: grid;
    min-height: 100vh;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    box-sizing: border-box;
}


.jelly {
    position: absolute;
    right: 10px;
    bottom: 15px;
}

.info-button {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 25;
    min-width: 2.5rem;
    min-height: 2.5rem;
    font: inherit;
    background-color: #dfeaff;
    border: 0;
    border-radius: 105px;
    cursor: pointer;
    font-weight: 900;
    font-family: monospace;
    font-size: 20px;
    color: crimson;
}

.info-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 40;
}

.info-modal[hidden] {
    display: none;
}

.info-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(84 91 105 / 45%);
}

.info-modal-card {
    position: relative;
    z-index: 1;
    width: min(32rem, calc(100vw - 2rem));
    padding: 1.25rem 1.1rem 1rem;
    border-radius: 8px;
    background: #dfeaff;
    box-sizing: border-box;
}

.info-modal-card h2 {
    margin: 0 0 0.9rem;
    font-size: 2rem;
    text-transform: uppercase;
    font-weight: 900;
}

.info-modal-card p {
    margin: 0 0 0.85rem;
    color: black;
}

.info-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font: inherit;
    background: none;
    border: 0;
    border-radius: 5px;
    min-width: 2rem;
    min-height: 2rem;
    cursor: pointer;
}


.stamp-controls {
    position: fixed;
    left: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: stretch;
    z-index: 20;
    pointer-events: none;
}

.tool-controller {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: rgb(223 234 255 / 92%);
    box-shadow: 0 12px 30px rgb(35 52 88 / 18%);
    backdrop-filter: blur(8px);
    z-index: 24;
}

.tool-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tool-toggle {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #c8d8fb;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

.tool-toggle svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: #203561;
}

.tool-toggle.is-active {
    background: #fafcff;
    transform: translateY(1px);
}

.tool-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #203561;
    font-weight: 700;
    text-transform: lowercase;
}

.tool-slider {
    width: min(26vw, 220px);
    accent-color: #203561;
    cursor: pointer;
}

.tool-mobile-actions {
    display: none;
    align-items: center;
    gap: 0.45rem;
}

.sound-toggle-mobile,
.clear-stamps-mobile {
    min-width: 0;
}

body.use-overlay-cursor,
body.use-overlay-cursor * {
    cursor: none !important;
}

.cursor-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 60;
}

.cursor-overlay[hidden] {
    display: none;
}

.cursor-overlay.is-eraser {
    border: 3px solid #ff6f7f;
    border-radius: 999px;
    background: transparent;
}

.cursor-overlay-art {
    width: 100%;
    height: 100%;
    display: block;
}

.stamp-buttons {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.size-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.7rem;
    text-transform: lowercase;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.size-input-wrap span {
    font-size: 0.95rem;
}

.clear-stamps,
.size-button,
.sound-toggle,
.cursor-option,
.size-input {
    font: inherit;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    background-color: #dfeaff;
    border: 0px;
    border-radius: 5px;
}

.size-input {
    width: 5rem;
    cursor: text;
    padding: 0.45rem 0.6rem;
}

.size-button {
    min-width: 2.5rem;
    padding: 0.5rem 0.75rem;
}

.sound-toggle {
    white-space: nowrap;
    min-width: 2.9rem;
    text-align: center;
}

.sound-tooltip {
    position: absolute;
    left: 57%;
    bottom: calc(100% + 0.5rem);
    transform: translateX(-50%) translateY(0.2rem);
    max-width: min(14rem, calc(100vw - 2rem));
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: #fafcff;
    color: #234;
    font-size: 0.84rem;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 8px 18px rgb(35 52 88 / 14%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.sound-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 85%;
    width: 0.7rem;
    height: 0.7rem;
    background: #fafcff;
    transform: translateX(-50%) rotate(45deg);
}

.sound-tooltip.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cursor-panel {
    position: fixed;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: stretch;
    z-index: 20;
}

.panel-label {
    margin: 0;
    text-transform: lowercase;
}

.stamp-preview-wrap {
    display: flex;
    align-items: left;
    padding: 0.55rem 0.7rem;
    pointer-events: none;
    position: relative;
    z-index: 0;
}

.stamp-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    line-height: 1;
    pointer-events: none;
}

.cursor-option {
    width: 100%;
    justify-content: flex-start;
    padding: 0.45rem 0.75rem;
    font-size: 1rem;
    text-align: left;
}

.clear-stamps:hover,
.size-button:hover,
.sound-toggle:hover,
.cursor-option:hover,
.tool-toggle:hover,
.info-button:hover,
.info-close:hover {
    background: #fafcff;
}

.size-input:focus {
    outline: 2px solid rgba(149, 176, 226, 0.9);
    background: #fafcff;
}

.cursor-option.is-active {
    background: #fafcff;
    transform: translateY(1px);
}

.stamp {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) rotate(var(--stamp-rotate, -14deg)) scale(1);
    font-size: 3rem;
    line-height: 1;
    pointer-events: none;
    animation: stamp-pop 220ms ease-out forwards;
    z-index: 10;
}

.stamp-art {
    display: block;
    width: 1em;
    height: 1em;
}

.stamp-art-preview {
    width: 1em;
    height: 1em;
}

.smiley img, .peachy img {
    width: 40px;
}

@keyframes stamp-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--stamp-rotate, -14deg)) scale(1.7);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--stamp-rotate, -14deg)) scale(1);
    }
}

@media (max-width: 700px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    body {
        overflow-x: hidden;
    }

    h1 {
        margin: 0;
        font-size: clamp(3rem, 10vw, 3.2rem);
    }

    .jelly {
        right: 5%;
        top: 20px;
        bottom: auto;
        left: auto;
        transform: none;
        text-align: center;
    }

    .info-button {
        top: auto;
        right: 10px;
        bottom: calc(176px + env(safe-area-inset-bottom, 0px));
    }

    .info-modal-card {
        width: min(28rem, calc(100vw - 1.2rem));
        padding: 1.1rem 0.95rem 0.9rem;
    }

    .welcome {
        min-height: calc(100vh - 100px);
    }

    .cursor-panel {
        top: 10px;
        left: 10px;
        width: auto;
        max-width: min(250px, calc(100vw - 20px));
        padding: 0.7rem;
        gap: 0.5rem;
        box-sizing: border-box;
        flex-direction: column;
        margin: auto;
    }

    .stamp-controls {
        left: 10px;
        right: 10px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: min(calc(100vw - 20px), 100%);
        box-sizing: border-box;
        z-index: 20;
    }

    .tool-controller {
        display: flex;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: auto;
        transform: none;
        align-items: center;
        max-width: min(calc(100vw - 20px), 100%);
        box-sizing: border-box;
        padding: 0.6rem 0.75rem;
        gap: 0.75rem;
        border-radius: 18px;
    }

    .tool-mobile-actions {
        display: flex;
    }

    .stamp-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr 1.3fr 1.4fr;
    }

    .stamp-buttons .size-button,
    .stamp-buttons .sound-toggle,
    .stamp-buttons .clear-stamps {
        display: none;
    }

    .stamp-controls .size-input-wrap {
        display: none;
    }

    .sound-tooltip {
        display: block;
    }

    .size-input-wrap {
        padding: 0 0.6rem;
    }

    .clear-stamps,
    .size-button,
    .sound-toggle,
    .cursor-option,
    .size-input {
        min-height: 44px;
        font-size: 0.95rem;
        padding: 0.6rem 0.75rem;
        box-sizing: border-box;
    }

    .size-input {
        width: 4.75rem;
    }

    .stamp-preview-wrap {
        padding: 0.45rem 0.6rem;
    }

    .panel-label {
        font-size: 0.9rem;
    }

    .tool-toggle {
        width: 2.8rem;
        height: 2.8rem;
        min-width: 2.8rem;
    }

    .tool-slider-wrap {
        flex: 1;
        min-width: 0;
        gap: 0.6rem;
    }

    .tool-slider-wrap span {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .tool-slider {
        width: 100%;
        min-width: 0;
    }

    .sound-toggle-mobile,
    .clear-stamps-mobile {
        min-height: 44px;
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
        box-sizing: border-box;
        border-radius: 999px;
    }

    body.use-overlay-cursor,
    body.use-overlay-cursor * {
        cursor: auto !important;
    }

    .cursor-overlay {
        display: none !important;
    }
}

@media (min-width: 701px) {
    .tool-controller {
        display: inline-flex;
    }

    .stamp-controls .size-input-wrap,
    .stamp-controls .size-button {
        display: none;
    }

    .sound-tooltip {
        display: none;
    }
}
