/* Deck Building UI Styles */
.deck-building-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.deck-building-panel {
    width: 90%;
    max-width: 1400px;
    height: 90%;
    background-color: #222;
    border: 3px solid #555;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

.deck-building-panel h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
}

.deck-class-info {
    text-align: center;
    margin-bottom: 20px;
}

.deck-class-info h3 {
    margin-bottom: 10px;
}

.deck-class-info h3 span {
    font-weight: bold;
}

.deck-class-info h3 span.physical {
    color: #d92121;
}

.deck-class-info h3 span.elemental {
    color: #2175d9;
}

.deck-class-info h3 span.quantum {
    color: #21d99b;
}

.deck-counter {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
    color: #aaa;
}

.deck-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.card-selection-container {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    overflow: hidden;
}

.available-cards-container, .selected-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #333;
    border-radius: 8px;
    padding: 15px;
    overflow: hidden;
}

.available-cards-container h3, .selected-cards-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #555;
    color: #ddd;
}

.card-category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.card-category-tab {
    padding: 8px 15px;
    background-color: #444;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.card-category-tab:hover {
    background-color: #555;
}

.card-category-tab.active {
    background-color: #006699;
}

.available-cards, .selected-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
    flex-grow: 1;
}

/* Deck card styles */
.deck-card {
    width: 160px;
    height: 220px;
    background-color: #222;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    user-select: none;
}

.deck-card.tower {
    background-color: #333344;
}

.deck-card.buff {
    background-color: #443333;
}

.deck-card.utility {
    background-color: #334433;
}

.deck-card.element {
    background-color: #334433;
}

.deck-card.physical {
    border-color: #d92121;
}

.deck-card.elemental {
    border-color: #2175d9;
}

.deck-card.quantum {
    border-color: #21d99b;
}

.deck-card.element-fire {
    border-color: #ff4400;
}

.deck-card.element-ice {
    border-color: #88ddff;
}

.deck-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.deck-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.deck-card-name {
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    margin-bottom: 5px;
    color: white;
}

.deck-card-type {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    margin-bottom: 10px;
}

.deck-card-description {
    font-size: 12px;
    color: #ccc;
    text-align: center;
    flex-grow: 1;
}

.deck-card-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 30px;
    height: 20px;
    background-color: #555;
    color: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
}

.deck-building-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

#start-with-deck-btn {
    padding: 12px 30px;
    font-size: 18px;
    background: linear-gradient(to bottom, #006600, #004400);
    border-color: #008800;
}

#start-with-deck-btn:hover:not([disabled]) {
    background: linear-gradient(to bottom, #008800, #006600);
}

/* Deck counter UI in main game */
#deck-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    margin-top: 5px;
}

.deck-icon {
    width: 24px;
    height: 30px;
    background-color: #555;
    border: 2px solid #777;
    border-radius: 3px;
    position: relative;
}

.deck-icon:before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    height: 2px;
    background-color: #999;
    box-shadow: 0 4px 0 #999, 0 8px 0 #999, 0 12px 0 #999, 0 16px 0 #999;
}

#deck-counter .count {
    font-weight: bold;
    color: #ddd;
}

#deck-counter.low .count {
    color: #ff9900;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive styles */
@media (max-width: 1200px) {
    .card-selection-container {
        flex-direction: column;
    }
    
    .available-cards, .selected-cards {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .deck-options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .deck-card {
        width: 140px;
        height: 200px;
    }
}