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

@keyframes bgDrift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-color: #000;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ffb3c6, #cc88ff, #88ccff, #ffcc88);
    background-size: 400% 400%;
    animation: bgDrift 15s ease infinite;
    overflow: hidden;
}

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

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

/* UI Elements */
#top-bar {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    pointer-events: auto;
    z-index: 10;
}

.stat-box {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f5 100%);
    border: 4px solid #fff;
    border-radius: 30px;
    padding: 15px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 0 #cc99dd, 0 15px 25px rgba(0,0,0,0.3);
    position: relative;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: 2px; left: 10%; width: 80%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 20px;
}

.goals-box {
    flex: 1;
    max-width: 350px;
}

.moves-box {
    width: 120px;
    background: linear-gradient(180deg, #ff6666 0%, #cc0000 100%);
    color: white;
    border-color: #ffaaaa;
    box-shadow: 0 10px 0 #880000, 0 15px 25px rgba(0,0,0,0.3);
}

#moves-display {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 3px 0 rgba(0,0,0,0.3);
}

.sub-text {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

#goal-target {
    font-size: 24px;
    color: #cc33aa;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 2px 0 rgba(255,255,255,0.8);
}

#goal-progress-bar {
    width: 100%;
    height: 25px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.2);
    border: 3px solid #ccc;
    position: relative;
}

#goal-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #ff66aa, #00eeff);
    background-size: 200% 200%;
    animation: bgDrift 3s linear infinite;
    transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px;
    box-shadow: inset 0 5px 0 rgba(255,255,255,0.4);
}

/* Screens */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(150, 50, 200, 0.6);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 100;
}

.screen:not(.hidden) {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hidden {
    display: none !important;
}

.logo-thumb {
    width: 350px;
    height: 210px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 8px rgba(255,255,255,0.3);
    border: 6px solid white;
    object-fit: cover;
    animation: floatTitle 4s ease-in-out infinite;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

h1 {
    font-size: 72px;
    background: linear-gradient(180deg, #ffffff 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 0 #cc33aa) drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    margin-bottom: 15px;
    text-align: center;
    animation: floatTitle 3s ease-in-out infinite reverse;
}

p {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 40px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.2);
    padding: 10px 30px;
    border-radius: 20px;
}

@keyframes pulseBtn {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.ui-button {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all 0.1s;
}

.main-btn {
    background: linear-gradient(180deg, #66ff66 0%, #00cc00 100%);
    color: white;
    padding: 20px 60px;
    font-size: 36px;
    border-radius: 50px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.3);
    box-shadow: 
        0 12px 0 #008800,
        0 20px 30px rgba(0,0,0,0.4),
        inset 0 5px 0 rgba(255,255,255,0.6),
        inset 0 -5px 0 rgba(0,0,0,0.2);
    border: 4px solid #ccffcc;
    animation: pulseBtn 2s infinite;
}

.main-btn:active {
    transform: translateY(12px) !important;
    box-shadow: 
        0 0px 0 #008800,
        0 5px 10px rgba(0,0,0,0.4),
        inset 0 5px 0 rgba(255,255,255,0.6),
        inset 0 -5px 0 rgba(0,0,0,0.2);
    animation: none;
}

.stars {
    font-size: 64px;
    margin-bottom: 30px;
    letter-spacing: 15px;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.4));
    animation: pulseBtn 1s infinite;
}

/* Boosters */
#boosters-toolbar {
    margin-top: auto;
    padding: 30px;
    display: flex;
    justify-content: center;
    gap: 25px;
    pointer-events: auto;
    background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent);
}

.booster-slot {
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    border: 5px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    box-shadow: 0 8px 0 #aaaaaa, 0 15px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.booster-slot::after {
    content: '';
    position: absolute;
    top: 5px; left: 15%; width: 70%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), transparent);
    border-radius: 20px;
}

.booster-slot:active {
    transform: translateY(8px);
    box-shadow: 0 0px 0 #aaaaaa, 0 5px 10px rgba(0,0,0,0.4);
}

.booster-slot.active {
    border-color: #ffcc00;
    box-shadow: 0 0 30px #ffcc00, 0 8px 0 #cc9900;
    transform: scale(1.15) translateY(-10px);
    background: linear-gradient(180deg, #fff9c4 0%, #ffeb3b 100%);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 48px; }
    .stat-box { padding: 10px 15px; border-radius: 20px; }
    #moves-display { font-size: 32px; }
    .logo-thumb { width: 280px; height: 168px; }
    .booster-slot { width: 60px; height: 60px; font-size: 24px; }
}
