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

body {
    background: #0a0014;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#game-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#canvas {
    flex: 1;
    width: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#hud-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#avatar-container {
    width: 40px;
    height: 40px;
    border: 3px solid #8a2be2;
    border-radius: 8px;
    background: #1a0a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

#avatar-placeholder {
    font-size: 24px;
}

#phase-indicator {
    font-size: 10px;
    color: #ffa500;
    text-shadow: 2px 2px 0 #000;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 10px;
    border: 2px solid #8a2be2;
    border-radius: 4px;
}

#hud-right {
    text-align: right;
}

#stats {
    font-size: 9px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border: 2px solid #8a2be2;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#energy-container {
    position: absolute;
    top: 60px;
    left: 10px;
    z-index: 10;
}

#energy-label {
    font-size: 7px;
    color: #00ffff;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 #000;
}

#energy-bar {
    width: 120px;
    height: 14px;
    background: #1a0a2e;
    border: 2px solid #8a2be2;
    border-radius: 4px;
    overflow: hidden;
}

#energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff00, #00ffaa);
    transition: width 0.3s ease;
}

#tweet-input {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px;
    border: 3px solid #ff69b4;
    border-radius: 8px;
    animation: slideUp 0.3s ease;
    width: 90%;
    max-width: 320px;
}

#tweet-input.hidden {
    display: none;
}

#tweet-text {
    width: 100%;
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    background: #1a0a2e;
    border: 2px solid #00ffff;
    border-radius: 4px;
    color: #fff;
    outline: none;
}

#tweet-text::placeholder {
    color: #666;
}

#tweet-text:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

#send-tweet {
    padding: 10px 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    background: linear-gradient(180deg, #ff69b4, #ff1493);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    white-space: nowrap;
}

#send-tweet:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.6);
}

#send-tweet:active {
    transform: scale(0.95);
}

#instructions {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 7px;
    color: #888;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    pointer-events: none;
    max-width: 90%;
}

#win-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
    padding: 20px;
}

#win-screen.hidden {
    display: none;
}

#win-content {
    text-align: center;
    animation: bounceIn 0.6s ease;
}

#win-content h1 {
    font-size: 18px;
    color: #ff69b4;
    margin-bottom: 15px;
    text-shadow: 0 0 20px #ff69b4;
}

#win-content p {
    font-size: 11px;
    color: #00ffff;
    margin-bottom: 20px;
}

#win-emoji {
    font-size: 60px;
    margin-bottom: 25px;
}

#play-again {
    padding: 12px 24px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    background: linear-gradient(180deg, #00ffff, #0099cc);
    border: none;
    border-radius: 4px;
    color: #000;
    cursor: pointer;
    transition: transform 0.1s;
}

#play-again:hover {
    transform: scale(1.1);
}

#footer {
    padding: 12px;
    text-align: center;
    background: #0a0014;
    border-top: 2px solid #8a2be2;
    cursor: pointer;
    transition: background 0.3s;
}

#footer:hover {
    background: #1a0a2e;
}

#footer-text {
    font-size: 9px;
    color: #888;
}

#footer a {
    color: #ff69b4;
    text-decoration: none;
}

#footer a:hover {
    text-shadow: 0 0 10px #ff69b4;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes footerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 600px) {
    #phase-indicator {
        font-size: 7px;
        padding: 5px 7px;
    }
    
    #stats {
        font-size: 7px;
        padding: 6px 8px;
    }
    
    #avatar-container {
        width: 32px;
        height: 32px;
    }
    
    #avatar-placeholder {
        font-size: 18px;
    }
    
    #energy-bar {
        width: 90px;
    }
    
    #energy-label {
        font-size: 6px;
    }
    
    #tweet-input {
        padding: 12px;
    }
    
    #tweet-text {
        font-size: 8px;
        padding: 8px;
    }
    
    #send-tweet {
        font-size: 7px;
        padding: 8px 12px;
    }
    
    #instructions {
        font-size: 6px;
    }
    
    #win-content h1 {
        font-size: 14px;
    }
    
    #win-content p {
        font-size: 9px;
    }
    
    #win-emoji {
        font-size: 48px;
    }
    
    #play-again {
        font-size: 9px;
        padding: 10px 20px;
    }
}