.maker-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 15px;
}

.maker-container header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #1e2a45;
    margin-bottom: 20px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-gold {
    background: linear-gradient(135deg, #6a4f1a, #8a6a2a) !important;
    color: #f0e0b0 !important;
    border: 1px solid #9a7a30 !important;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #8a6a2a, #a07a30) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #5a1a1a, #7a2a2a) !important;
    color: #f0b0b0 !important;
    border: 1px solid #8a3030 !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #7a2a2a, #9a3a3a) !important;
}

/* Layout */
.maker-layout {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 100px);
}

/* Character pool */
#char-pool {
    width: 660px;
    min-width: 660px;
    background: linear-gradient(180deg, #101828, #0d1420);
    border: 1px solid #1a2540;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    position: sticky;
    top: 15px;
}

#char-pool h3 {
    color: #d4c8a0;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pool-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.pool-filters input {
    width: 100%;
    padding: 6px 8px;
    background: #0c1225;
    color: #c8ccd4;
    border: 1px solid #1e2a45;
    border-radius: 4px;
    font-size: 13px;
}

.pool-filters input:focus {
    border-color: #3a5a90;
    outline: none;
}

.pool-columns {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pool-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr;
    gap: 4px;
    align-items: center;
}

.pool-nick-cell {
    font-size: 10px;
    font-weight: 600;
    color: #8a8e9a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    text-align: right;
}

.pool-cell {
    min-width: 0;
}

.pool-header-row {
    margin-bottom: 4px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pool-column-header {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 0;
    border-radius: 4px;
    border-bottom: 2px solid;
}

.pool-col-main {
    color: #ffd700;
    background: rgba(184, 164, 114, 0.15);
    border-color: #ffd700;
}

.pool-col-alt1 {
    color: #64a0dc;
    background: rgba(100, 160, 220, 0.15);
    border-color: #64a0dc;
}

.pool-col-alt2 {
    color: #8c78c8;
    background: rgba(140, 120, 200, 0.15);
    border-color: #8c78c8;
}

/* Character token */
.char-token {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #0c1225;
    border: 1px solid #18243e;
    border-radius: 4px;
    cursor: grab;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    font-size: 13px;
}

.char-token:hover {
    border-color: #3a5080;
    background: #101a30;
}

.char-token.dragging {
    opacity: 0.4;
}

.char-token.token-used {
    opacity: 0.3;
    pointer-events: none;
}

.char-token.token-sibling {
    border-color: #b8a472;
    background: rgba(184, 164, 114, 0.12);
    box-shadow: 0 0 6px rgba(184, 164, 114, 0.25);
}

.char-token.token-buff-highlight {
    border-color: #40b868;
    background: rgba(40, 180, 80, 0.15);
    box-shadow: 0 0 8px rgba(40, 180, 80, 0.3);
}

.token-icon {
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.token-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-info {
    color: #5a6078;
    font-size: 11px;
    white-space: nowrap;
    margin-left: auto;
}

.token-charname {
    font-weight: 400;
    font-size: 11px;
    opacity: 0.6;
}

.token-badge {
    font-size: 9px;
    color: #4a5068;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.token-remove {
    position: absolute;
    top: 2px;
    right: 4px;
    background: none;
    border: none;
    color: #5a3030;
    font-size: 14px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    display: none;
}

.char-token:hover .token-remove {
    display: block;
    color: #c04040;
}

/* Rosters area */
#rosters-area {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    align-items: flex-start;
}

.roster-builder {
    min-width: 320px;
    max-width: 400px;
    flex: 1;
    background: linear-gradient(180deg, #101828, #0d1420);
    border: 1px solid #1a2540;
    border-radius: 8px;
    padding: 15px;
}

.roster-builder-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a2540;
}

.roster-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roster-title-input {
    background: transparent;
    border: 1px solid transparent;
    color: #d4c8a0;
    font-size: 16px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    width: 160px;
}

.roster-title-input:hover,
.roster-title-input:focus {
    border-color: #2a3a5a;
    outline: none;
}

.roster-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: #5a6a8a;
}

