/* (C) Mateusz Kanik 2026 */

/* Resets and base setup */
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background: #020203; background: radial-gradient(circle, #0a0a12 0%, #000000 100%);
    overflow: hidden; 
    font-family: 'Fredoka', sans-serif; 
    user-select: none; touch-action: none;
}

#game-container { position: relative; width: 100%; height: 100%; margin: 0 auto; background-color: #050508; overflow: hidden; }

@media (min-width: 601px) {
    #game-container { max-width: 600px; box-shadow: 0 0 50px rgba(0, 0, 0, 1), 0 0 15px rgba(0, 255, 255, 0.15); }
}

.top-bar {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 15px);
    left: 0;
    width: 100%;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 250;
    box-sizing: border-box;
    pointer-events: none;
}

.lang-dropdown {
    pointer-events: auto;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #0ff;
    color: #0ff;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,255,255,0.2);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: center;
}
.lang-dropdown option { background: #0a0a10; color: #fff; }

.top-right-controls {
    pointer-events: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}

.compact-input {
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
    width: 95px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    height: 34px;
    box-sizing: border-box;
}

.compact-name {
    padding: 0 6px;
    background: rgba(0, 255, 0, 0.15);
    border: 2px solid #00ff00;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.compact-btn {
    padding: 0 10px !important;
    margin: 0 !important;
    width: auto !important;
    height: 34px;
    font-size: 1rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    box-sizing: border-box;
}

#ui { 
    position: absolute; top: env(safe-area-inset-top, 5%); width: 100%; text-align: center; pointer-events: none; z-index: 100; display: none; 
}
#score { font-size: 5.5rem; font-weight: 700; color: #fff; line-height: 0.8; text-shadow: 4px 4px 0 #000, 0 0 15px rgba(0,255,255,0.6); transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#combo-text { font-size: 1.4rem; color: #ff00ff; letter-spacing: 4px; text-transform: uppercase; text-shadow: 2px 2px 0 #000; margin-top: 10px; min-height: 2rem; font-weight: 700; }

#run-gold-display { position: absolute; top: 20px; right: 20px; font-size: 1.5rem; color: #ffd700; text-shadow: 2px 2px 0 #000; font-weight: bold; z-index: 500; transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

#ig-progress-container {
    width: 60%; max-width: 300px; height: 16px; margin: 15px auto;
    background: rgba(0,0,0,0.6); border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 10px; position: relative; overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
#ig-progress-fill {
    height: 100%; background: linear-gradient(90deg, #00ffff, #0088ff);
    width: 0%; transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#ig-progress-text {
    position: absolute; top: -1px; width: 100%; text-align: center; font-size: 0.75rem;
    color: #fff; text-shadow: 1px 1px 0 #000; font-weight: 600; line-height: 16px;
}

#perfect-msg { position: absolute; top: 20%; width: 100%; text-align: center; font-weight: 700; color: #0ff; text-shadow: 4px 4px 0 #000, 0 0 20px rgba(0,255,255,0.8); pointer-events: none; z-index: 150; opacity: 0; transform: scale(0); white-space: nowrap; }

#toast-msg {
    position: absolute; top: 12%; left: 50%; transform: translateX(-50%); background: rgba(10, 10, 20, 0.95); color: #ffd700; padding: 10px 20px;
    border: 1px solid #ffd700; border-radius: 12px; z-index: 1000; font-size: 0.9rem; letter-spacing: 1px;
    text-shadow: 0 0 5px #000; font-weight: 700; pointer-events: none; box-shadow: 0 6px 15px rgba(255, 215, 0, 0.3); white-space: nowrap;
    opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0.3s ease; text-align: center;
}
#toast-msg.hidden { opacity: 0 !important; visibility: hidden !important; }

#scanlines { position: absolute; width: 100%; height: 100%; background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.15) 50%); background-size: 100% 4px; pointer-events: none; z-index: 60; }
#flash { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: white; opacity: 0; pointer-events: none; z-index: 190; transition: opacity 0.3s ease-out; mix-blend-mode: overlay; }

