* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    touch-action: none; /* Prevent scrolling/zooming during touch drag */
}

body {
    background-color: #1a1a2e; /* Dark fallback wrapper */
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    box-shadow: 0 0 50px rgba(0,0,0,0.6);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.4);
    overflow: hidden;
    cursor: auto;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 12px;
}

#score-display {
    position: absolute;
    top: 70px;
    left: 30px;
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    -webkit-text-stroke: 1px #333; /* Make it pop */
    text-shadow: 3px 3px 0 #333, 4px 4px 10px rgba(0,0,0,0.5);
    pointer-events: none;
}

#in-game-highscore-display {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 800;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    backdrop-filter: blur(4px);
    color: #fff;
}

.highscore-icon {
    font-size: 18px;
}

#in-game-highscore-name {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.highscore-divider {
    color: rgba(255,255,255,0.3);
    font-weight: 400;
}

#in-game-highscore-value {
    color: #FFD700;
    font-size: 18px;
    text-shadow: 1px 1px 0 #000;
}

#limit-counters {
    position: absolute;
    top: 70px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.limit-display {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    -webkit-text-stroke: 1px #333;
    text-shadow: 2px 2px 0 #333, 3px 3px 5px rgba(0,0,0,0.5);
}

#powerup-display {
    position: absolute;
    top: 110px;
    left: 30px;
    font-size: 24px;
    font-weight: 800;
    color: #FFD700;
    -webkit-text-stroke: 1px #333;
    text-shadow: 2px 2px 0 #333, 3px 3px 5px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: opacity 0.3s;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1);
    pointer-events: auto; /* Re-enable pointer events for buttons inside screens */
    width: 85%;
    max-width: 350px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.start-icon {
    font-size: 75px;
    margin-bottom: 5px;
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.2));
}

@keyframes floatIcon {
    0% { transform: translateY(0px) rotate(-5deg); }
    50% { transform: translateY(-12px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(-5deg); }
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 900;
}

.screen p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #555;
    line-height: 1.4;
}

button {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    padding: 16px 36px;
    font-size: 22px;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:active {
    transform: scale(0.92);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
}

button:hover {
    filter: brightness(1.1);
}

#highscore-board {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: left;
}

#highscore-board h3 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;
    color: #4A2E12;
}

#highscore-list {
    list-style-type: none;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

#highscore-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

#highscore-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#player-name-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

#whatsapp-share-button {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 8px 15px rgba(37, 211, 102, 0.4);
    margin-top: 15px;
    padding: 12px 24px;
    font-size: 16px;
}

#whatsapp-share-button:active {
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.4);
}
