* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

body {
    font-family: 'Bebas Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    background-color: #f5f1e8;
    cursor: default;
}

/*
Z-INDEX HIERARCHY:
- parallax-container: 1 (contains background/text/midground/foreground layers)
  - background-layer: 1
  - content-overlay (text): 2
  - midground-layer: 3
  - foreground-layer: 4
- coffee-cup-img: 100 (interactive element)
- particleCanvas: 101 (particles above coffee cup)
- signature: 200 (always on top)
*/

/* Parallax container and layers */
.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.parallax-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease-out;
    will-change: transform;
    pointer-events: none;
}

.background-layer {
    background-image: url('images/background.png');
    z-index: 1;
}

.midground-layer {
    background-image: url('images/midground.png');
    z-index: 3;
}

.foreground-layer {
    background-image: url('images/foreground.png');
    z-index: 4;
}

/* Signature */
.signature {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(61, 40, 23, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    background: rgba(245, 241, 232, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.signature:hover {
    color: rgba(61, 40, 23, 1);
    background: rgba(245, 241, 232, 0.9);
}

/* Counter */
.counter {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 200;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(61, 40, 23, 0.8);
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    background: rgba(245, 241, 232, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Hold progress bar */
.hold-progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 250;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hold-progress-container.visible {
    opacity: 1;
}

.hold-progress-bar {
    height: 100%;
    width: 0%;
    background: white;
    transition: width 2s linear;
}

.hold-progress-bar.filling {
    width: 100%;
}

/* Coffee cup image */
.coffee-cup-img {
    position: fixed;
    left: 28%;
    top: 66vh;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: default;
    transition: transform 0.3s ease-out, filter 0.3s ease;
    width: 24.5vw;
    min-width: 150px;
    max-width: 400px;
    will-change: transform;
}

.coffee-cup-img:hover {
    filter: brightness(1.1) drop-shadow(0 0 20px rgba(139, 90, 43, 0.6));
}

.coffee-cup-img:active {
    filter: brightness(0.95);
}

/* Content overlay */
.content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.content-overlay.text-focused {
    z-index: 150;
    transform: scale(1.02);
}

.container {
    text-align: left;
    padding: 0;
    max-width: 100%;
    width: 100%;
    pointer-events: auto;
    position: relative;
    min-height: 20vh;
}

/* Typography */
.question {
    font-size: clamp(3.88125rem, 11.64375vw, 11.64375rem);
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: #ffffff;
    line-height: 1.0;
    text-shadow: 3px 3px 8px rgba(61, 40, 23, 0.3);
    font-style: normal;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    word-spacing: 0.05em;
    width: 100%;
    max-width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

/* Button styling */
.decision-button {
    background: rgba(139, 90, 43, 0.9);
    border: 3px solid #8b5a2b;
    padding: 1.5rem 3.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #f5f1e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(61, 40, 23, 0.3),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    text-transform: none;
    letter-spacing: 1px;
    font-family: 'Georgia', 'Times New Roman', serif;
    position: relative;
    overflow: hidden;
}

.decision-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.decision-button:hover::before {
    left: 100%;
}

.decision-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(61, 40, 23, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
    background: rgba(160, 103, 50, 0.95);
}

.decision-button:active {
    transform: translateY(-1px);
}

.decision-button.clicked {
    animation: gentlePulse 0.6s ease;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

/* Answer container */
.answer-container {
    margin: 0;
    min-height: 140px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.answer {
    font-size: clamp(3.88125rem, 11.64375vw, 11.64375rem);
    font-weight: 700;
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: #ffffff;
    line-height: 1.0;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: -0.08em;
    text-shadow: 3px 3px 8px rgba(61, 40, 23, 0.3);
    width: 100%;
    max-width: 100%;
    cursor: pointer;
}

.answer.show {
    opacity: 1;
}

@keyframes dramaticEntry {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.7) rotate(-5deg);
        filter: blur(8px);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.05) rotate(1deg);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
        filter: blur(0px);
    }
}

/* Coffee count */
.coffee-count {
    margin-top: 3rem;
    font-size: 1.1rem;
    color: #5d4227;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.coffee-count span {
    font-weight: 700;
    font-size: 1.5rem;
    color: #8b5a2b;
    font-style: normal;
    transition: transform 0.2s ease;
    display: inline-block;
}

/* Easter egg rainbow animation */
@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Hold animation variations */
@keyframes rainbowSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        filter: hue-rotate(0deg) brightness(1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.2);
        filter: hue-rotate(180deg) brightness(1.3);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        filter: hue-rotate(360deg) brightness(1);
    }
}

@keyframes earthquakeShake {
    0%, 100% {
        transform: translate(-50%, -50%);
        filter: brightness(1);
    }
    10% { transform: translate(-45%, -55%) rotate(5deg); }
    20% { transform: translate(-55%, -45%) rotate(-5deg); }
    30% { transform: translate(-48%, -52%) rotate(3deg); }
    40% { transform: translate(-52%, -48%) rotate(-3deg); }
    50% { transform: translate(-50%, -50%) scale(1.1); filter: brightness(1.3); }
    60% { transform: translate(-48%, -52%) rotate(2deg); }
    70% { transform: translate(-52%, -48%) rotate(-2deg); }
    80% { transform: translate(-49%, -51%) rotate(1deg); }
    90% { transform: translate(-51%, -49%) rotate(-1deg); }
}

@keyframes pulseBeat {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }
    25% {
        transform: translate(-50%, -50%) scale(0.7);
        filter: brightness(0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        filter: brightness(1.5) saturate(1.5);
    }
    75% {
        transform: translate(-50%, -50%) scale(0.9);
        filter: brightness(0.9);
    }
}

@keyframes spiralAscend {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(-50%, -70%) rotate(720deg) scale(0.5);
        filter: brightness(1.5) hue-rotate(180deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(1440deg) scale(1);
    }
}

@keyframes colorCycle {
    0% { filter: brightness(1.2) saturate(2) hue-rotate(0deg); }
    20% { filter: brightness(1.3) saturate(2) hue-rotate(72deg); }
    40% { filter: brightness(1.2) saturate(2) hue-rotate(144deg); }
    60% { filter: brightness(1.3) saturate(2) hue-rotate(216deg); }
    80% { filter: brightness(1.2) saturate(2) hue-rotate(288deg); }
    100% { filter: brightness(1.2) saturate(2) hue-rotate(360deg); }
}

@keyframes bouncyParty {
    0%, 100% { transform: translate(-50%, -50%); }
    10% { transform: translate(-50%, -70%) scale(1.1); }
    20% { transform: translate(-50%, -50%) scale(0.9); }
    30% { transform: translate(-30%, -50%) scale(1.1) rotate(20deg); }
    40% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); }
    50% { transform: translate(-50%, -30%) scale(1.2) rotate(-20deg); }
    60% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); }
    70% { transform: translate(-70%, -50%) scale(1.1) rotate(20deg); }
    80% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); }
    90% { transform: translate(-50%, -60%) scale(1.1); }
}

