* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', sans-serif;
    overflow: hidden;
    background: #F5F5DC;
    touch-action: manipulation;
}

#canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    text-align: center;
    pointer-events: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.hidden {
    display: none !important;
}

.game-title {
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 700;
    color: #5D4037;
    text-shadow: 
        3px 3px 0 #D2B48C,
        5px 5px 10px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.poop-mascot {
    font-size: clamp(4rem, 15vw, 8rem);
    animation: bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

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

.tagline {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #8B4513;
    margin: 1rem 0;
    font-style: italic;
}

.instruction {
    font-size: clamp(1.2rem, 5vw, 2rem);
    color: #4682B4;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
    margin: 1.5rem 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.high-score-display {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #A0522D;
    margin-top: 1rem;
}

.game-over-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 700;
    color: #5D4037;
    text-shadow: 
        2px 2px 0 #D2B48C,
        4px 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.funny-message {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #8B4513;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.score-display {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: #5D4037;
    margin-bottom: 1rem;
}

.high-score-small {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #A0522D;
}

#new-high-score {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: celebrate 0.5s ease-in-out infinite alternate;
    margin-bottom: 1rem;
}

@keyframes celebrate {
    from { transform: scale(1) rotate(-2deg); }
    to { transform: scale(1.05) rotate(2deg); }
}

.flush-button {
    background: linear-gradient(180deg, #5B9BD5 0%, #4682B4 50%, #3A6A8C 100%);
    border: none;
    border-radius: 15px;
    padding: 1rem 2rem;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 600;
    color: white;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 
        0 6px 0 #2C5070,
        0 10px 20px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.5rem auto 0;
    transition: all 0.1s ease;
}

.flush-button:hover {
    transform: translateY(2px);
    box-shadow: 
        0 4px 0 #2C5070,
        0 8px 15px rgba(0,0,0,0.3);
}

.flush-button:active {
    transform: translateY(5px);
    box-shadow: 
        0 1px 0 #2C5070,
        0 4px 10px rgba(0,0,0,0.3);
}

.flush-button .handle {
    width: 20px;
    height: 30px;
    background: linear-gradient(90deg, #C0C0C0, #E8E8E8, #C0C0C0);
    border-radius: 3px;
    position: relative;
}

.flush-button .handle::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #D4D4D4;
    border-radius: 50%;
}

#score-counter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 700;
    color: #5D4037;
    text-shadow: 
        2px 2px 0 #F5F5DC,
        4px 4px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 100;
}

#footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#footer a {
    color: #8B4513;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

#footer.hidden {
    display: none;
}

@media (max-width: 600px) {
    .flush-button {
        padding: 0.8rem 1.5rem;
    }
}