/* Build Editor Layout */
/* Uses CSS custom properties from main.css */

/* Reduce top spacing from main-content when build-editor is present */
.main-content:has(.build-editor) {
    padding-top: 0;
}

.build-editor {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Editor Header */
.build-editor__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
}

.build-editor__class-icon {
    width: 75px;
    height: 75px;
    border-radius: 4px;
    border: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    overflow: hidden;
}

.build-editor__class-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.build-editor__header-info {
    flex: 1;
    min-width: 0;
}

/* Readonly: Build title */
.build-editor__title {
    font-family: var(--font-heading);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin: 0;
}

.build-editor__meta-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 3px;
}

.build-editor__subtitle-line {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.build-editor__subtitle {
    font-size: 0.95rem;
    color: #ffffff;
}

.build-editor__author {
    font-size: 0.9rem;
    color: #909090;
}

.build-editor__updated {
    font-size: 0.85rem;
    color: #707070;
}

/* Editor: Class name heading */
.build-editor__class-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    text-transform: uppercase;
}

.build-editor__subtitle-static {
    font-size: 0.9rem;
    color: #808080;
    margin-top: 2px;
}

.build-editor__header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Visibility Selector (Public/Unlisted/Private) — linksbündig, Buttons rechts */
.build-editor__visibility-selector {
    display: inline-flex;
    border: 1px solid var(--border-primary, #2a2a35);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.75rem;
    margin-left: auto;
}


.build-editor__visibility-selector .visibility-opt {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-dimmed, #7a7870);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.build-editor__visibility-selector .visibility-opt:not(:last-child) {
    border-right: 1px solid var(--border-primary, #2a2a35);
}

.build-editor__visibility-selector .visibility-opt:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e0ddd5);
}

.build-editor__visibility-selector .visibility-opt--active,
.build-editor__visibility-selector .visibility-opt--active:hover {
    background: rgba(196, 162, 78, 0.15);
    color: #fff;
}

