* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    touch-action: none; /* Crucial for mobile browser performance */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    position: relative;
    width: 100vw;
    max-width: 500px;
    height: 100vh;
    max-height: 900px;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Minimalist clouds */
#game-container::before, #game-container::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    pointer-events: none;
}

#game-container::before {
    width: 150px;
    height: 40px;
    top: 20%;
    left: 10%;
    box-shadow: 20px -20px 0 10px rgba(255, 255, 255, 0.6),
                -20px -10px 0 5px rgba(255, 255, 255, 0.6);
    animation: drift 40s linear infinite;
}

#game-container::after {
    width: 100px;
    height: 30px;
    top: 60%;
    right: 15%;
    box-shadow: 15px -15px 0 5px rgba(255, 255, 255, 0.6);
    animation: drift 30s linear infinite reverse;
}

@keyframes drift {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(0); }
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
}

#score-board {
    color: #333;
    font-weight: 800;
    font-size: 1.4rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#high-score {
    font-size: 1rem;
    color: #555;
}

#wind-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.8);
    padding: 10px 15px;
    border-radius: 15px;
    transition: opacity 0.3s;
    font-weight: bold;
    color: #444;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#wind-indicator.hidden {
    opacity: 0;
}

#wind-text {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

#wind-arrow {
    font-size: 2rem;
    transition: transform 0.3s;
}

#game-arena {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#wind-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#balloon {
    position: absolute;
    width: 60px;
    height: 75px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Let arena catch the clicks to compute distance */
    z-index: 20;
    /* Do not add translation/scale transitions here to keep physics sync tight */
}

.balloon-body {
    width: 60px;
    height: 70px;
    background: radial-gradient(circle at 30% 30%, #ff5e62, #e63946);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    position: relative;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.2);
}

.balloon-body::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    background: #c1121f;
    border-radius: 3px;
}

.balloon-string {
    position: absolute;
    bottom: -25px;
    left: 50%;
    width: 2px;
    height: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateX(-50%);
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    backdrop-filter: blur(3px);
    cursor: pointer;
}

#game-over-screen.hidden {
    display: none;
}

#game-over-screen h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #ff5e62;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#final-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.restart-hint {
    font-size: 1.1rem;
    color: #ccc;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