@keyframes glitchEffect {
    0%, 100% {
        transform: translate(-50%, -50%);
        filter: brightness(1);
    }
    10% {
        transform: translate(-48%, -50%);
        filter: brightness(1.5) hue-rotate(90deg);
    }
    20% {
        transform: translate(-52%, -50%);
        filter: brightness(0.8) hue-rotate(180deg);
    }
    30% {
        transform: translate(-50%, -48%);
        filter: brightness(1.3) hue-rotate(270deg);
    }
    40% {
        transform: translate(-50%, -52%);
        filter: brightness(1.1) invert(0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        filter: brightness(1.4) contrast(1.5);
    }
    60% {
        transform: translate(-51%, -49%);
        filter: brightness(1.2) saturate(3);
    }
    80% {
        transform: translate(-49%, -51%);
        filter: brightness(1) hue-rotate(45deg);
    }
}

@keyframes explosionBurst {
    0% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(2.5);
        filter: brightness(2) saturate(2) blur(5px);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
        opacity: 1;
    }
}

@keyframes rotationMatrix {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(0deg);
    }
    25% {
        transform: translate(-50%, -50%) rotateY(180deg) rotateX(20deg) scale(1.2);
        filter: brightness(1.3);
    }
    50% {
        transform: translate(-50%, -50%) rotateY(360deg) rotateX(0deg) scale(1);
    }
    75% {
        transform: translate(-50%, -50%) rotateY(540deg) rotateX(-20deg) scale(1.2);
        filter: brightness(1.3);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(720deg) rotateX(0deg);
    }
}

@keyframes waveDistortion {
    0%, 100% {
        transform: translate(-50%, -50%);
        filter: brightness(1);
    }
    10% { transform: translate(-50%, -50%) scaleY(1.3) scaleX(0.8); }
    20% { transform: translate(-50%, -50%) scaleY(0.8) scaleX(1.3); }
    30% { transform: translate(-50%, -50%) scaleY(1.2) scaleX(0.9) rotate(10deg); }
    40% { transform: translate(-50%, -50%) scaleY(0.9) scaleX(1.2) rotate(-10deg); }
    50% { transform: translate(-50%, -50%) scaleY(1.4) scaleX(0.7); filter: brightness(1.4); }
    60% { transform: translate(-50%, -50%) scaleY(0.7) scaleX(1.4) rotate(5deg); }
    70% { transform: translate(-50%, -50%) scaleY(1.1) scaleX(0.95) rotate(-5deg); }
    80% { transform: translate(-50%, -50%) scaleY(0.95) scaleX(1.1); }
    90% { transform: translate(-50%, -50%) scaleY(1.05) scaleX(0.98); }
}

/* Golden shimmer animation for 10th click */
@keyframes goldenShimmer {
    0% {
        filter: brightness(1) saturate(1) drop-shadow(0 0 0px rgba(255, 215, 0, 0));
    }
    25% {
        filter: brightness(1.4) saturate(1.8) drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: brightness(1.6) saturate(2) drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
    75% {
        filter: brightness(1.4) saturate(1.8) drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
    }
    100% {
        filter: brightness(1) saturate(1) drop-shadow(0 0 0px rgba(255, 215, 0, 0));
    }
}

/* Duplicate coffee cups animation */
.duplicate-cup {
    position: fixed;
    width: 24.5vw;
    min-width: 150px;
    max-width: 400px;
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    filter: brightness(1.6) saturate(2) drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    transition: opacity 0.3s ease;
}

/* Responsive design */
@media (max-width: 900px) {
    .container {
        padding: 0;
    }

    .decision-button {
        padding: 1.2rem 2.5rem;
        font-size: 1.2rem;
    }

    .parallax-layer {
        /* Reduce parallax effect on mobile */
        background-size: cover;
    }

    .signature {
        font-size: 0.75rem;
        top: 1rem;
        right: 1rem;
    }

    .coffee-cup-img {
        left: 35%;
        top: 75vh;
        width: 35vw;
    }

    .question,
    .answer {
        font-size: 12vh;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .decision-button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .coffee-cup-img {
        left: 50%;
        top: 70vh;
        width: 45vw;
    }

    .question,
    .answer {
        font-size: 10vh;
    }
}
