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

body {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}

#canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#controls {
    width: 100%;
    max-width: 500px;
    padding: 10px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    transition: all 0.1s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    top: 0;
}

.action-btn:active {
    top: 4px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}

.btn-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.btn-text {
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.feed-btn {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 0 #922b21;
}

.feed-btn:hover {
    background: linear-gradient(180deg, #ec7063 0%, #e74c3c 100%);
}

.play-btn {
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 4px 0 #1f618d;
}

.play-btn:hover {
    background: linear-gradient(180deg, #5dade2 0%, #3498db 100%);
}

.clean-btn {
    background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
    box-shadow: 0 4px 0 #145a32;
}

.clean-btn:hover {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
}

.sleep-btn {
    background: linear-gradient(180deg, #f39c12 0%, #d68910 100%);
    box-shadow: 0 4px 0 #9c640c;
}

.sleep-btn:hover {
    background: linear-gradient(180deg, #f5b041 0%, #f39c12 100%);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    border: 4px solid #6c5ce7;
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.5);
}

.modal-content h2 {
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

#pet-name-input {
    width: 100%;
    padding: 15px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    background: #0f0f23;
    border: 3px solid #6c5ce7;
    border-radius: 8px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
}

#pet-name-input:focus {
    border-color: #a29bfe;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.5);
}

#pet-name-input::placeholder {
    color: #555;
}

#start-btn {
    background: linear-gradient(180deg, #6c5ce7 0%, #5f4bd8 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #4834d4;
    transition: all 0.1s ease;
}

#start-btn:hover {
    background: linear-gradient(180deg, #7d6ee8 0%, #6c5ce7 100%);
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #4834d4;
}

.footer {
    text-align: center;
    font-size: 8px;
    color: #555;
    padding: 10px;
}

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

.footer a:hover {
    color: #f78fb3;
}

@media (max-width: 400px) {
    .action-btn {
        padding: 10px 6px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .btn-text {
        font-size: 6px;
    }
}