:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --background-color: #f0f2f5;
    --text-color: #2d3436;
    --white: #ffffff;
    --success: #00b894;
    --warning: #fab1a0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#header {
    width: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}

#mental-strength-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#strength-bar {
    width: 200px;
    height: 15px;
    background: #dfe6e9;
    border-radius: 10px;
    overflow: hidden;
}

#strength-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease-out;
}

#room-view {
    position: relative;
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    background: #fff;
    margin: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background-image: url('../assets/room.svg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.loci {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px dashed var(--secondary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--secondary-color);
    transition: all 0.3s;
    cursor: pointer;
}

.loci.occupied {
    border-style: solid;
    background: rgba(108, 92, 231, 0.1);
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(108, 92, 231, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

.loci.active {
    border-color: var(--primary-color);
    animation: pulse 2s infinite;
}

#inventory {
    width: 100%;
    height: 100px;
    background: var(--white);
    display: flex;
    gap: 15px;
    padding: 10px;
    overflow-x: auto;
    border-top: 2px solid #eee;
}

.inventory-item {
    min-width: 80px;
    height: 100px;
    background: var(--secondary-color);
    color: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
    padding: 5px;
    cursor: grab;
    transition: transform 0.2s;
}

.emoji-badge {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
}

.inventory-item:hover {
    transform: rotate(-3deg) scale(1.05);
    background: var(--primary-color);
}

.inventory-item:active {
    cursor: grabbing;
}

.inventory-item.selected {
    border: 3px solid var(--accent-color);
    background: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modifier-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 15px;
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.modifier-btn:hover {
    transform: translateY(-2px);
    background: var(--secondary-color);
}

#owl-mentor {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 100px;
    height: 100px;
    background: url('../assets/owl.svg') no-repeat center/contain;
    cursor: help;
}

#owl-bubble {
    position: absolute;
    bottom: 110%;
    right: 0;
    width: 200px;
    background: white;
    padding: 15px;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

/* Recall Phase */
#recall-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.recall-btn {
    padding: 10px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.recall-btn:hover {
    background: var(--primary-color);
    color: white;
}

.recall-btn:active {
    transform: scale(0.9);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #header {
        flex-direction: column;
        gap: 5px;
        padding: 5px;
        font-size: 0.9rem;
    }
    
    #mental-strength-container {
        font-size: 0.8rem;
    }

    #strength-bar {
        width: 100px;
    }
    
    .loci {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
        border-width: 2px;
    }

    #inventory {
        height: 90px;
        gap: 10px;
        padding: 5px;
    }

    .inventory-item {
        min-width: 70px;
        height: 80px;
        font-size: 0.7rem;
    }

    .emoji-badge, .inventory-item img {
        width: 30px;
        height: 30px;
    }
    
    #owl-mentor {
        width: 50px;
        height: 50px;
        bottom: 100px;
        right: 10px;
    }
    
    #owl-bubble {
        width: 120px;
        font-size: 0.7rem;
        padding: 10px;
    }

    .modal-content {
        padding: 20px;
        border-radius: 20px;
    }

    .modifier-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
}