.build-editor__visibility-selector .visibility-opt--active svg {
    stroke: var(--gold, #c4a24e);
}

.build-editor__visibility-selector--compact .visibility-opt span {
    display: none;
}
@media (min-width: 768px) {
    .build-editor__visibility-selector--compact .visibility-opt span {
        display: inline;
    }
}

/* Unlisted hint banner */
.build-editor__unlisted-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(196, 162, 78, 0.1);
    border: 1px solid rgba(196, 162, 78, 0.25);
    border-radius: 6px;
    color: var(--gold, #c4a24e);
    font-size: 0.8rem;
    margin: 0.5rem 1.5rem 0;
}

.build-editor__badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.build-editor__badges .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--border-radius, 4px);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.build-editor__badges .badge--tier-s { background: rgba(165, 9, 5, 0.45); color: #fff; border-color: rgba(165, 9, 5, 0.6); }
.build-editor__badges .badge--tier-a { background: rgba(74, 222, 128, 0.3); color: #fff; border-color: rgba(74, 222, 128, 0.45); }
.build-editor__badges .badge--tier-b { background: rgba(59, 130, 246, 0.3); color: #fff; border-color: rgba(59, 130, 246, 0.45); }
.build-editor__badges .badge--tier-c { background: rgba(245, 158, 11, 0.3); color: #fff; border-color: rgba(245, 158, 11, 0.45); }
.build-editor__badges .badge--tier-d { background: rgba(239, 68, 68, 0.3); color: #fff; border-color: rgba(239, 68, 68, 0.45); }
.build-editor__badges .badge--season { background: rgba(74, 222, 128, 0.25); color: #fff; border-color: rgba(74, 222, 128, 0.4); }
.build-editor__badges .badge--eternal { background: rgba(196, 162, 78, 0.3); color: #fff; border-color: rgba(196, 162, 78, 0.5); }

/* Share button — link-style */
.btn--share {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: none;
    color: #909090;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
}

.btn--share:hover {
    color: var(--text-primary);
}

.btn--share-icon {
    display: inline-block;
    vertical-align: -0.1em;
    flex-shrink: 0;
}

/* Save Build button — muted dark */
.btn--save-build {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: #2d3040;
    border: 1px solid #3a3d50;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn--save-build:hover {
    background: #363a50;
    border-color: #4a4e65;
    color: var(--text-primary);
}

/* Sub-bar: Build name / type */
.build-editor__sub-bar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Readonly: type display pill */
.build-editor__build-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: #252630;
    border: 1px solid #333545;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 180px;
}

.build-editor__selector-chevron {
    font-size: 0.7rem;
    color: #606060;
    margin-left: auto;
}

/* Editor: build name + type group */
.build-editor__build-selector-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.build-editor__build-name-input {
    background: #252630;
    border: 1px solid #333545;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.85rem;
    border-radius: 4px;
    min-width: 220px;
    max-width: 350px;
    height: 32px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.build-editor__build-name-input:focus {
    outline: none;
    border-color: #555;
}

.build-editor__build-name-input::placeholder {
    color: #555;
}

.build-editor__type-select {
    background: #252630;
    border: 1px solid #333545;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 120px;
    height: 32px;
    box-sizing: border-box;
}

.build-editor__type-select:hover,
.build-editor__type-select:focus {
    outline: none;
    border-color: #555;
}

.build-editor__reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #333545;
    border-radius: 4px;
    color: #606060;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.build-editor__reset-btn:hover {
    border-color: #555;
    color: var(--text-secondary);
}

.build-editor__actions {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

/* ========== Variant Bar ========== */
.variant-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 1.5rem;
    background: var(--bg-secondary, #13151a);
    border-bottom: 1px solid var(--border-color, #252830);
    overflow-x: auto;
    scrollbar-width: none;
}

.variant-bar::-webkit-scrollbar { display: none; }

.variant-bar--hidden { display: none !important; }

.variant-bar__list {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.variant-bar__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    background: #1a1b22;
    border: 1px solid #2a2a35;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}

.variant-bar__tab:hover {
    border-color: #444;
    color: var(--text-secondary, #b0ada5);
}

.variant-bar__tab--active {
    border-color: var(--gold, #c4a24e);
    color: #ffffff;
    background: rgba(196, 162, 78, 0.08);
}

.variant-bar__tab-name {
    pointer-events: none;
}

.variant-bar__tab-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
    margin-left: 0.125rem;
    border-radius: 4px;
}

.variant-bar__tab:hover .variant-bar__tab-menu,
.variant-bar__tab--active .variant-bar__tab-menu {
    opacity: 0.6;
}

.variant-bar__tab-menu:hover {
    opacity: 1 !important;
    background: rgba(255,255,255,0.08);
}

.variant-bar__add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px dashed #3a3a45;
    border-radius: 4px;
    color: var(--text-dimmed, #7a7870);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.variant-bar__add-btn:hover {
    border-color: var(--gold, #c4a24e);
    color: var(--gold, #c4a24e);
    background: rgba(196, 162, 78, 0.06);
}

/* Readonly: hide add btn, hide menu dots */
.build-editor--readonly .variant-bar__add-btn { display: none; }
.build-editor--readonly .variant-bar__tab-menu { display: none; }

/* Context Menu */
.variant-context-menu {
    background: #1a1b22;
    border: 1px solid #333545;
    border-radius: 6px;
    padding: 0.25rem 0;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.variant-context-menu__item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: none;
    border: none;
    color: var(--text-secondary, #b0ada5);
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.variant-context-menu__item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary, #e0ddd5);
}

.variant-context-menu__item--danger {
    color: var(--mythic-color, #ff6b6b);
}

.variant-context-menu__item--danger:hover {
    background: rgba(255,107,107,0.1);
    color: var(--mythic-color, #ff6b6b);
}

/* Prompt modal checkbox */
.modal__prompt-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #b0ada5);
    cursor: pointer;
}

.modal__prompt-checkbox input[type="checkbox"] {
    accent-color: var(--gold, #c4a24e);
}

/* Checkbox group (master + sub-checkboxes) */
.modal__checkbox-group { margin-top: 0.75rem; }

.modal__prompt-checkbox--master { font-weight: 500; }

.modal__checkbox-group-items {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.modal__prompt-checkbox--sub {
    font-size: 0.85rem;
    color: var(--text-secondary, #7a7870);
    margin-top: 0;
}

.modal__prompt-checkbox--sub input:checked ~ span {
    color: var(--text-primary, #e0ddd5);
}

.modal__checkbox-group-items--disabled {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 480px) {
    .modal__checkbox-group-items {
        grid-template-columns: 1fr;
    }
}

/* Tab Navigation */
.editor-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky, 100);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    scrollbar-width: none;
    /* For scroll fade indicator */
    isolation: isolate;
}

.editor-tabs::-webkit-scrollbar {
    display: none;
}

.editor-tabs__tab {
    flex: 0 0 auto;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    background: transparent;
    position: relative;
    white-space: nowrap;
}

/* Scroll fade indicator for mobile tabs */
.editor-tabs--scrollable::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, var(--bg-secondary));
    pointer-events: none;
    z-index: 1;
}

.editor-tabs--scrolled-end::after {
    display: none;
}

/* Active tab underline handled by border-bottom */

.editor-tabs__tab:hover {
    color: var(--text-primary);
    background: var(--bg-panel-hover);
}

.editor-tabs__tab--active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: var(--bg-panel);
}

/* Tab spacer pushes bug-report to the right */
.editor-tabs__spacer {
    flex: 1;
    min-width: 1rem;
}

.editor-tabs__bug-report {
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.6;
    transition: opacity var(--transition), color var(--transition);
}

.editor-tabs__bug-report:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Bug Report Modal */
/* Tab active state uses border-bottom only */

.editor-tab-content {
    display: none;
    padding: 0;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    background: #1A1B1F;
}

.editor-tab-content--active {
    display: block;
}

/* Build Info Section */
.build-info {
    padding: 1.5rem 2rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
}

.build-info__row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.build-info__field {
    flex: 1;
}

.build-info__label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.build-info__description {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--transition);
}

.build-info__description:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(165, 9, 5, 0.15);
}

/* Legacy build-info__type-select kept for admin/other pages */
.build-info__type-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
}

/* Points Display */
.points-display {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.points-display__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.points-display__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.points-display__value {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.2rem;
}

.points-display__value--warning {
    color: var(--warning);
}

.points-display__value--error {
    color: var(--error);
}

/* Save Bar */
.build-editor__save-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-panel);
    border-top: 2px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
}

.build-editor__save-bar .btn-group {
    display: flex;
    gap: 0.75rem;
}

/* Readonly Mode */
.build-editor--readonly .build-editor__title-input {
    border-color: transparent;
    pointer-events: none;
    background: transparent;
    padding-left: 0;
}

.build-editor--readonly .build-editor__save-bar {
    display: none;
}

.build-editor--readonly .build-info__description {
    pointer-events: none;
    border-color: transparent;
    background: transparent;
}

.build-editor--readonly .build-info__type-select {
    pointer-events: none;
    border-color: transparent;
    background: transparent;
}

/* Share Section */
.build-share {
    background: var(--bg-secondary);
    padding: 0.4rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.build-share__label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.build-share__url {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    user-select: all;
}

/* Description Input (edit mode) */
.build-editor__desc-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 320px;
    transition: var(--transition);
}

.build-editor__desc-input:focus {
    outline: none;
    border-color: var(--gold);
    color: var(--text-primary);
}

/* Social Share Buttons */
.build-share__social {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.build-share__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.build-share__social-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Favorite button in header-right — force onto its own line */
#favorite-btn-container {
    flex-basis: 100%;
    display: flex;
    justify-content: flex-end;
}

/* Action Bar (Favorite + Edit, always visible in readonly) */
.build-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.build-action-bar__fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.build-action-bar__fav-btn:hover:not(:disabled) {
    border-color: #c0392b;
    color: #e74c3c;
}

.build-action-bar__fav-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.build-action-bar__fav-btn--active {
    border-color: #c0392b;
    color: #e74c3c;
}

.build-action-bar__fav-heart {
    font-size: 1.05rem;
    line-height: 1;
}

.build-action-bar__fav-btn--active .build-action-bar__fav-heart {
    color: #e74c3c;
}

.build-action-bar__fav-label {
    font-size: 0.85rem;
}

.build-action-bar__fav-count {
    font-size: 0.8rem;
    color: var(--text-dimmed);
    margin-left: 0.15rem;
}

/* Share Modal styles → unified in components.css */

/* Build Guide Section */
.build-guide {
    padding: 1.5rem 2rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    margin: 1rem 2rem 0;
    border: 1px solid var(--border-color);
}

.build-guide h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.build-guide__content {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

/* Comments Section (inside tab) */
.build-comments {
    padding: 1.5rem;
    background: transparent;
    border-radius: 0;
    margin: 0;
    border: none;
}

.build-comments__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comment-form__textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 70px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: var(--transition);
}

.comment-form__textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(165, 9, 5, 0.15);
}

.comment-form__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-form__chars {
    font-size: 0.8rem;
    color: var(--text-dimmed);
}

.comment-form__login {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.comment-form__login a {
    color: var(--gold);
    text-decoration: underline;
}

.comments-list {
    display: flex;
    flex-direction: column;
}

.comments-empty {
    color: var(--text-dimmed);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
}

.comment {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment--reply {
    margin-left: 2.5rem;
}

.comment--deleted {
    opacity: 0.5;
}

.comment--pending {
    opacity: 0.7;
    border-left: 3px solid #c4a24e;
}

.comment__pending-badge {
    display: inline-block;
    background: rgba(196, 162, 78, 0.2);
    color: #c4a24e;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comment__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.comment__body {
    flex: 1;
    min-width: 0;
}

.comment__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment__author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.comment__date {
    font-size: 0.8rem;
    color: var(--text-dimmed);
}

.comment__content {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.comment__actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
}

.comment__action-btn {
    background: none;
    border: none;
    color: var(--text-dimmed);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.comment__action-btn:hover {
    color: var(--gold);
}

/* Reply form (inline) */
.comment-reply-form {
    margin-left: 2.5rem;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-reply-form .comment-form__actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Build Guide Tab */
.build-guide-tab {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.build-guide-tab__title {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.build-guide-tab__hint {
    color: var(--text-dimmed);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.build-guide-tab__textarea {
    width: 100%;
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    min-height: 500px;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.build-guide-tab__textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(165, 9, 5, 0.15);
}

.build-guide-tab__content {
    color: var(--text-primary);
    line-height: 1.7;
    white-space: normal;
    font-size: 0.95rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-panel);
}

/* Rich-text formatting in readonly view */
.build-guide-tab__content h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
}

.build-guide-tab__content h3:first-child { margin-top: 0; }

.build-guide-tab__content h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.05rem;
    margin: 0.75rem 0 0.4rem;
}

.build-guide-tab__content h4:first-child { margin-top: 0; }

.build-guide-tab__content p {
    margin: 0.4rem 0;
}

.build-guide-tab__content ul,
.build-guide-tab__content ol {
    margin: 0.4rem 0 0.4rem 1.5rem;
    padding: 0;
}

.build-guide-tab__content li {
    margin-bottom: 0.2rem;
}

/* ============ Rich Text Editor ============ */

.rte-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #1a1b22;
    border: 1px solid var(--border-color, #2a2a35);
    border-bottom: none;
    border-radius: var(--border-radius, 4px) var(--border-radius, 4px) 0 0;
    flex-wrap: wrap;
}

.rte-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--text-secondary, #b0ada5);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
    line-height: 1;
}

.rte-toolbar__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e0ddd5);
}

.rte-toolbar__btn--active {
    background: rgba(196, 162, 78, 0.15);
    border-color: rgba(196, 162, 78, 0.3);
    color: var(--gold, #c4a24e);
}

.rte-toolbar__sep {
    width: 1px;
    height: 20px;
    background: var(--border-color, #2a2a35);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Color picker wrapper */
.rte-toolbar__color-wrap {
    position: relative;
}

.rte-toolbar__color-icon {
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--gold, #c4a24e);
    line-height: 1;
    padding-bottom: 1px;
}

.rte-toolbar__color-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: #1a1b22;
    border: 1px solid var(--border-color, #2a2a35);
    border-radius: 6px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: none;
}

.rte-toolbar__color-palette--open {
    display: grid;
}

.rte-toolbar__swatch {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.12s, transform 0.12s;
    padding: 0;
}

.rte-toolbar__swatch:hover {
    border-color: #fff;
    transform: scale(1.15);
}

/* Contenteditable editor area */
.rte-editor {
    width: 100%;
    min-height: 500px;
    background: var(--bg-secondary, #13151a);
    border: 1px solid var(--border-color, #2a2a35);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0 0 var(--border-radius, 4px) var(--border-radius, 4px);
    color: var(--text-primary, #e0ddd5);
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
    transition: border-color var(--transition-fast, 0.15s);
}

.rte-editor:focus {
    border-color: var(--gold, #c4a24e);
    box-shadow: 0 0 0 3px rgba(165, 9, 5, 0.15);
}

/* Placeholder via :empty::before */
.rte-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-dimmed, #7a7870);
    pointer-events: none;
    font-style: italic;
}

/* Formatting inside the editor */
.rte-editor h3 {
    font-family: var(--font-heading);
    color: var(--gold, #c4a24e);
    font-size: 1.2rem;
    margin: 0.75rem 0 0.4rem;
}

.rte-editor h3:first-child { margin-top: 0; }

.rte-editor h4 {
    font-family: var(--font-heading);
    color: var(--text-primary, #e0ddd5);
    font-size: 1.05rem;
    margin: 0.6rem 0 0.3rem;
}

.rte-editor h4:first-child { margin-top: 0; }

.rte-editor p {
    margin: 0.3rem 0;
}

.rte-editor ul,
.rte-editor ol {
    margin: 0.3rem 0 0.3rem 1.5rem;
    padding: 0;
}

.rte-editor li {
    margin-bottom: 0.15rem;
}

/* Video Tab */
.build-video-tab {
    max-width: 100%;
}

.build-video-tab__input-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 1.5rem;
}

.build-video-tab__input {
    flex: 1;
    max-width: 700px;
}

.build-video-tab__preview {
    width: 100%;
}

.build-video-tab__preview--empty {
    border: 1px dashed var(--border-color, #2a2a35);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-dimmed);
}

.build-video-tab__preview--empty svg {
    display: block;
    margin: 0 auto 0.75rem;
    opacity: 0.3;
}

.build-video-tab__player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.build-video-tab__player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Edit Mode Styles */
.build-editor--editing .gear-slot {
    cursor: pointer;
}

.edit-overlay {
    position: absolute;
    inset: 0;
    border: 2px dashed var(--gold);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-overlay__icon {
    font-size: 1.25rem;
    color: var(--gold);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.build-editor--editing .edit-overlay {
    opacity: 0.5;
}

.build-editor--editing .gear-slot:hover .edit-overlay {
    opacity: 1;
}

.build-editor--editing .gear-slot:hover .edit-overlay__icon {
    opacity: 1;
}

/* Edit Toolbar (fixed bottom) */
.edit-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-top: 2px solid var(--gold);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-modal-backdrop, 1000);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.build-editor--editing .edit-toolbar {
    transform: translateY(0);
}

.edit-toolbar__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.edit-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Unsaved Changes Indicator */
.unsaved-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--warning);
}

.unsaved-indicator--visible {
    display: inline-flex;
}

.unsaved-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-tab-content {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .build-editor__header {
        flex-direction: column;
        padding: 0.6rem 1rem;
        gap: 0.75rem;
        align-items: stretch;
    }

    .build-editor__class-icon {
        width: 60px;
        height: 60px;
    }

    .build-editor__title {
        font-size: 1.2rem;
    }

    .build-editor__class-heading {
        font-size: 1.1rem;
    }

    /* Sub-bar: wrap inputs and selects */
    .build-editor__sub-bar {
        padding: 0.4rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .build-editor__sub-bar input,
    .build-editor__sub-bar select {
        min-width: unset;
        flex: 1 1 45%;
    }

    .variant-bar {
        padding: 0.3rem 1rem;
    }

    .variant-bar__tab {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }

    .build-editor__build-selector-group {
        flex-wrap: wrap;
    }

    .build-editor__sub-bar .build-editor__visibility-selector {
        flex-basis: 100%;
        margin-left: 0;
    }

    .build-editor__build-name-input {
        min-width: 150px;
        width: 100%;
    }

    .build-editor__header-right {
        gap: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }

    .build-editor__badges {
        justify-content: center;
    }

    /* Tab nav: horizontal scroll with snap */
    .editor-tabs {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .editor-tabs__tab {
        flex: 0 0 auto;
        min-width: auto;
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .editor-tab-content {
        padding: 0;
    }

    .build-info {
        padding: 1rem;
    }

    .build-info__row {
        flex-direction: column;
        gap: 1rem;
    }

    .build-editor__save-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .points-display {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.95rem;
    }

    .build-editor__save-bar .btn-group {
        width: 100%;
        flex-direction: column;
    }

    .build-editor__save-bar .btn {
        width: 100%;
    }

    .build-action-bar {
        padding: 0.4rem 1rem;
    }

    .build-share {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .build-comments {
        margin: 1rem;
        padding: 1rem;
    }

    .build-guide {
        margin: 1rem;
        padding: 1rem;
    }

    .comment--reply,
    .comment-reply-form {
        margin-left: 1.5rem;
    }

    /* Edit toolbar mobile layout */
    .edit-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .edit-toolbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .edit-toolbar__right .btn {
        flex: 1;
    }
}

/* ============ Gear Stats Tab ============ */

.gear-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.gear-stats-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg, 8px);
    padding: 1rem;
    transition: border-color var(--transition-fast);
}

.gear-stats-card:hover {
    border-color: var(--border-hover);
}

.gear-stats-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gear-stats-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dimmed);
    flex-shrink: 0;
}

.gear-stats-card__title {
    min-width: 0;
}

.gear-stats-card__name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.gear-stats-card__slot {
    font-size: 0.8rem;
    color: var(--text-dimmed);
    margin-top: 2px;
}

.gear-stats-card__divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

.gear-stats-card__stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gear-stats-card__affix {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.gear-stats-card__affix-icon {
    color: var(--text-dimmed);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.gear-stats-card__affix-value {
    margin-left: auto;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.gear-stats-card__unique-effect {
    font-size: 0.82rem;
    color: var(--gold);
    font-style: italic;
    line-height: 1.4;
    display: flex;
    gap: 0.4rem;
}

.gear-stats-card__aspect {
    font-size: 0.82rem;
    color: var(--legendary-purple);
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

/* Rarity colors on card item names */
.gear-stats-card--legendary .gear-stats-card__name { color: var(--rarity-legendary); }
.gear-stats-card--unique .gear-stats-card__name { color: var(--rarity-unique); }
.gear-stats-card--mythic-unique .gear-stats-card__name { color: var(--rarity-mythic); }
.gear-stats-card--rare .gear-stats-card__name { color: var(--rarity-rare); }
.gear-stats-card--magic .gear-stats-card__name { color: var(--rarity-magic); }

/* Rarity border glow on hover */
.gear-stats-card--legendary:hover { border-color: var(--rarity-legendary); }
.gear-stats-card--unique:hover { border-color: var(--rarity-unique); }
.gear-stats-card--mythic-unique:hover { border-color: var(--rarity-mythic); }

/* ============ Mercenaries Tab — see mercenaries-tab.css ============ */

/* ============ Season Mechanic Tab ============ */

.season-tab {
    padding: 0.5rem 0;
}

.season-tab__empty {
    text-align: center;
    color: var(--text-dimmed);
    font-size: 0.85rem;
    font-style: italic;
    padding: 2rem 0;
}

/* Extra small (< 480px) */
@media (max-width: 480px) {
    .editor-tabs__tab {
        min-width: 80px;
        padding: 0.6rem 0.75rem;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .editor-tab-content {
        padding: 0;
    }

    .build-editor__class-icon {
        width: 40px;
        height: 40px;
    }

    .build-editor__build-name-input {
        min-width: 120px;
        font-size: 0.8rem;
    }
}

/* Recovery Banner */
.build-editor__recovery-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    background: rgba(196, 162, 78, 0.12);
    border-bottom: 1px solid rgba(196, 162, 78, 0.3);
    color: var(--gold, #c4a24e);
    font-size: 0.85rem;
}

.build-editor__recovery-banner span {
    flex: 1;
}

/* Re-Login Modal Overlay */
.relogin-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.relogin-overlay--visible {
    opacity: 1;
}

.relogin-modal {
    background: var(--bg-secondary, #13151a);
    border: 1px solid var(--border, #2a2a35);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.relogin-modal__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    color: var(--gold, #c4a24e);
    font-size: 1.2rem;
}

.relogin-modal__text {
    margin: 0 0 1.25rem;
    color: var(--text-secondary, #7a7870);
    font-size: 0.85rem;
    line-height: 1.5;
}

.relogin-modal__error {
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: #ff5050;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.relogin-modal__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.relogin-modal__input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-primary, #0a0a0f);
    border: 1px solid var(--border, #2a2a35);
    border-radius: 4px;
    color: var(--text-primary, #e0ddd5);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.relogin-modal__input:focus {
    outline: none;
    border-color: var(--gold, #c4a24e);
}

.relogin-modal__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.relogin-modal__actions .btn {
    flex: 1;
}

/* ---- Mention Autocomplete ---- */

.mention {
    display: inline-flex;
    align-items: baseline;
    cursor: pointer;
    white-space: nowrap;
    font-size: inherit;
    line-height: inherit;
    vertical-align: baseline;
}

.mention:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.mention-icon {
    width: 1.1em;
    height: 1.1em;
    object-fit: contain;
    margin-right: 2px;
    flex-shrink: 0;
    align-self: center;
}

/* Dropdown */
.mention-dropdown {
    position: fixed;
    z-index: 10000;
    background: #1a1b22;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 280px;
    overflow-y: auto;
    min-width: 240px;
    display: none;
}

.mention-dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.mention-dropdown__item:hover,
.mention-dropdown__item--active {
    background: rgba(196, 162, 78, 0.12);
}

.mention-dropdown__icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 2px;
}

.mention-dropdown__icon-placeholder {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.mention-dropdown__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

.mention-dropdown__type {
    color: #7a7870;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.mention-dropdown__empty {
    padding: 16px;
    text-align: center;
    color: #7a7870;
    font-size: 13px;
}

/* @ toolbar button */
#rte-mention-btn {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-gold, #c4a24e);
}
