:root {
    --primary: #2ecc71;
    --bg-color: #000;
    --text-primary: #fff;
    --font-main: system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-main);
    touch-action: none; /* Prevent browser pull-to-refresh */
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to game */
    display: flex;
    flex-direction: column;
}

.hud-top {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.score-pill {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 30px;
    color: white;
    font-weight: 900;
    font-size: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-pill.pulse {
    transform: scale(1.1);
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-ui {
    animation: shake 0.4s;
}
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    font-weight: 900;
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.combo-text {
    font-size: 12px;
    color: #ffd32a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.combo-text.active {
    opacity: 1;
}

.lives {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.heart-box {
    width: 35px;
    height: 35px;
    background: #2ecc71;
    border: 3px solid #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: opacity 0.3s, transform 0.3s;
}

.heart-box.lost {
    opacity: 0.3;
    transform: scale(0.8);
    background: #95a5a6;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.title {
    color: white;
    font-size: 48px;
    margin: 0 0 10px 0;
    font-weight: 900;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    text-align: center;
    letter-spacing: 2px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin: 0 0 40px 0;
    text-align: center;
}

.action-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
}

#flash-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.5s ease-out;
}