canvas { position: absolute; top: 0; left: 0; z-index: 10; width: 100%; height: 100%; }

.screen-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: radial-gradient(circle at 50% 50%, #0f1016 0%, #020203 100%); 
    z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; 
    color: #fff; text-align: center; opacity: 1; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); 
}
#main-menu { gap: 12px; }
.modal-overlay { z-index: 250; background: radial-gradient(circle at 50% 50%, rgba(21, 22, 32, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%); }
.hidden { opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }

/* Modal bounding box limits added for mobile overflow prevention */
.modal-box { 
    background: linear-gradient(135deg, #1a1c29 0%, #0a0a10 100%); 
    border: 2px solid #0ff; border-radius: 20px; padding: 20px; width: 85%; max-width: 400px; 
    max-height: 85vh; /* Prevents overflow when mobile keyboard pops up */
    overflow-y: auto; /* Enables scrolling for overflow content */
    -ms-overflow-style: none; scrollbar-width: none; /* Hides scrollbar in Firefox and IE */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(0, 255, 255, 0.1); 
    color: #fff; display: flex; flex-direction: column; align-items: center;
    animation: springIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-sizing: border-box !important;
}
.modal-box::-webkit-scrollbar { display: none; } /* Hides scrollbar in WebKit */

@keyframes springIn {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-box h2 { margin-top: 0; color: #ffffff; text-shadow: 2px 2px 0 #000; letter-spacing: 1px; }
.tutorial-text { font-size: 1rem; line-height: 1.5; text-align: left; margin-bottom: 20px; color: #ddd; }

.leaderboard-list { width: 100%; max-height: 50vh; overflow-y: auto; margin-bottom: 20px; text-align: left; font-size: 1rem; scroll-behavior: smooth; }
.active-tab { background: #0ff !important; color: #000 !important; }
.lb-row { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: #888; text-shadow: 1px 1px 0 #000; }
.lb-gold { color: #ffd700 !important; text-shadow: 0 0 10px #ffd700 !important; font-weight: 700; font-size: 1.2rem; }
.lb-silver { color: #c0c0c0 !important; text-shadow: 0 0 10px #c0c0c0 !important; font-weight: 700; }
.lb-bronze { color: #cd7f32 !important; text-shadow: 0 0 10px #cd7f32 !important; font-weight: 700; }

.img-logo { width: 85%; max-width: 350px; height: auto; object-fit: contain; filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); animation: float-logo 4s ease-in-out infinite; }
.splash-logo { max-width: 450px; animation: splash-intro 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.menu-logo { max-width: 240px !important; margin-top: 70px !important; margin-bottom: 5px !important; }
@keyframes float-logo { 0% { transform: translateY(0); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); } 50% { transform: translateY(-8px); filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.8)); } 100% { transform: translateY(0); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); } }
@keyframes splash-intro { 0% { transform: scale(0.3); opacity: 0; filter: drop-shadow(0 0 50px rgba(0,255,255,1)); } 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 20px rgba(0,255,255,0.6)); } }

@keyframes splash-pulse { 0% { opacity: 0.3; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0.3; transform: scale(0.95); } }
#splash-continue { display: none; font-size: 1.3rem; margin-top: 30px; letter-spacing: 2px; font-weight: 700; text-shadow: 0 0 10px #fff; color: #fff; animation: splash-pulse 1.5s infinite; cursor: pointer; }

.splash-author { margin-top: 40px; font-size: 0.9rem; color: #aaa; letter-spacing: 2px; opacity: 0; animation: fadeIn 1s forwards 0.5s; font-weight: 600; }
.splash-dedication { margin-top: 10px; font-size: 0.7rem; color: #777; letter-spacing: 1px; opacity: 0; animation: fadeIn 1s forwards 1s; }
.heart { display: inline-block; color: #ff0055; animation: heartbeat 1s infinite alternate; }
@keyframes heartbeat { 0% { transform: scale(1); } 100% { transform: scale(1.3); } }
@keyframes fadeIn { to { opacity: 1; } }
.loader { border: 4px solid rgba(0, 255, 255, 0.2); border-left-color: #0ff; border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin-top: 20px; opacity: 0; transition: opacity 0.3s; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Inputs adjusted for box-sizing to prevent overflow on mobile */
input[type="text"], input[type="email"], input[type="password"] { 
    padding: 12px 15px; font-size: 1.1rem; font-family: 'Fredoka', sans-serif; font-weight: 600; 
    background: rgba(0, 255, 255, 0.05); border: 2px solid #0ff; color: #fff; text-align: center; 
    border-radius: 12px; outline: none; width: 100%; max-width: 250px; margin-bottom: 0; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); 
    box-sizing: border-box; 
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus { background: rgba(0, 255, 255, 0.15); box-shadow: 0 0 15px #0ff, inset 0 2px 5px rgba(0,0,0,0.5); }

.pet-portrait {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding-top: 24px !important; background: radial-gradient(circle at 50% 0%, rgba(0, 255, 255, 0.15), rgba(0, 5, 10, 0.9));
    border: 2px solid rgba(0, 255, 255, 0.5); border-bottom-color: #0088ff;
    border-radius: 20px; width: 96px !important; height: 112px !important; cursor: pointer;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9), 0 8px 15px rgba(0,0,0,0.6);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, border-color 0.2s; position: relative; margin: 15px 0 10px 0; overflow: hidden; 
}
.pet-portrait:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 12px 25px rgba(0,255,255,0.5); border-color: #0ff; }
.pet-portrait-icon { font-size: 2.8rem !important; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.8)); margin-bottom: 5px; }
.pet-portrait-name { font-size: 0.75rem !important; color: #0ff; font-weight: 700; letter-spacing: 1px; text-shadow: 1px 1px 0 #000; z-index: 2; }
.pet-badge { position: absolute; top: 18px; right: -5px; background: linear-gradient(135deg, #ff0055, #ff00aa); color: #fff; border-radius: 50%; width: 28px; height: 28px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; animation: pulse-btn 1s infinite alternate; z-index: 10; border: 2px solid #fff; box-shadow: 0 0 15px #ff0055; }
.portrait-title { position: absolute; top: 0; left: 0; width: 100%; height: 24px; background: rgba(0,0,0,0.8); border-bottom: 2px solid rgba(0, 255, 255, 0.4); font-size: 0.7rem; color: #fff; line-height: 24px; text-align: center; letter-spacing: 1px; font-weight: 700; z-index: 1; text-shadow: 1px 1px 0 #000; }

.juicy-pop { animation: juicyPopAnim 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes juicyPopAnim { 0% { transform: scale(0.8); } 50% { transform: scale(1.2) rotate(5deg); box-shadow: 0 0 40px #0ff; } 100% { transform: scale(1) rotate(0deg); } }

.carousel-wrapper { position: relative; width: 100%; height: 220px; perspective: 1000px; display: flex; align-items: center; justify-content: center; overflow: visible; margin: 45px 0; touch-action: none; cursor: grab; }
.carousel-wrapper::after { content: ''; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%) rotateX(70deg); width: 150px; height: 50px; background: radial-gradient(ellipse, rgba(0, 255, 255, 0.4) 0%, transparent 70%); pointer-events: none; z-index: -1; }
.carousel-wrapper:active { cursor: grabbing; }
.carousel-container { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }

.carousel-item { 
    position: absolute; top: -50px; left: -50px; width: 100px; height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 4rem; 
    background: radial-gradient(circle at 30% 30%, rgba(0, 150, 255, 0.25), rgba(5, 10, 20, 0.95)); 
    border: 2px solid rgba(0, 255, 255, 0.8); 
    border-radius: 20px; user-select: none; pointer-events: none; transition: filter 0.2s; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,255,255,0.2); 
}
.carousel-item.locked { 
    background: radial-gradient(circle at 30% 30%, rgba(100,100,100,0.2), rgba(15,15,20,0.95)); 
    border-color: #666; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.8), inset 0 0 15px rgba(0,0,0,0.8); 
}
.carousel-item.locked .pet-icon { filter: grayscale(100%) brightness(0.2) opacity(0.5); }
.carousel-item.locked .carousel-block-preview { filter: grayscale(100%) brightness(0.3); border-color: #444; }
.carousel-item.locked::after { content: '🔒'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; text-shadow: 0 0 10px gold, 0 0 5px #ffaa00; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.9)); }
.carousel-item.has-new-badge::before { content: '!'; position: absolute; top: -10px; right: -10px; background: linear-gradient(135deg, #ff0055, #ff00aa); color: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; animation: pulse-btn 1s infinite alternate; z-index: 10; border: 2px solid #fff; box-shadow: 0 0 15px #ff0055; }

.carousel-block-preview { width: 50px; height: 12px; border: 1px solid rgba(255,255,255,0.8); border-radius: 4px; margin-top: 5px; box-shadow: inset 0 0 5px rgba(0,0,0,0.5), 0 2px 5px rgba(0,0,0,0.8); transition: filter 0.2s; }
.block-gold { background: linear-gradient(to bottom, #fff6a3 0%, #ffd700 20%, #b8860b 80%, #8b6508 100%); }
.block-ice { background: linear-gradient(to bottom, rgba(200, 255, 255, 0.9) 0%, rgba(100, 200, 255, 0.7) 50%, rgba(50, 150, 255, 0.8) 100%); }
.block-shield { background: linear-gradient(to bottom, #ffaa00, #cc5500); }
.block-grow { background: linear-gradient(to bottom, #55ff55, #00aa00); }
.block-magnet { background: linear-gradient(to bottom, #ff55ff, #aa00aa); }
.block-x2 { background: linear-gradient(to bottom, #ff5588, #cc0044); }
.block-slowmo { background: linear-gradient(to bottom, #cc88ff, #6600cc); }
.carousel-pet-info { text-align: center; margin-bottom: 10px; min-height: 55px; }
#carousel-pet-name { font-size: 1.8rem; font-weight: 700; letter-spacing: 1px; transition: color 0.2s; background: linear-gradient(90deg, #fff, #0ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 15px rgba(0, 255, 255, 0.4); }
#carousel-pet-status { font-size: 1rem; font-weight: 700; margin-top: 5px; transition: color 0.2s; text-shadow: 1px 1px 0 #000; letter-spacing: 1px; }

.global-progress-container { width: 100%; height: 20px; background: rgba(0,0,0,0.8); position: absolute; bottom: 0; left: 0; z-index: 1; border-top: 1px solid rgba(0, 255, 255, 0.4); }
.global-progress-bar { height: 100%; background: linear-gradient(90deg, #0055ff, #0ff); width: 0%; transition: width 0.5s ease; }
.global-progress-text { position: absolute; width: 100%; text-align: center; top: 0; left: 0; font-size: 0.7rem; color: #fff; line-height: 20px; text-shadow: 1px 1px 0 #000; font-weight: 700; letter-spacing: 1px; }

.btn { 
    padding: 12px 20px; font-size: 1.1rem; font-family: 'Fredoka', sans-serif; 
    background: #ff0055; color: #fff; border: none; border-radius: 16px; 
    letter-spacing: 1px; cursor: pointer; font-weight: 700; text-transform: uppercase; 
    box-shadow: 0 6px 0 #990033, 0 12px 20px rgba(0,0,0,0.6); 
    width: 80%; max-width: 280px; 
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s cubic-bezier(0.4, 0, 0.2, 1); 
    text-decoration: none; display: inline-block; box-sizing: border-box; text-align: center;
    position: relative;
}
.btn-secondary { background: #0088ff; box-shadow: 0 6px 0 #004499, 0 12px 20px rgba(0,0,0,0.6); }
.btn-support { background: #009cde; box-shadow: 0 4px 0 #005f87, 0 8px 15px rgba(0,0,0,0.6); font-size: 0.8rem !important; padding: 9px 20px !important; margin-top: 5px !important; }

.btn:active { 
    transform: translateY(6px); 
    box-shadow: 0 0px 0 transparent, 0 4px 8px rgba(0,0,0,0.6); 
}

.btn-group-half { display: flex; gap: 15px; width: 80%; max-width: 280px; justify-content: center; }
.btn-group-half .btn { width: 50%; padding: 12px 10px; font-size: 0.95rem; }

.play-area-container {
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-radius: 24px;
    padding: 15px;
    width: 90%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 5px auto 10px auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,0.4);
}

.game-mode-chips {
    display: flex;
    gap: 10px;
    width: 100%;
}

.mode-chip {
    flex: 1;
    background: rgba(0,0,0,0.6);
    border: 2px solid #444;
    border-radius: 16px;
    padding: 9px 10px !important;
    color: #888;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.mode-chip.active {
    background: rgba(0,255,255,0.15);
    border-color: #0ff;
    color: #fff;
    box-shadow: 0 0 15px rgba(0,255,255,0.3), inset 0 0 10px rgba(0,255,255,0.2);
    transform: scale(1.03);
}

.chip-icon {
    font-size: 1.2rem;
}

.btn-play-huge {
    background: linear-gradient(135deg, #ff0055, #cc0044) !important; font-size: 1.5rem !important; letter-spacing: 2px;
    padding: 15px 30px !important; width: 100% !important; max-width: none !important;
    border-radius: 20px !important; 
    box-shadow: 0 8px 0 #880022, 0 15px 25px rgba(255,0,85,0.4) !important;
    animation: pulse-btn 2s infinite alternate; 
    margin: 0 !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}
.btn-play-huge:active {
    transform: translateY(8px);
    box-shadow: 0 0px 0 transparent, 0 5px 10px rgba(255,0,85,0.4) !important;
}

.btn-restart-huge {
    font-size: 1.3rem !important; letter-spacing: 1px; padding: 15px 25px !important; width: 75% !important; max-width: 250px !important;
    border-radius: 16px !important; box-shadow: 0 6px 0 #880022, 0 12px 20px rgba(255,0,85,0.4) !important;
    animation: pulse-restart 2s infinite alternate; margin-top: 5px; margin-bottom: 10px;
}
.btn-restart-huge:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 transparent, 0 4px 10px rgba(255,0,85,0.4) !important;
}

.shake-error { animation: error-shake 0.4s cubic-bezier(.36,.07,.19,.97) both; background: #550000 !important; border: 2px solid #ff0000 !important; color: #aaa !important; box-shadow: 0 4px 0 #330000, 0 10px 15px #ff0000 !important; }
@keyframes error-shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); } 20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); } 40%, 60% { transform: translate3d(5px, 0, 0); }
}
.btn-locked { background: #2a2a35 !important; color: #666 !important; box-shadow: inset 0 0 10px #000, 0 4px 0 #111 !important; animation: none !important; border: 2px solid #444 !important; cursor: not-allowed; }

@keyframes pulse-btn { from { box-shadow: 0 8px 0 #880022, 0 15px 25px rgba(255,0,85,0.4); transform: scale(1); } to { box-shadow: 0 8px 0 #880022, 0 20px 35px rgba(255,0,85,0.8), 0 0 10px #fff; transform: scale(1.03); } }
@keyframes pulse-restart { from { box-shadow: 0 6px 0 #880022, 0 12px 20px rgba(255,0,85,0.4); transform: scale(1); } to { box-shadow: 0 6px 0 #880022, 0 15px 25px rgba(255,0,85,0.8), 0 0 5px #fff; transform: scale(1.03); } }

.game-over-title { font-size: 2.2rem; color: #ffffff; text-shadow: 2px 2px 0px #000; margin-bottom: 5px; font-weight: 700; }
.score-label { font-size: 1.2rem; color: #fff; margin-top: 5px; font-weight: 600;}
.best-score-label { font-size: 1.1rem; color: #0ff; margin-bottom: 10px; text-shadow: 1px 1px 0px #000; font-weight: 600; }
.score-huge { font-size: 6rem !important; color: #ffd700 !important; text-shadow: 0 0 20px #ffd700, 4px 4px 0px #000 !important; margin: 5px 0 15px 0 !important; line-height: 1; font-weight: 700; }

.mini-lb { background: rgba(0,0,0,0.6); border: 2px solid #0ff; border-radius: 12px; padding: 12px; width: 80%; max-width: 300px; margin-bottom: 15px; font-size: 1rem; box-shadow: 0 5px 15px rgba(0,255,255,0.2); }
.mini-lb-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.1); color: #888; font-weight: 600;}
.mini-lb-row:last-child { border-bottom: none; }
.mini-lb-row.current { color: #ffffff !important; font-weight: 700; text-shadow: 0 0 8px #ffffff; background: rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 5px 10px; font-size: 1.1rem; }

.perfect-pop { transform: scale(1.3); filter: brightness(1.2); }
.juice-anim { animation: juice 1.2s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes juice { 0% { opacity: 0; transform: scale(0.3) translateY(30px) rotate(-15deg); } 15% { opacity: 1; transform: scale(1.2) translateY(0) rotate(5deg); } 70% { opacity: 1; transform: scale(1.1) translateY(-10px) rotate(0deg); } 100% { opacity: 0; transform: scale(0.8) translateY(-60px) rotate(0deg); } }
.wow-anim { animation: wow 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes wow { 0% { opacity: 0; transform: scale(0.1) rotate(-20deg); } 10% { opacity: 1; transform: scale(1.5) rotate(10deg); } 20% { opacity: 1; transform: scale(1.3) rotate(-10deg); } 30% { opacity: 1; transform: scale(1.4) rotate(5deg); } 40% { opacity: 1; transform: scale(1.3) rotate(-5deg); } 70% { opacity: 1; transform: scale(1.2) rotate(0deg); } 100% { opacity: 0; transform: scale(2) translateY(-50px); } }

.unlock-title { color: #0ff; font-size: 2.5rem; margin-bottom: 0; font-weight: 700; text-shadow: 2px 2px 0 #000; }
#unlock-screen { background: rgba(0, 255, 255, 0.1); backdrop-filter: blur(10px); z-index: 300; transition: background 0.5s ease-out; }
#unlock-screen.show-flash { animation: extremeFlash 1s ease-out forwards; }
@keyframes extremeFlash { 0% { background: rgba(255, 255, 255, 1); } 100% { background: rgba(0, 255, 255, 0.1); } }
.unlock-icon { font-size: 7rem; margin-bottom: 20px; filter: drop-shadow(0 0 20px #0ff); position: relative; z-index: 2; }
.egg-shake { animation: eggShake 0.1s infinite; filter: drop-shadow(0 0 10px #ff0055); }
@keyframes eggShake { 0% { transform: scale(1.5) rotate(-15deg); } 50% { transform: scale(1.5) rotate(15deg); } 100% { transform: scale(1.5) rotate(-15deg); } }
.pet-pop { animation: unlockPop 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes unlockPop { 0% { transform: scale(0) rotate(-180deg); opacity: 0; } 20% { transform: scale(2.5) rotate(20deg); opacity: 1; filter: brightness(2) drop-shadow(0 0 50px #0ff); } 40% { transform: scale(1.8) rotate(-10deg); } 60% { transform: scale(2.2) rotate(5deg); } 80% { transform: scale(1.9) rotate(0deg); } 100% { transform: scale(2.5) rotate(0deg); opacity: 1; filter: drop-shadow(0 0 30px #0ff); } }

.unlock-text { font-size: 2.2rem; color: #fff; font-weight: 700; text-shadow: 2px 2px 0 #000; animation: pulse 1s infinite alternate; position: relative; z-index: 2; }
@keyframes pulse { from { text-shadow: 0 0 10px #0ff, 2px 2px 0 #000; } to { text-shadow: 0 0 30px #0ff, 2px 2px 0 #000; } }

#confetti-container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; border-radius: 4px; opacity: 1; }
@keyframes confetti-anim { 0% { transform: translate(0, 0) rotate(0deg) scale(1.5); opacity: 1; } 100% { transform: translate(var(--tx), var(--ty)) rotate(720deg) scale(0); opacity: 0; } }

.lab-modal { width: 95%; max-height: 90vh; display: flex; flex-direction: column; padding: 20px; }
.lab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; width: 100%; border-bottom: 2px solid rgba(0,255,255,0.3); padding-bottom: 10px; }
.lab-header h2 { margin: 0; font-size: 1.5rem; }
#lab-gold-display { font-size: 1.4rem; color: #ffd700; font-weight: 700; text-shadow: 1px 1px 0 #000; }

.lab-tree { flex: 1; width: 100%; overflow-y: auto; background: radial-gradient(circle at 50% 50%, rgba(0,255,255,0.05), transparent); border-radius: 15px; padding: 15px; margin-bottom: 15px; box-sizing: border-box; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.lab-node { 
    width: 60px; height: 60px; border-radius: 50%; 
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), rgba(0,0,0,0.8));
    border: 2px solid rgba(0,255,255,0.5); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(0,255,255,0.3);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    position: relative;
}
.lab-node:hover { transform: scale(1.15); box-shadow: 0 10px 20px rgba(0,255,255,0.4), inset 0 0 15px rgba(0,255,255,0.6); }
.lab-node.locked { filter: grayscale(100%); opacity: 0.5; border-color: #555; }
.lab-node.maxed { border-color: #ffd700; box-shadow: 0 5px 15px rgba(255,215,0,0.4), inset 0 0 15px rgba(255,215,0,0.3); }

#lab-info-panel { background: rgba(0,0,0,0.6); border: 2px solid rgba(255,255,255,0.1); border-radius: 15px; padding: 15px; margin-bottom: 15px; width: 100%; box-sizing: border-box; min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
#lab-upgrade-name { font-weight: 700; color: #0ff; margin-bottom: 8px; font-size: 1.1rem; }
#lab-upgrade-desc { font-size: 0.95rem; color: #ccc; line-height: 1.4; }

.auth-logged-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0 !important;
    gap: 15px;
}
.auth-logged-compact > div {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.small-logout-btn {
    background: #550000 !important;
    box-shadow: 0 4px 0 #330000, 0 8px 15px rgba(0,0,0,0.6) !important;
    padding: 10px 25px !important;
    font-size: 1rem !important;
    width: auto !important;
    margin-top: 10px !important;
    border-radius: 14px !important;
}

#btn-lab { padding: 18px 20px 28px 20px !important; }

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #0ff;
    border-radius: 50%;
    color: #0ff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    text-shadow: 0 0 5px #0ff;
    transition: transform 0.2s, background 0.2s;
}
.carousel-nav-btn:active {
    transform: translateY(-50%) scale(0.9);
    background: rgba(0, 255, 255, 0.3);
}
#carousel-btn-left { left: 0px; }
#carousel-btn-right { right: 0px; }

/* ELITE IDENTITY CARD */
.profile-card {
    width: 90%; max-width: 360px;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column; gap: 15px;
    background: #111;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    color: #fff;
    animation: springIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* TIERS */
/* Tier 1: Neon Blue */
.tier-1 {
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(0, 255, 255, 0.1);
    animation: pulse-tier1 3s infinite alternate, springIn 0.5s forwards;
}
@keyframes pulse-tier1 { from { box-shadow: 0 0 10px rgba(0,255,255,0.2); } to { box-shadow: 0 0 20px rgba(0,255,255,0.6); } }

/* Tier 2: Plasm Purple */
.tier-2 {
    border: 2px solid #b026ff;
    background: linear-gradient(180deg, #111 0%, #200530 100%);
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.3);
    position: relative;
}
.tier-2::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(176,38,255,0.1) 50%, transparent 50%);
    background-size: 100% 4px; pointer-events: none; z-index: 1;
}

/* Tier 3: Volcanic Orange */
.tier-3 {
    border: 2px solid #ff5500;
    background: linear-gradient(180deg, #111 0%, #301000 100%);
    box-shadow: 0 0 25px rgba(255, 85, 0, 0.4);
}
.particle-ash {
    position: absolute; bottom: 0;
    background: #ffaa00; width: 4px; height: 4px; border-radius: 50%;
    animation: float-up 2s linear infinite;
}
@keyframes float-up { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-50px) scale(0); opacity: 0; } }

/* Tier 4: Zenith Gold */
.tier-4 {
    border: 2px solid #ffd700;
    background: linear-gradient(45deg, #221a00, #443300, #221a00);
    background-size: 200% 200%;
    animation: gold-liquid 4s ease infinite, springIn 0.5s forwards;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}
@keyframes gold-liquid { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Tier 5: Abyssal Chrome */
.tier-5 {
    background: #050505;
    border: 2px solid #fff;
    box-shadow: 
        -2px 0 10px rgba(255,0,0,0.8), 
        2px 0 10px rgba(0,255,255,0.8);
    animation: glitch-chromatic 2s infinite, springIn 0.5s forwards;
}
@keyframes glitch-chromatic {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

/* Components inside Card */
.pc-header { display: flex; align-items: center; gap: 15px; z-index: 2; position: relative; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.pc-badge {
    width: 60px; height: 65px;
    background: #222;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: bold;
    border: 2px solid inherit;
    line-height: 1.1;
}
.pc-info { flex: 1; text-align: left; }
.pc-name { font-size: 1.5rem; font-weight: bold; text-shadow: 1px 1px 0 #000; margin: 0; line-height: 1.1; }
.pc-title { font-size: 0.8rem; color: #aaa; letter-spacing: 1px; font-weight: 600; text-transform: uppercase; }

.pc-matrix { display: flex; flex-direction: column; gap: 8px; z-index: 2; position: relative; }
.pc-matrix-title { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 1px; text-align: left; margin-bottom: -4px;}
.pc-skill { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; }
.pc-skill-name { width: 45%; text-align: left; font-weight: 600; color: #ddd; }
.pc-cells { display: flex; gap: 3px; flex: 1; align-items: center;}
.pc-cell { width: 8px; height: 16px; background: #333; border-radius: 2px; }
.pc-cell.active { background: #fff; box-shadow: 0 0 5px #fff; }
.pc-skill-max { font-size: 0.6rem; color: #ffd700; font-weight: bold; margin-left: 5px; text-shadow: 0 0 5px #ffd700; }

.pc-units { display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; position: relative; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px;}
.pc-active-pet { font-size: 3rem; filter: drop-shadow(0 0 10px rgba(255,255,255,0.5)); }
.pc-other-pets { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.pc-mini-pet { font-size: 1.2rem; filter: grayscale(50%) opacity(0.7); }

.pc-flex { display: flex; justify-content: space-between; background: rgba(0,0,0,0.5); padding: 10px; border-radius: 10px; z-index: 2; position: relative; }
.pc-stat-box { display: flex; flex-direction: column; align-items: center; width: 48%; }
.pc-stat-label { font-size: 0.7rem; color: #aaa; letter-spacing: 1px; }
.pc-stat-val { font-size: 1.4rem; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 #000; }