﻿/* --- GAME LAYOUT CONTAINER --- */
.game-arena {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.direction-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #546e7a;
    padding: 0 4px;
    box-sizing: border-box;
}

/* Slots & Cards Layout Containers */
.slots-container, .items-pool {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important; /* Forces 4 items to sit edge-to-edge */
    align-items: flex-start;
    gap: 1.5% !important; /* Use a fluid percentage gap */
    width: 100% !important;
    max-width: 600px;
    box-sizing: border-box;
}

.slots-container {
    margin-bottom: 25px;
}

.items-pool {
    min-height: 145px;
    padding: 12px 8px;
    background: rgba(240, 244, 248, 0.7);
    border: 3px dashed #b2dfdb;
    border-radius: 16px;
    margin: 0 auto;
}

/* Base Wrapper Elements */
.slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 23.5% !important; /* 4 items * 23.5% = 94% + 3 gaps = Perfect 100% fit */
    max-width: 120px;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevents browser from distorting width profiles */
}

.slot {
    background: #eceff1;
    border: 3px dashed #b0bec5;
    border-radius: 14px;
    width: 100%;
    aspect-ratio: 1 / 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

    .slot.hovered {
        background: #d1eff2;
        border-color: #00acc1;
    }

.slot-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #78909c;
    background: #cfd8dc;
    padding: 2px 8px;
    border-radius: 8px;
}

/* --- UPDATED ITEM CARD BLUEPRINT --- */
.item-card {
    background: #ffffff;
    border: 3px solid #ffb300;
    border-radius: 12px;
    padding: 6px 2px;
    width: 23.5% !important;
    /* CHANGE: Replaced strict aspect-ratio with min-height so it doesn't collapse while dragging */
    min-height: 115px;
    max-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    cursor: grab;
    box-shadow: 0 4px 0 #ffb300;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* CHANGE: Keep slots taller so cards fit cleanly inside them */
.slot {
    background: #eceff1;
    border: 3px dashed #b0bec5;
    border-radius: 14px;
    width: 100%;
    aspect-ratio: 1 / 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

    .slot .item-card {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
    }

.item-card:active {
    cursor: grabbing;
}

/* CHANGE: Reduced from 3rem to 2rem so it doesn't squash the price tag on mobile */
.item-emoji {
    font-size: 2rem;
    margin-bottom: 2px;
}

.item-name {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.1;
    color: #2c3e50;
    word-break: break-all;
}

.item-price-tag {
    font-size: 0.75rem;
    color: #e65100;
    font-weight: 900;
    background: #fff8e1;
    padding: 3px 4px;
    border-radius: 6px;
    border: 1px dashed #ffa000;
    width: 90%;
    box-sizing: border-box;
    white-space: nowrap;
    /* CHANGE: Removed strict overflow hidden rules that were truncating your prices to nothing */
}

.success-card {
    border-color: #4caf50 !important;
    box-shadow: 0 4px 0 #4caf50 !important;
}

    .success-card .item-price-tag {
        background: #e8f5e9 !important;
        color: #2e7d32 !important;
        border-color: #4caf50 !important;
    }

/* --- MOBILE SCREENS SAFEHOLD CONTROLS --- */
@media (max-width: 380px) {
    .item-card {
        min-height: 95px;
    }

    .item-emoji {
        font-size: 1.3rem;
    }

    .item-name {
        font-size: 0.65rem;
    }

    .item-price-tag {
        font-size: 0.65rem;
        padding: 2px;
        width: 95%;
    }

    .slot, .item-card {
        border-width: 2px !important;
    }
}