body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* prevent scrollbars from appearing when canvas is larger than viewport */
    background-image: url(../Assets/tilemaps/bg/idle.png);
    background-size: 11.11dvh 11.11dvh;
    image-rendering: pixelated;
}

/* Mobile hardening: disable long-press selection and double-tap zoom across page */
html,
body,
a,
button,
canvas {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: -1;
    /* keep pointer events so canvas still receives input where it is visible */
    pointer-events: auto;
    image-rendering: pixelated;
    user-select: none; /* prevent text selection on drag */
    display: block;
}
#darken {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: radial-gradient(circle at 50% 50%,#11001177, #110011CC); /* semi-transparent black */
    z-index: 1;
}
h1 {
    position: fixed;
    top: 0%;
    left: 5%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10dvh;
    z-index: 2;
    cursor:default;
    background:linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
    background-clip: text; 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
#under {
    text-shadow: rgba(0,0,0,1) 0 0 3dvh;
    z-index: 1;
.is-grabbing, .is-grabbing * {
    cursor: grabbing !important;
}
}
#description {
    position: fixed;
    top: 25%;
    left: 7%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 3.5dvh;
    z-index: 2;
    text-decoration: none;
    /* hide original text but keep it accessible to assistive tech */
    color: transparent;
}

/* Use a pseudo-element to display the description text with solid color (no background-clip) */
#description::after {
    content: attr(data-text);
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-block;
    width: auto;
    color: #f0f0f0;
    text-shadow: 0 0.1dvh 0.2dvh rgba(0,0,0,0.8);
    transition: transform 0.15s ease, color 0.15s ease;
    pointer-events: none; /* allow clicks to reach the anchor */
    transform: translate(-50%, -50%);
    white-space: nowrap; /* prevent text wrapping */
    word-break: normal;
    overflow: visible;
    cursor: grabbing;
}

#description:hover::after {
    content: "Youtube channel";
    color: #4f71fb;
    text-decoration: underline;
    transform: translate(-50%, -50%) scale(1.05) rotate(1deg);
}

#description:active::after {
    content: "Drag to cancel";
    color: #f03c3c;
    text-decoration: underline;
    transform: translate(-50%, -50%) scale(0.94) rotate(-1deg);
}
#startBtn {
    position: fixed;
    top: 40%;
    left: 5%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 4.2dvh;
    width: 30dvh;
    height: 10dvh;
    text-align: center;
    color: #FFFFFF;
    padding: 0 1.5dvh;
    border: 0.5dvh solid #888888FF;
    border-radius: 0.5dvh;
    z-index: 2;
    transition: background-color 0.3s, color 0.3s; /* smooth hover transition */
    background-color: #444444FF;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s transform 0.6s; /* smooth hover transition */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
}

/* Level Select button (same style as Start, positioned beneath it) */
#levelSelectBtn {
    position: fixed;
    top: 58%;
    left: 5%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 4.2dvh;
    width: 30dvh;
    height: 10dvh;
    text-align: center;
    color: #FFFFFF;
    padding: 0 1.5dvh;
    border: 0.5dvh solid #888888FF;
    border-radius: 0.5dvh;
    z-index: 2;
    transition: background-color 0.3s, color 0.3s;
    background-color: #444444FF;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s; /* smooth hover transition */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
}
#levelSelectBtn:hover {
    background-color: #999999FF;
    color: #FFFFFF;
    transform: scale(1.05) rotate(1deg); /* slightly enlarge on hover */
}
#levelSelectBtn:active {
    background-color: #222255FF;
    color: #FFFFFF;
    transform: scale(0.94) rotate(-1deg); /* slightly shrink on click */
    cursor: grabbing;
}
#startBtn:hover {
    background-color: #999999FF;
    color: #FFFFFF;
    transform: scale(1.05) rotate(-1deg); /* slightly enlarge on hover */
}
#startBtn:active {
    background-color: #225522FF;
    color: #FFFFFF;
    transform: scale(0.94) rotate(1deg); /* slightly shrink on click */
    cursor: grabbing;
}

@media (orientation: portrait) {
    body {
        background-size: 11.11vw 11.11vw;
    }

    canvas,
    #darken {
        height: 100dvh;
    }

    h1 {
        font-size: 10vw;
    }

    #description {
        top: 24vw;
        left: 5vw;
        font-size: 3.5vw;
    }

    #description::after {
        max-width: 90vw;
    }

    #startBtn,
    #levelSelectBtn {
        left: 5vw;
        width: 42vw;
        height: 12vw;
        font-size: 4.2vw;
        padding: 0 2vw;
    }

    #startBtn {
        top: 40vw;
    }

    #levelSelectBtn {
        top: 56vw;
    }
}

/* Mobile UX: prevent selecting UI text and double-tap zoom on controls */
h1,
#description,
#startBtn,
#levelSelectBtn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

