html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
    overflow: hidden;
    background: #0a0a0f; /* dark base */
    color-scheme: dark;
}

/* Parallax background container */
#bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.bg-layer {
    position: absolute;
    inset: -5%; /* bleed to avoid edges on transform */
    background-size: contain; /* ensure full image is visible without cropping */
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000; /* letterbox fill for unused space */
    filter: saturate(1.1) contrast(1.05);
    transition: background-image 0.8s ease-in-out, transform 0.1s ease-out;
}

/* depth feel via blend and subtle neon noise */
.layer1 { z-index: 1; transform: translateZ(0); }
.layer2 { z-index: 2; mix-blend-mode: screen; opacity: 0.35; }
.layer3 { z-index: 3; mix-blend-mode: overlay; opacity: 0.22; }

#overlay {
    background: radial-gradient(1200px 800px at 50% 20%, rgba(58, 12, 163, 0.18), rgba(0,0,0,0.60)) ,
                linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.5));
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 5;
    padding: 30px 20px;
    box-sizing: border-box;
}

.header {
    position: absolute;
    top: 30px;
    left: 30px;
    text-align: left;

    width: 100%;
    display: flex;
    flex-direction: column;
}

.header h1{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.controls-bottom {
    text-align: center;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.buttons-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: flex-end;
}

.container {
    text-align: center;
    width: 90%;
    max-width: 500px;
    padding-bottom: 30px;
}

h1 {
    font-size: 2.4rem;
    margin-bottom: 4px;
    margin-top: 0;
    color: #e6f3ff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.45), 0 0 28px rgba(255, 0, 255, 0.25);
    line-height: 1;
    letter-spacing: 0.05em;
}

.subtitle {
    text-align: center;
    margin: 0;
    color: #bcd7ff;
    text-shadow: 0 0 8px rgba(0, 238, 255, 0.22);
    font-size: 0.9rem;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Counter card wraps the button and the badge placed above it */
.counter-card {
    position: relative;
    padding-top: 22px;
    flex: 0 0 auto;
    min-width: unset;
}

/* Fabulous queer rainbow badge sitting above the button */
.count-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -60%);
    min-width: 54px;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1;
    text-align: center;
    color: #0a0014;
    background: linear-gradient(90deg, #ff007a, #ff8c00, #ffef00, #00f5a0, #00cfff, #8a2be2, #ff007a);
    background-size: 400% 400%;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 0 18px rgba(255, 0, 200, 0.45), 0 0 26px rgba(0, 255, 234, 0.35);
    filter: saturate(1.15);
    animation: rainbowShift 6s linear infinite;
    user-select: none;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

button[data-counter] {
    position: relative; /* for ripple */
    overflow: hidden; /* clip ripple */
    padding: 18px 20px;
    font-size: clamp(14px, 1.5vw, 18px); /* responsive text that scales down */
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    color: #eaffff;
    background:
        linear-gradient(180deg, rgba(0, 20, 25, 0.65), rgba(0, 0, 0, 0.6)) padding-box,
        linear-gradient(135deg, rgba(255, 0, 200, 0.7), rgba(0, 255, 242, 0.7)) border-box;
    backdrop-filter: blur(8px);
    transition: transform 0.18s cubic-bezier(.2,.9,.2,1), box-shadow 0.18s ease, border-color 0.2s;
    box-shadow: 0 0 0 0 rgba(0, 255, 242, 0.0), inset 0 0 24px rgba(0, 255, 242, 0.06), 0 0 28px rgba(255,0,200,0.15);
    /* Fixed button dimensions */
    width: 280px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
}

button[data-counter]:hover {
    box-shadow: 0 0 28px rgba(0, 255, 242, 0.35), 0 0 80px rgba(157, 0, 255, 0.2);
}

button[data-counter].pressed {
    box-shadow: 0 8px 40px rgba(0,0,0,0.6) inset, 0 10px 28px rgba(0,0,0,0.6);
}

button[data-counter]:active {
}

/* Ripple element */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), rgba(255,255,255,0.12));
    pointer-events: none;
    transform: scale(0.1);
    opacity: 0.9;
    animation: rippleAnim 700ms ease-out forwards;
}

