/* =========================================
   MONSTERS CONTAINER & CARDS
   ========================================= */
.monsters-container {
    display: flex;
    gap: 12px;
    padding: 45px 0 16px 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.monsters-container::-webkit-scrollbar {
    display: none;
}

.monsters-scroll-wrapper {
    position: relative;
    width: 100%;
}

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, rgba(10, 10, 24, 0.9), transparent);
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    transition: opacity 0.3s;
    border: none;
    padding: 0;
}

.scroll-arrow.left {
    left: 0;
    background: linear-gradient(to right, rgba(10, 10, 24, 0.95), transparent);
}

.scroll-arrow.right {
    right: 0;
    background: linear-gradient(to left, rgba(10, 10, 24, 0.95), transparent);
}

.scroll-arrow svg {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.scroll-arrow:hover svg {
    opacity: 1;
}

.monster-slot {
    width: 198px;
    flex: 0 0 198px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin-top: 0 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.monster-slot-head {
    position: absolute;
    top: -42px;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 1;
    cursor: grab;
}

.monster-slot-body {
    position: relative;
    z-index: 2;
    background-color: #16162A;
    border-radius: 12px;
    border-top: 4px solid #4A4A6A;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.monster-slot.selected .monster-slot-body {
    border-top: 4px solid #7B3FF2 !important;
}

.monster-slot.is-leader .monster-slot-body {
    border-top: 4px solid #FFD700 !important;
}

.monster-slot.is-leader .leader-block {
    border: 1px solid #FFD700;
    border-top: 4px solid #FFD700;
}

.monster-slot.is-leader .leader-text {
    color: #FFD700 !important;
}

.monster-slot.selected .slot-order {
    background: #FFD700;
    color: #000000;
}

.leader-block {
    width: 100%;
    height: 100%;
    background: #1E1E38;
    border: 1px solid #4A4A6A;
    border-top: 4px solid #4A4A6A;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding-top: 5px;
    padding-bottom: 20px;
    pointer-events: auto;
}

.leader-text {
    color: #8888BB !important;
    transition: color 0.3s;
    font-weight: bold;
}

.disabled-leader {
    opacity: 0.3;
    pointer-events: none !important;
    filter: grayscale(100%);
}

.disabled-leader .leader-text {
    color: #4A4A6A !important;
}

.remove-monster-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    background-color: #FF5252;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.slot-element-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #16162A;
    background-size: 15px;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
}

.element-water {
    border: 2px solid #42A5F5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2342A5F5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z'/%3E%3C/svg%3E");
}

.element-fire {
    border: 2px solid #FF5252;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF5252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2c0 0-5 6.5-5 11a5 5 0 0 0 10 0c0-4.5-5-11-5-11Z'/%3E%3C/svg%3E");
}

.element-wind {
    border: 2px solid #FFCA28;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFCA28' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22a10 10 0 1 1 10-10c0 4-3 7-7 7a5 5 0 1 1 5-5'/%3E%3C/svg%3E");
}

.element-light {
    border: 2px solid #FFEE58;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFEE58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32l1.41-1.41'/%3E%3C/svg%3E");
}

.element-dark {
    border: 2px solid #AB47BC;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AB47BC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

.slot-order {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #2A2A4A;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10 !important;
    cursor: grab;
}

.monster-image-btn {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #1E1E38;
    border: 2px dashed #4A4A6A;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.monster-image-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.monster-name {
    font-size: 13px;
    text-align: center;
    height: 24px;
    margin-bottom: 6px;
    font-weight: bold;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.req-spd-display {
    height: 35px;
    display: flex;
    margin-bottom: 6px;
    width: 100%;
    line-height: 1.2;
    text-align: center;
    align-items: center;
}

.req-starter {
    justify-content: center;
}

.req-starter-text {
    font-weight: bold;
    font-size: 16px;
}

.req-normal {
    flex-direction: column;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    color: #FF5252;
}

.base-spd-display,
.total-spd-display {
    font-size: 12px;
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
}

.input-label {
    font-size: 10px;
    color: #8888BB;
    width: 100%;
    text-align: left;
    margin-bottom: 2px;
    text-transform: uppercase;
}

/* Blocos Informativos com CSS Limpo */
.combat-info-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #1E1E38;
    border: 1px solid #4A4A6A;
    border-radius: 8px;
}

.special-mechanics-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 12px;
    border-top: 1px dashed #4A4A6A;
    padding: 12px 6px 0 6px;
    box-sizing: border-box;
}

.passive-desc {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.3;
}

.info-row {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.buff-text {
    font-size: 11px;
    margin-bottom: 4px;
    margin-top: 4px;
}

.single-atb-text {
    font-size: 11px;
    margin-bottom: 2px;
}

.single-buff-text {
    font-size: 11px;
    margin-top: 2px;
}

.buff-label {
    color: #8888BB;
}

.buff-value {
    font-weight: bold;
}

.kroa-info {
    font-size: 11px;
    color: #00E676;
    margin-top: 8px;
}

/* Caixas de Runas: Vertical e à Esquerda */
.runes-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 12px;
    width: 100%;
    align-items: flex-start;
}

.rune-cb-wrapper {
    margin-top: 0 !important;
    justify-content: flex-start !important;
    transition: opacity 0.2s;
    width: auto !important;
}

.rune-checkmark {
    width: 14px;
    height: 14px;
}

.rune-label {
    font-size: 11px;
    font-weight: bold;
    color: #E8E8FF;
}

.skill-select {
    padding: 6px 8px;
    width: 100%;
    background-color: #1E1E38;
    color: #00E676;
    font-weight: bold;
    border: 1px solid #4A4A6A;
}

.single-option {
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    pointer-events: none;
    text-align: center;
    text-align-last: center;
}

.turn-order-text {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 12px;
    color: #E8E8FF;
    background-color: #1E1E38;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed #4A4A6A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inimigo */
.enemy-placeholder {
    margin: 0 auto;
    border: 2px dashed #4A4A6A;
    border-radius: 12px;
    background: transparent;
}

.empty-body {
    cursor: pointer;
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.placeholder-text {
    color: #8888BB;
    margin-top: 10px;
}

.enemy-slot {
    margin: 0 auto;
    pointer-events: auto;
}

.enemy-body {
    border-top: 4px solid #FF5252;
}

.enemy-order {
    background: #FF5252;
    color: #FFF;
    width: max-content;
    padding: 4px 12px;
    cursor: default;
}

.enemy-lead-label {
    text-align: center;
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 4px;
    margin-top: 10px;
}

.enemy-select {
    width: 100%;
    margin-bottom: 10px;
    color: #FFD700;
    border: 1px solid #FF5252;
    background-position: right 6px center;
}

.enemy-total {
    color: #FF5252;
    font-size: 14px;
}

.monster-slot .leader-select {
    color: #E8E8FF;
    border-color: #2A2A4A;
    background-size: 14px;
    background-position: right 6px center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8E8FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.monster-slot.dragging {
    opacity: 0.5;
    border: 2px dashed #7B3FF2 !important;
    transform: scale(0.98);
    border-radius: 12px;
}

.monster-slot.drag-over {
    border: 2px solid #00E676 !important;
    background-color: rgba(0, 230, 118, 0.1) !important;
    border-radius: 12px;
}

@media (max-width: 850px) {
    .monsters-container {
        padding: 45px 14px 24px 14px;
        gap: 10px;
        scroll-snap-type: x mandatory;
    }

    .monster-slot {
        flex: 0 0 82vw;
        width: 82vw;
        max-width: 260px;
        scroll-snap-align: center;
    }

    .scroll-arrow {
        display: flex;
    }
}