.stat-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-tanks { color: #64a0dc; }
.stat-healers { color: #00FF98; }
.stat-dps { color: #C41E3A; }
.stat-melee {}
.stat-ranged {}
.stat-plate {}
.stat-mail {}
.stat-leather {}
.stat-cloth {}
.stat-mains { color: #ffd700; }
.stat-alts { color: #64a0dc; }
.stat-total { color: #b8a472; font-weight: 600; font-size: 13px; }
.stat-ilvl { color: #8a8e9a; font-size: 13px; }

/* Buff tracker */
.buff-tracker {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a2540;
}

.buff-category {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.buff-cat-label {
    font-size: 10px;
    color: #4a5068;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-bottom: 1px;
}

.buff-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.buff-missing {
    background: rgba(180, 40, 40, 0.15);
    color: #6a3030;
    border: 1px solid #4a2020;
}

.buff-covered {
    background: rgba(40, 180, 80, 0.15);
    color: #30884a;
    border: 1px solid #205a30;
}

/* Saved rosters panel */
.saved-panel {
    background: linear-gradient(180deg, #101828, #0d1420);
    border: 1px solid #1a2540;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.saved-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.saved-panel-header h3 {
    color: #d4c8a0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.saved-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #0c1225;
    border: 1px solid #18243e;
    border-radius: 4px;
}

.saved-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.saved-item-name {
    color: #c8ccd4;
    font-weight: 600;
    font-size: 13px;
}

.saved-item-date {
    color: #4a5068;
    font-size: 11px;
}

.saved-item-actions {
    display: flex;
    gap: 6px;
}

.saved-empty {
    color: #4a5068;
    text-align: center;
    padding: 15px;
    font-size: 13px;
}

/* Roster slot sections */
.slot-section {
    margin-bottom: 8px;
}

.slot-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 3px;
}

.slot-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.slot-section-tanks .slot-section-label { color: #64a0dc; }
.slot-section-healers .slot-section-label { color: #00FF98; }
.slot-section-dps .slot-section-label { color: #C41E3A; }

.slot-section-btns {
    display: flex;
    gap: 4px;
}

.slot-add-btn {
    background: none;
    border: 1px solid #1a2540;
    color: #4a5068;
    font-size: 13px;
    font-weight: 700;
    padding: 0 7px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 20px;
}

.slot-add-btn:hover {
    border-color: #3a5080;
    color: #8a8e9a;
}

.slot-section-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.roster-slot {
    min-height: 36px;
    background: #080e1a;
    border: 1px dashed #1a2540;
    border-radius: 4px;
    transition: border-color 0.15s, background 0.15s;
}

.roster-slot:empty::after {
    content: "";
    display: block;
    height: 34px;
}

.roster-slot.drag-over {
    border-color: #b8a472;
    background: rgba(184, 164, 114, 0.05);
    border-style: solid;
}

.roster-slot.drag-insert-above {
    border-top: 2px solid #b8a472;
    border-style: solid;
}

.roster-slot.drag-insert-below {
    border-bottom: 2px solid #b8a472;
    border-style: solid;
}

.roster-slot .char-token {
    margin: 0;
    border-radius: 3px;
}

/* Role-colored left border on tokens in roster slots */
.roster-slot .char-token.token-role-main {
    border-left: 3px solid #ffd700;
}

.roster-slot .char-token.token-role-alt1 {
    border-left: 3px solid #64a0dc;
}

.roster-slot .char-token.token-role-alt2 {
    border-left: 3px solid #8c78c8;
}

/* Hide badge in pool (column header already indicates role) */
.pool-cell .token-badge {
    display: none;
}

/* Compact tokens in pool */
.pool-cell .char-token {
    padding: 4px 6px;
    font-size: 12px;
}

.pool-cell .token-name {
    font-size: 12px;
}

.pool-cell .token-info {
    font-size: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .maker-layout {
        flex-direction: column;
    }
    #char-pool {
        width: 100%;
        min-width: unset;
        max-height: 400px;
        position: static;
    }
    #rosters-area {
        flex-direction: column;
    }
    .roster-builder {
        max-width: 100%;
    }
}

/* Context menu */
.context-menu {
    position: absolute;
    z-index: 1000;
    background: #101828;
    border: 1px solid #2a3a5a;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 150px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
    padding: 8px 14px;
    font-size: 13px;
    color: #c8ccd4;
    cursor: pointer;
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: #1a2a4a;
}

.context-menu-item.context-menu-active {
    color: #5a6078;
    cursor: default;
}

.context-menu-item.context-menu-active:hover {
    background: transparent;
}

.context-menu-label {
    padding: 6px 14px 4px;
    font-size: 10px;
    color: #5a6078;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
