:root {
    --bg-color: #1a1a1b;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 24px;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    background-color: #5865f2;
    color: white;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #4752c4;
}

.btn-danger {
    background-color: #ed4245;
}

.btn-danger:hover {
    background-color: #c03537;
}

.btn-success {
    background-color: #3ba55c;
}

.btn-success:hover {
    background-color: #2d7d46;
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tier Board */
#tier-board {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 50px;
}

.tier-row {
    display: flex;
    background-color: var(--card-bg);
    min-height: 100px;
    border: 1px solid black;
}

.row-label {
    width: 100px;
    background-color: var(--row-color);
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    word-break: break-word;
    /* Prevent shrinking */
    flex-shrink: 0; 
    border-right: 1px solid black;
}

.row-items {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    padding: 5px;
    gap: 5px;
    align-content: flex-start;
    min-height: 100px; /* Ensure drop zone exists */
}

/* Hidden controls by default, show on hover */
.row-controls {
    width: 50px;
    background-color: #202225;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    border-left: 1px solid black;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.tier-row:hover .row-controls {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: #b9bbbe;
    cursor: pointer;
    font-size: 16px;
}

.btn-icon:hover {
    color: white;
}

.color-picker {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

/* Bank */
#bank-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#bank-container h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #b9bbbe;
}

.bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 150px;
}

/* Draggable Images */
.tier-item {
    width: 80px; 
    /* Maintain Aspect Ratio */
    height: auto; 
    cursor: grab;
    transition: transform 0.1s;
    border-radius: 4px;
}

.tier-item:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .tier-row {
        flex-wrap: wrap;
    }
    .row-label {
        width: 100%;
        min-height: 50px;
    }
    .row-items {
        width: 100%;
        border-top: 1px solid black;
    }
    .row-controls {
        width: 100%;
        flex-direction: row;
        height: 40px;
        border-left: none;
        border-top: 1px solid black;
        opacity: 1;
    }
}
