/* Base Styles */
:root {
    --primary-color: #4a86e8;
    --secondary-color: #ff9900;
    --accent-color: #34a853;
    --light-color: #f5f5f5;
    --dark-color: #333333;
    --success-color: #34a853;
    --error-color: #ea4335;
}

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

body {
    font-family: 'Comic Neue', cursive;
    background-color: #e9f5ff;
    color: var(--dark-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Game Container */
.game-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Game Header */
.game-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    text-align: center;
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.game-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.instructions {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Main Game Area */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Background */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* House Container */
.house-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.house {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 500px;
}

.house img {
    width: 100%;
    height: auto;
    display: block;
}

/* Slots Container */
.slots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    padding: 5%;
}

.slot {
    background-color: rgba(255, 255, 255, 0.4);
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    position: relative;
    min-height: 120px;
    min-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.slot:hover {
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.slot .draggable {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* Character Tray */
.character-tray {
    background-color: var(--light-color);
    padding: 15px;
    border-top: 3px solid var(--primary-color);
    z-index: 3;
}

.tray-label {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.characters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.character-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 0 10px;
}

.draggable {
    width: 80px;
    height: 120px;
    object-fit: contain;
    cursor: grab;
    transition: all 0.2s ease;
    max-width: 100%;
}

.draggable:hover {
    transform: scale(1.1);
}

.draggable:active {
    cursor: grabbing;
}

.character-label {
    font-weight: bold;
    color: var(--dark-color);
}

/* Feedback Popup */
.feedback-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background-color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
}

.feedback-popup.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.popup-content {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background-color: var(--light-color);
    border-top: 1px solid #ddd;
    z-index: 10;
}

.control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 15px;
    font-family: 'Comic Neue', cursive;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: #3a76d8;
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .instructions {
        font-size: 1rem;
    }
    
    .characters {
        gap: 10px;
    }
    
    .character-item {
        margin: 0 5px;
    }
    
    .draggable {
        width: 60px;
        height: 90px;
    }
    
    .slot {
        min-height: 90px;
        min-width: 60px;
    }
    
    .slot .draggable {
        width: 100%;
        height: 100%;
    }
    
    .character-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        border-radius: 0;
    }
    
    .game-header {
        padding: 5px 10px;
    }
    
    .game-header h1 {
        font-size: 1.2rem;
    }
    
    .instructions {
        font-size: 0.9rem;
    }
    
    .slots-container {
        gap: 5px;
    }
    
    .characters {
        gap: 5px;
    }
    
    .character-item {
        margin: 0 2px;
    }
    
    .draggable {
        width: 50px;
        height: 75px;
    }
    
    .slot {
        min-height: 75px;
        min-width: 50px;
    }
    
    .slot .draggable {
        width: 100%;
        height: 100%;
    }
    
    .character-tray {
        padding: 10px 5px;
    }
    
    .control-btn {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    .character-label {
        font-size: 0.8rem;
    }
}