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

html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

/* Visibility helpers */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.pixel-badger {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    font-size: 48px;
    color: #8b7355;
    text-shadow: 3px 3px 0 #4a3728;
    letter-spacing: 4px;
}

.tagline {
    font-size: 18px;
    color: #a0a0a0;
    margin-bottom: 30px;
}

.cta-button {
    background: #8b7355;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

.cta-button:hover {
    background: #a08568;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.5);
}

.cta-button:active {
    transform: translateY(0);
}

/* About Section */
.about {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(139, 115, 85, 0.3);
    border-radius: 10px;
    padding: 30px;
    margin: 40px 0;
}

.description {
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #d0d0d0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature {
    text-align: center;
    padding: 20px;
}

.icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.feature h3 {
    color: #8b7355;
    margin-bottom: 10px;
    font-size: 16px;
}

.feature p {
    color: #a0a0a0;
    font-size: 14px;
}

/* Game Section */
.game-section {
    margin: 40px 0;
}

#game-container {
    border: 3px solid #8b7355;
    border-radius: 10px;
    overflow: hidden;
    background: #0a0a0a;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

#game-container canvas {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto;
}

.game-ui {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    color: #8b7355;
    font-weight: bold;
}

#wormCount {
    font-size: 24px;
    color: #ffd700;
}

.energy-bar {
    width: 200px;
    height: 20px;
    background: #333;
    border: 2px solid #8b7355;
    border-radius: 10px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    transition: width 0.3s ease;
}

.controls-info {
    text-align: center;
    margin-top: 15px;
    color: #a0a0a0;
    font-size: 14px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: #a0a0a0;
    border-top: 1px solid rgba(139, 115, 85, 0.3);
    margin-top: 60px;
}

footer p {
    margin: 10px 0;
}

.easter-egg {
    font-size: 14px;
    font-style: italic;
}

.easter-egg a {
    color: #8b7355;
    text-decoration: none;
    transition: color 0.3s ease;
}

.easter-egg a:hover {
    color: #a08568;
    text-decoration: underline;
}

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    top: 20px;
    right: -400px;
    background: linear-gradient(135deg, #8b7355 0%, #a08568 100%);
    border: 3px solid #ffd700;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease-out;
    z-index: 1000;
    max-width: 350px;
}

.achievement-toast.show {
    right: 20px;
}

.achievement-icon {
    font-size: 48px;
    animation: bounce 0.6s ease-in-out;
}

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

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 12px;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 3px;
}

.achievement-desc {
    font-size: 12px;
    color: #e0e0e0;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    body {
        padding: 10px;
    }

    h1 {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .pixel-badger {
        font-size: 60px;
    }

    .hero {
        padding: 20px 10px;
    }

    .about {
        padding: 20px;
        margin: 20px 0;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-section {
        margin: 20px 0;
    }

    .game-ui {
        flex-direction: column;
        gap: 15px;
        padding: 12px;
    }

    .stat {
        justify-content: space-between;
    }

    .energy-bar {
        width: 100%;
        max-width: 200px;
    }

    #wormCount {
        font-size: 28px;
    }

    .controls-info {
        font-size: 12px;
        padding: 0 10px;
    }

    .achievement-toast {
        top: 10px;
        right: -350px;
        max-width: calc(100vw - 20px);
        padding: 12px 15px;
        left: 10px;
        right: auto;
        transform: translateX(-400px);
        transition: transform 0.3s ease-out;
    }

    .achievement-toast.show {
        transform: translateX(0);
        right: auto;
    }

    .achievement-icon {
        font-size: 36px;
    }

    .achievement-name {
        font-size: 16px;
    }

    .achievement-desc {
        font-size: 11px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 18px;
    }

    .tagline {
        font-size: 16px;
    }

    .description {
        font-size: 16px;
    }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 480px) {
    h1 {
        font-size: 28px;
        letter-spacing: 1px;
    }

    .pixel-badger {
        font-size: 50px;
    }

    .logo {
        gap: 10px;
    }

    .tagline {
        font-size: 14px;
    }

    .cta-button {
        padding: 10px 25px;
        font-size: 16px;
    }

    .description {
        font-size: 14px;
    }

    .feature h3 {
        font-size: 14px;
    }

    .feature p {
        font-size: 12px;
    }

    .icon {
        font-size: 36px;
    }

    #wormCount {
        font-size: 24px;
    }

    .stat-label {
        font-size: 14px;
    }

    .controls-info {
        font-size: 11px;
    }

    .achievement-toast {
        padding: 10px 12px;
    }

    .achievement-icon {
        font-size: 32px;
    }

    .achievement-name {
        font-size: 14px;
    }

    .achievement-title {
        font-size: 10px;
    }
}
