

/* PAGE */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #97704b;
}

body {
    font-family: Arial, sans-serif;
    overscroll-behavior: none;
}

[hidden] {
    display: none !important;
}

button {
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* GAME */

main,
#gameBox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    touch-action: none;
}

/* TITLE */

.game-header {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: max(25px, env(safe-area-inset-left));
    z-index: 10;
    pointer-events: none;
}

.game-header h1 {
    font-family: Georgia, serif;
    font-size: 48px;
    color: #f1e2c2;
    text-shadow: 2px 3px 0 #493923;
}

.game-header h1 span,
.main-menu h2 span {
    color: #e68b91;
}

.game-header p {
    display: none;
}

/* SCORE */

.game-stats {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(25px, env(safe-area-inset-right));
    z-index: 10;

    display: flex;
    gap: 25px;
    padding: 12px 20px;

    background: #283522dd;
    border-radius: 12px;

    font-family: Arial, sans-serif;
    color: #f1e2c2;
    pointer-events: none;
}

.game-stats p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;

    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.game-stats strong {
    font-size: 24px;
    color: #f3dc9c;
}

/* CONTROLS */

.instructions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    display: flex;
    gap: 25px;

    padding: 12px 20px;
    background: #283522dd;
    border-radius: 12px;

    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #f1e2c2;
    white-space: nowrap;
    pointer-events: none;
}

.instructions strong {
    color: #f3dc9c;
    margin-right: 5px;
}

/* MAIN MENU */

.main-menu {
    position: fixed;
    inset: 0;
    z-index: 20;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 24px;
    text-align: center;

    background: radial-gradient(
        ellipse at center,
        rgba(52, 66, 39, 0.94),
        rgba(28, 35, 24, 0.97)
    );

    color: #f1e2c2;
}

.main-menu h2 {
    font-family: Georgia, serif;
    font-size: clamp(65px, 12vw, 135px);
    line-height: 1;
    letter-spacing: -5px;
    text-shadow: 4px 6px 0 #172015;
}

.main-menu > p {
    max-width: 360px;
    margin: 20px 0 32px;
    font-size: 16px;
    line-height: 1.5;
    color: #dfd1af;
}

#playButton {
    padding: 16px 60px;
    border: none;
    border-radius: 12px;

    background: #e6ad76;
    color: #332718;

    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;

    box-shadow: 0 6px 0 #a46b40;
    transition: transform 0.15s, background 0.15s;
}

#playButton:hover {
    background: #f3c28e;
    transform: translateY(-2px);
}

#playButton:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a46b40;
}

/* MENU CONTROLS */

.menu-controls {
    width: min(100%, 470px);
    margin-top: 45px;
    padding: 20px;

    background: #1b261bcc;
    border: 1px solid #f1e2c230;
    border-radius: 12px;

    text-align: left;
}

.menu-controls h3 {
    margin-bottom: 14px;
    color: #e6ad76;
    font-size: 12px;
    letter-spacing: 2px;
}

.menu-controls p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.menu-controls strong {
    display: inline-block;
    min-width: 80px;
    color: #e6ad76;
}

/* MOBILE CONTROLS */

.mobile-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    padding:
        0
        max(24px, env(safe-area-inset-right))
        max(25px, env(safe-area-inset-bottom))
        max(24px, env(safe-area-inset-left));

    pointer-events: none;
}

.joystick {
    position: relative;
    width: 130px;
    height: 130px;
    padding: 0;

    border-radius: 50%;
    border: 3px solid #f1e2c280;
    background: #28352299;

    appearance: none;
    touch-action: none;
    pointer-events: auto;
    user-select: none;
}

.joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 58px;
    height: 58px;

    border-radius: 50%;
    background: #f1e2c2;
    border: 4px solid #c8a579;

    transform: translate(-50%, -50%);
    pointer-events: none;
}

.lick-button {
    width: 105px;
    height: 105px;

    border-radius: 50%;
    border: 4px solid #f5bdc1;

    background: #e68b91;
    color: #44292a;

    font-size: 22px;
    font-weight: 900;

    box-shadow: 0 6px 0 #a95d65;

    touch-action: none;
    pointer-events: auto;
    user-select: none;
}

.lick-button:active,
.lick-button.pressed {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a95d65;
}

/* MOBILE LAYOUT */

@media (max-width: 700px) {
    .game-header {
        top: max(12px, env(safe-area-inset-top));
        left: 15px;
    }

    .game-header h1 {
        font-size: 30px;
    }

    .game-stats {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
        gap: 10px;
        padding: 10px 12px;
    }

    .game-stats p {
        font-size: 8px;
        letter-spacing: 0;
    }

    .game-stats strong {
        font-size: 19px;
    }

    .instructions {
        display: none;
    }

    .joystick {
        width: 115px;
        height: 115px;
    }

    .lick-button {
        width: 92px;
        height: 92px;
        font-size: 19px;
    }

    .menu-controls {
        margin-top: 32px;
    }
}

/* SHORT SCREENS */

@media (max-height: 570px) {
    .main-menu {
        overflow-y: auto;
        justify-content: safe center;
    }

    .main-menu h2 {
        font-size: clamp(54px, 12vh, 90px);
    }

    .main-menu > p {
        margin: 12px 0 20px;
    }

    #playButton {
        padding: 12px 45px;
    }

    .menu-controls {
        margin-top: 22px;
        padding: 12px 16px;
    }

    .joystick {
        width: 95px;
        height: 95px;
    }

    .lick-button {
        width: 80px;
        height: 80px;
    }
}


