body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    overflow-x: hidden;
    transition: padding-top 0.5s ease-out, padding-bottom 0.5s ease-out;
}
#gameHeader {
    transition: margin-bottom 0.5s ease-out;
}
canvas { 
    touch-action: none; 
    cursor: pointer;
}
.market-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.2);
}
.market-btn:hover {
    filter: grayscale(0);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
.download-buttons {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}
.download-btn {
    min-width: 160px;
    height: 50px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}
@media (max-width: 768px) {
    .download-buttons {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.5rem;
    }
    .download-btn {
        min-width: 120px;
        height: 40px;
        padding: 0.5rem;
    }
    .download-btn .text-left p {
        font-size: 0.65rem;
    }
    .download-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    #gameHeader h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    .glass-panel {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }
    .glass-panel > div {
        flex: 1 1 auto;
        min-width: calc(50% - 0.5rem);
    }
    .glass-panel .h-10 {
        display: none;
    }
    #countDisp {
        font-size: 1.5rem;
    }
    #livesDisp {
        font-size: 1.5rem;
    }
    #levelDisp {
        font-size: 1rem;
    }
    #milestoneText {
        font-size: 0.75rem;
    }
    footer {
        padding: 1rem;
        font-size: 0.75rem;
    }
    footer .mx-2 {
        margin: 0 0.25rem;
    }
    body {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}
@media (max-width: 480px) {
    .download-buttons {
        top: 0.25rem;
        right: 0.25rem;
        gap: 0.25rem;
    }
    .download-btn {
        min-width: 100px;
        height: 35px;
        padding: 0.25rem;
    }
    .download-btn .text-left {
        display: none;
    }
    .download-btn svg {
        width: 1.5rem;
        height: 1.5rem;
        margin: 0;
    }
    #gameHeader h1 {
        font-size: 1.5rem;
    }
    .glass-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .glass-panel > div {
        min-width: 100%;
        text-align: center;
    }
    .glass-panel > div:not(:last-child) {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}
.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.game-canvas-container {
    position: relative;
    overflow: visible;
    transition: width 0.5s ease-out, height 0.5s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}
#gameCanvas {
    transition: width 0.5s ease-out, height 0.5s ease-out;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}
.title-glow {
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
#victoryOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}
#victoryOverlay.show {
    display: flex;
}
.victory-content {
    text-align: center;
    animation: victoryPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes victoryPop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.victory-title {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #ef4444, #ec4899, #8b5cf6, #3b82f6, #06b6d4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.victory-subtitle {
    font-size: 1.5rem;
    color: #cbd5e1;
    font-weight: 600;
    margin-top: 0.5rem;
}
#livesWave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.6);
    pointer-events: none;
    opacity: 0;
}
#livesWave.wave-active {
    animation: livesWave 0.8s ease-out;
}
@keyframes livesWave {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}
#gameOverOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
}
#gameOverOverlay.show {
    display: flex;
}
.gameover-content {
    text-align: center;
    animation: gameoverPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gameoverPop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.gameover-title {
    font-size: 5rem;
    font-weight: 900;
    color: #ef4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
    margin-bottom: 1rem;
}
.gameover-subtitle {
    font-size: 1.5rem;
    color: #cbd5e1;
    font-weight: 600;
    margin-top: 0.5rem;
}
.gameover-button {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: auto;
}
.gameover-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
}
.victory-download {
    margin-top: 2.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.3s both;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.victory-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.25rem;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
.victory-download-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}
.victory-download-btn.app-store {
    border-color: rgba(0, 122, 255, 0.5);
}
.victory-download-btn.app-store:hover {
    border-color: rgba(0, 122, 255, 0.8);
    box-shadow: 0 20px 40px rgba(0, 122, 255, 0.3);
}
.victory-download-btn.google-play {
    border-color: rgba(76, 175, 80, 0.5);
}
.victory-download-btn.google-play:hover {
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 20px 40px rgba(76, 175, 80, 0.3);
}
.store-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}
.breathing-animation {
    animation: breathing 2s ease-in-out infinite;
}
@keyframes breathing {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}
#gameHint {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
#gameHint.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}