html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-color: #000;
    cursor: none;
    /* Hide cursor on desktop */
}

/* Show cursor on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {

    html,
    body {
        cursor: auto;
    }
}

#flagdiv {
    background-image: url("assets/flag.gif");
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    top: 23%;
    height: 50%;
    left: 20%;
    width: 60%;
}

#firediv {
    background-image: url("assets/fire.gif");
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    top: 15%;
    height: 50%;
    left: 20%;
    width: 60%;
    visibility: hidden;
}

#counter {
    position: absolute;
    top: 8%;
    width: 80%;
    left: 10%;
    font-family: 'Press Start 2P', monospace;
    color: #ff0;
    font-size: 50px;
    text-align: center;
    z-index: 100;
}

#lighterImage {
    position: fixed;
    width: 80px;
    height: 80px;
    background-image: url("assets/lighter.png");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.2s ease;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transform: translate(-50%, -50%);
    /* Center on cursor */
}

#lighterImage.clicking {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.5));
}

/* Mobile/touch device styles - return to drag behavior */
@media (hover: none) and (pointer: coarse) {
    #lighterImage {
        position: absolute;
        bottom: 20%;
        right: 5%;
        width: 120px;
        height: 120px;
        pointer-events: auto;
        touch-action: none;
        cursor: grab;
        transform: none;
    }

    #lighterImage:active,
    #lighterImage.dragging {
        cursor: grabbing;
        transform: scale(1.1);
        filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.5));
    }
}

#flameImage {
    position: fixed;
    width: 30px;
    height: 45px;
    background-image: url("assets/flame0.png");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 999;
    opacity: 0;
    transform-origin: bottom center;
    transition: opacity 0.3s ease, transform 0.1s ease;
    pointer-events: none;
    transform: translate(-15px, -80px);
    /* Position at tip of lighter */
}

/* Mobile flame positioning */
@media (hover: none) and (pointer: coarse) {
    #flameImage {
        position: absolute;
        width: 40px;
        height: 60px;
        transform: none;
    }

    #flameImage.active {
        animation: flameFlickerMobile 0.3s infinite alternate;
    }
}

@keyframes flameFlickerMobile {
    0% {
        background-image: url("assets/flame0.png");
        transform: scale(1);
    }

    25% {
        background-image: url("assets/flame1.png");
        transform: scale(1.05);
    }

    50% {
        background-image: url("assets/flame2.png");
        transform: scale(0.95);
    }

    75% {
        background-image: url("assets/flame3.png");
        transform: scale(1.02);
    }

    100% {
        background-image: url("assets/flame0.png");
        transform: scale(1);
    }
}

#flameImage.active {
    opacity: 1;
    animation: flameFlicker 0.3s infinite alternate;
}

@keyframes flameFlicker {
    0% {
        background-image: url("assets/flame0.png");
        transform: translate(-20px, -80px) scale(1);
    }

    25% {
        background-image: url("assets/flame1.png");
        transform: translate(-20px, -82px) scale(1.05);
    }

    50% {
        background-image: url("assets/flame2.png");
        transform: translate(-20px, -80px) scale(0.95);
    }

    75% {
        background-image: url("assets/flame3.png");
        transform: translate(-20px, -82px) scale(1.02);
    }

    100% {
        background-image: url("assets/flame0.png");
        transform: translate(-20px, -80px) scale(1);
    }
}

#social {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100%;
    text-align: right;
    z-index: 2000;
}

#social img {
    width: 100px;
    margin-left: 10px;
    margin-right: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

#social img:active,
#social img:focus {
    transform: scale(1.1);
}

#social img:hover {
    cursor: pointer;
    transform: scale(1.1);
}

a {
    text-decoration: none;
}

canvas {
    display: block;
}

@media (max-width: 600px) {

    #flagdiv,
    #firediv {
        top: 18%;
        left: 5%;
        width: 90%;
        height: 40%;
    }

    #counter {
        font-size: 20px;
        top: 4%;
        left: 5%;
        width: 90%;
        padding: 8px;
    }

    #lighterImage {
        width: 80px !important;
        height: 80px !important;
        bottom: 15% !important;
        right: 3% !important;
    }

    #flameImage {
        width: 25px !important;
        height: 35px !important;
    }

    #social img {
        width: 48px;
        margin-left: 6px;
        margin-right: 6px;
    }

    #social {
        bottom: 10px;
        right: 10px;
    }
}