:root {
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --text-dark: #2c3e50;
    --grad-pink: linear-gradient(135deg, #ff80ab, #f50057);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
}

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

body { 
    font-family: var(--font-main); 
    margin: 0; 
    overflow: hidden; 
    touch-action: none; 
    user-select: none; 
}

a { text-decoration: none; }

.game-environment {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 100;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.back-btn {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-dark);
    font-weight: 900;
    padding: 10px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.back-btn:hover { background: white; transform: scale(1.05); }

.game-stats { display: flex; gap: 20px; }
.stat-box {
    background: white;
    padding: 8px 25px;
    border-radius: 25px;
    font-weight: 900;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-label { color: #546e7a; text-transform: uppercase; font-size: 1rem; letter-spacing: 0.5px; }
.text-blue { color: #0288d1; }
.text-pink { color: #f50057; font-size: 1.5rem; }
.text-purple { color: #9c27b0; }
.text-yellow { color: #fbc02d; }
.text-bold { font-weight: 900; font-size: 1.8rem; }

.custom-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 700px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: transparent;
}

.intro-modal, .outro-modal { 
    background-color: rgba(255,255,255,0.9); 
    border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    border: 4px solid white;
}

.custom-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.modal-content { padding: 20px 40px; width: 100%; display: flex; flex-direction: column; align-items: center; }

.mascot-img { height: 120px; margin-bottom: 10px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15)); }

.text-3d {
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    -webkit-text-stroke: 2px white;
    text-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

.game-instructions { font-size: 1.5rem; color: #34495e; margin-bottom: 15px; font-weight: 800; line-height: 1.4; }

.target-alert {
    background: #1e293b;
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 30px;
    border: 3px solid #fbc02d;
    text-transform: uppercase;
}

.btn-3d {
    background: linear-gradient(180deg, #ff4081, #c51162);
    color: white; border: 4px solid white; padding: 15px 50px;
    border-radius: 40px; font-size: 1.5rem; font-weight: 900;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 8px 0 #880e4f, 0 15px 25px rgba(245, 0, 87, 0.4);
    transition: all 0.15s ease;
}
.btn-3d:active { transform: translateY(8px); box-shadow: 0 0 0 #880e4f, 0 5px 10px rgba(245, 0, 87, 0.4); }

.btn-3d-alt {
    background: linear-gradient(180deg, #ffffff, #e0e0e0);
    color: #2c3e50; border: 4px solid white; padding: 15px 40px;
    border-radius: 40px; font-size: 1.3rem; font-weight: 900;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 8px 0 #9e9e9e, 0 15px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease; display: flex; align-items: center; justify-content: center;
}
.btn-3d-alt:active { transform: translateY(8px); box-shadow: 0 0 0 #9e9e9e, 0 5px 10px rgba(0, 0, 0, 0.2); }

.modal-actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.game-canvas { flex-grow: 1; position: relative; overflow: hidden; }

.bubble {
    position: absolute; bottom: -100px; border-radius: 50%;
    background-size: contain; background-position: center; background-repeat: no-repeat;
    background-color: transparent; cursor: pointer; will-change: transform;
    user-drag: none; -webkit-user-drag: none;
}

.bubble.popped { pointer-events: none; animation: popEffect 0.2s forwards ease-out; }

@keyframes popEffect {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; filter: brightness(1.5); }
    100% { transform: scale(1.8); opacity: 0; }
}

.confetti-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti-particle { position: absolute; width: 10px; height: 20px; animation: confettiFall linear forwards; }
@keyframes confettiFall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

@media (max-width: 768px) {
    .game-header { padding: 10px 15px; flex-direction: column; gap: 15px; }
    .back-btn { align-self: flex-start; font-size: 0.9rem; padding: 8px 15px; }
    .game-stats { width: 100%; justify-content: space-between; }
    .stat-box { font-size: 1.1rem; padding: 6px 15px; }
    
    .mascot-img { height: 90px; }
    .text-3d { font-size: 2.2rem; -webkit-text-stroke: 1px white; }
    .game-instructions { font-size: 1.1rem; }
    .btn-3d { font-size: 1.2rem; padding: 12px 30px; box-shadow: 0 6px 0 #880e4f, 0 10px 15px rgba(245, 0, 87, 0.4); }
    .btn-3d:active { transform: translateY(6px); box-shadow: 0 0 0 #880e4f, 0 5px 10px rgba(245, 0, 87, 0.4); }
    
    .btn-3d-alt { font-size: 1.1rem; padding: 12px 25px; box-shadow: 0 6px 0 #9e9e9e, 0 10px 15px rgba(0, 0, 0, 0.2); }
    .btn-3d-alt:active { transform: translateY(6px); box-shadow: 0 0 0 #9e9e9e, 0 5px 10px rgba(0, 0, 0, 0.2); }
    
    .custom-modal { min-height: 400px; }
    .modal-content { width: 95%; padding: 20px; }
}