:root {
    --bg-dark: #1a0509;
    --bg-light: #4a0e18;
    --primary-pink: #ff758c;
    --deep-red: #b20a2c;
    --glass: rgba(50, 10, 20, 0.4);
}

html {
    background-color: #1a0509;
    /* Match your dark background color */
    height: 100%;
    margin: 0;
    padding: 0;
}

canvas {
    display: block;
    /* Removes the bottom text-gap */
    vertical-align: top;
}

body {
    margin: 0;
    overflow: hidden;
    background: radial-gradient(circle at center, var(--bg-light), var(--bg-dark));
    font-family: 'Roboto', system-ui, sans-serif;

    /* FIX: Use dynamic height to respect mobile toolbars */
    height: 100dvh;
    width: 100vw;
    color: white;
}



/* --- FLOATING PARTICLES --- */
#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Behind everything */
    pointer-events: none;
}

.particle {
    position: absolute;
    bottom: -10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: floatUp linear infinite;
}

/* Make some particles look like hearts */
.heart-particle {
    background-color: transparent;
}

.heart-particle::before {
    content: "♥";
    color: rgba(255, 100, 150, 0.3);
    font-size: 20px;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes boxGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 117, 140, 0.3);
    }

    50% {
        box-shadow: 0 0 50px rgba(255, 117, 140, 0.8), 0 0 10px #fff;
        border-color: #fff;
    }

    100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 117, 140, 0.3);
    }
}

/* Class to trigger the animation */
.result-pop {
    animation: boxGlow 0.8s ease-out;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ui-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    box-sizing: border-box;
}

.top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 20px;
}

.header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    margin: 0;
    background: linear-gradient(to bottom, #fff, #ffc3cf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
}

.header p {
    font-size: 1rem;
    font-style: italic;
    color: var(--primary-pink);
    opacity: 0.8;
    margin-top: 5px;
}

/* --- MODE SWITCH STYLES --- */
.mode-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;

    /* --- THESE TWO LINES FIX THE CLICK ISSUE --- */
    pointer-events: auto;
    z-index: 20;
}

.mode-label {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    opacity: 0.8;
}

.wild-label {
    color: #ff0055;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0055;
}

/* The Switch Box */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffcdd2;
    /* Soft Pink (Normal) */
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Wild Mode Active State */
input:checked+.slider {
    background-color: #880e4f;
    /* Deep Red (Wild) */
}

input:checked+.slider:before {
    transform: translateX(30px);
}

/* Result Box */
.result-display {
    margin-top: 20px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 117, 140, 0.3);
    padding: 20px 50px;
    border-radius: 60px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.heart-icon {
    font-size: 1.2rem;
    color: var(--deep-red);
    margin-bottom: 5px;
}

.result-text {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(255, 117, 140, 0.6);
    animation: fadeUp 0.8s ease forwards;
    line-height: 1.4;
}

.bottom-section {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 50px;
    pointer-events: auto;
    padding-bottom: 80px;
}

.heartbeat-btn {
    background: linear-gradient(45deg, var(--deep-red), #ff4d6d);
    border: none;
    padding: 18px 45px;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.heartbeat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 77, 109, 0.7);
}

.heartbeat-btn:disabled {
    background: #444;
    box-shadow: none;
    cursor: not-allowed;
    color: #aaa;
    transform: none;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MOBILE RESPONSIVENESS --- */
/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .header p {
        font-size: 0.9rem;
    }

    .result-display {
        min-width: 80%;
        padding: 15px 20px;
        margin-top: 10px;
        border-radius: 40px;
    }

    .result-text {
        font-size: 1.4rem;
    }

    .heartbeat-btn {
        padding: 15px 30px;
        font-size: 1rem;
        width: 80%;
    }

    .ui-layer {
        padding: 10px 0;
    }

    /* Pushes button up so it doesn't get cut off */
    .bottom-section {
        padding-bottom: 80px;
    }
}