@keyframes rippleAnim {
    to { transform: scale(1); opacity: 0; }
}

/* Bump animation applies to the badge now */
.count-badge.bump { }

.footer {
    margin-top: 12px;
    color: #9fb5ff;
    font-size: 0.72rem;
    text-shadow: 0 0 8px rgba(98, 0, 255, 0.4);
    opacity: 0.75;
}

/* Removed slider controls CSS (thumbs/controls). Kept layout minimal. */


.utility-row {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}
.picture-btn {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    color: #eaffff;
    background:
        linear-gradient(180deg, rgba(0, 10, 18, 0.55), rgba(0, 0, 0, 0.6)) padding-box,
        linear-gradient(135deg, rgba(0, 255, 242, 0.6), rgba(157, 0, 255, 0.6)) border-box;
    backdrop-filter: blur(6px);
    transition: transform 0.18s cubic-bezier(.2,.9,.2,1), box-shadow 0.18s ease;
    box-shadow: 0 0 0 0 rgba(0, 255, 242, 0.0), inset 0 0 18px rgba(0, 255, 242, 0.05), 0 0 20px rgba(157,0,255,0.15);
    position: relative;
    overflow: hidden;
    margin-top: 5px;
}
.picture-btn:hover {
    box-shadow: 0 0 24px rgba(0,255,242,0.35), 0 0 50px rgba(157,0,255,0.25);
}
.picture-btn:active {
}

.foot{
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

}
/* Responsive: optimize layout for mobile screens */
@media (max-width: 768px) {
    /* Center Header on Mobile so it doesn't clash with corners */


    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Remove the bottom bar layout */
    .controls-bottom {
        position: static;
        display: block;
        bottom: 0;
        width: 100%;
        height: 0;
        padding: 0;
        pointer-events: none;
    }

    .buttons-row {
        display: block;
        position: static;
        width: 100%;
        height: 100%;
    }

    /* Position cards in 4 corners */
    .counter-card {
        position: fixed;
        width: auto;
        min-width: unset;
        padding-top: 22px; /* Maintain space for badge */
        /* Ensure buttons stay above footer on mobile */
        z-index: 40;
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Corner 1: Top Left */
    .counter-card:nth-child(1) {
        top: 35px;
        left: 10px;
    }

    /* Corner 2: Top Right */
    .counter-card:nth-child(2) {
        top: 35px;
        right: 10px;
    }

    /* Corner 3: Bottom Left */
    .counter-card:nth-child(3) {
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 10px;
    }

    /* Corner 4: Bottom Right */
    .counter-card:nth-child(4) {
        bottom: calc(10px + env(safe-area-inset-bottom));
        right: 10px;
    }

    /* Button sizing for mobile corners */
    button[data-counter] {
        width: 20vw;
        max-width: 180px;
        height: 70px;
        font-size: clamp(11px, 3.5vw, 15px);
        padding: 8px;
        border-radius: 12px;
        /* Ensure desktop styles like background/shadow persist */
    }

    /* Ensure badge is readable */
    .count-badge {
        font-size: 1.5rem;
        padding: 8px 20px;
        min-width: 30px;
    }



    .picture-btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .foot {
        bottom: env(safe-area-inset-bottom);
        position: fixed;
        width: 100%;
        left: 0;
        z-index: 30;
        /* Don't block clicks to buttons positioned behind; re-enable only on the button */
        pointer-events: none;
    }

    /* Allow the footer action button to remain clickable */
    .foot .picture-btn { pointer-events: auto; }

    .header {
        position: absolute;
      
        left: 0;
        text-align: left;
        width: 100vw;
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }


}
