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

body, html {
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    /* Spore cell stage inspired — deep primordial blue-green water */
    background: radial-gradient(ellipse at 50% 40%, #1a5276 0%, #0e3d5c 30%, #0a2840 60%, #061a2b 100%);
}

#container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#title {
    color: rgba(200, 230, 255, 0.85);
    font-size: 48px;
    position: absolute;
    top: 20px;
    z-index: 1;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.3);
}

#subtitle {
    color: rgba(200, 230, 255, 0.6);
    font-size: 16px;
    position: absolute;
    top: 75px;
    z-index: 1;
    text-shadow: 0 0 10px rgba(100, 180, 255, 0.2);
    font-family: Arial, sans-serif;
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

#startOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 26, 43, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
}

#startText {
    color: rgba(200, 230, 255, 0.8);
    font-size: 32px;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.4);
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

#victoryOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 26, 43, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: overlayFade 2s ease-out;
}

#victoryBox {
    background: rgba(10, 40, 64, 0.95);
    border: 2px solid rgba(100, 180, 255, 0.4);
    border-radius: 12px;
    padding: 40px 50px;
    text-align: center;
    max-width: 90vw;
    box-shadow: 0 0 40px rgba(100, 180, 255, 0.15);
    animation: wobbleIn 2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes overlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wobbleIn {
    0% { opacity: 0; transform: scale(0.1) rotate(0deg); }
    20% { opacity: 0.6; transform: scale(1.15) rotate(3deg); }
    35% { transform: scale(0.92) rotate(-2.5deg); }
    50% { transform: scale(1.08) rotate(2deg); }
    65% { transform: scale(0.97) rotate(-1deg); }
    80% { transform: scale(1.02) rotate(0.5deg); }
    90% { transform: scale(0.99) rotate(-0.2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

#victoryTitle {
    color: rgba(200, 230, 255, 0.95);
    font-size: 36px;
    font-family: Arial, sans-serif;
    margin: 0 0 16px 0;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.4);
}

#victoryMessage {
    color: rgba(200, 230, 255, 0.7);
    font-size: 15px;
    font-family: Arial, sans-serif;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

#victoryCode {
    display: inline-block;
    background: rgba(100, 180, 255, 0.15);
    border: 2px dashed rgba(100, 180, 255, 0.5);
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 28px;
    font-family: monospace;
    font-weight: bold;
    color: rgba(200, 230, 255, 0.95);
    letter-spacing: 3px;
    cursor: pointer;
    user-select: all;
    text-shadow: 0 0 10px rgba(100, 180, 255, 0.3);
}

#victoryCode:hover {
    background: rgba(100, 180, 255, 0.25);
    border-color: rgba(100, 180, 255, 0.8);
}

#copyConfirm {
    color: rgba(100, 220, 150, 0.9);
    font-size: 13px;
    font-family: Arial, sans-serif;
    margin: 10px 0 0 0;
    height: 18px;
}

/* Mobile overrides — MUST be last to win specificity */
@media (max-width: 1024px) {
    #victoryBox {
        padding: 18px 12px !important;
        max-width: 85vw !important;
        animation: overlayFade 2s ease-out !important;
    }
    #victoryTitle {
        font-size: 4.5vw !important;
        margin-bottom: 8px !important;
    }
    #victoryMessage {
        font-size: 10px !important;
        margin-bottom: 12px !important;
        padding: 0 5px;
    }
    .no-break {
        white-space: nowrap;
    }
    #victoryCode {
        font-size: 14px !important;
        padding: 6px 12px !important;
        letter-spacing: 1px !important;
    }
    #copyConfirm {
        font-size: 10px !important;
    }
}
