* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f0f0f0;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    touch-action: none;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-menu, #game-ui, #eraser-selection, #instructions-panel, #game-over {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#game-menu {
    width: 300px;
}

#game-ui {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#eraser-selection, #instructions-panel {
    width: 80%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.close-button {
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
}

.close-button:hover {
    background-color: #ff0000;
}

#eraser-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.eraser-option {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.eraser-option:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

.eraser-option.selected {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.eraser-option img {
    width: 100%;
    height: auto;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none !important;
}

/* Credits and social links */
#credits {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 16px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10;
    pointer-events: auto;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#credits .heart {
    color: #ff4d4d;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    5% { transform: scale(1.2); }
    10% { transform: scale(1); }
    15% { transform: scale(1.2); }
    20% { transform: scale(1); }
    100% { transform: scale(1); }
}

#social-links {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    pointer-events: auto;
    display: flex;
    gap: 15px;
}

#social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

#social-links a:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.8);
}

#social-links svg {
    width: 24px;
    height: 24px;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    #game-ui {
        top: 10px;
        right: 10px;
        padding: 10px;
    }
    
    button {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    #eraser-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #credits {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    #social-links a {
        width: 35px;
        height: 35px;
    }
    
    #social-links svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    #game-menu {
        width: 90%;
    }
    
    #eraser-selection, #instructions-panel {
        width: 90%;
    }
    
    #credits {
        font-size: 10px;
        padding: 5px 10px;
    }
    
    #social-links a {
        width: 30px;
        height: 30px;
    }
    
    #social-links svg {
        width: 16px;
        height: 16px;
    }
}