/* Standalone stigma page layout and hover/legend fixes */
/* Info boxes */
.info-box { 
    background: #15151a; 
    border-left: 4px solid var(--accent); 
    padding: 15px; 
    margin: 20px 0; 
    border-radius: 4px; 
    font-size: 0.9em; 
}

.warning-box { 
    background: #2a1a1a; 
    border-left: 4px solid var(--warning); 
    padding: 15px; 
    margin: 20px 0; 
    border-radius: 4px; 
    font-size: 1em; 
    line-height: 1.6; 
}

.daevanion-warning-wrap {
    margin: 14px 0 6px;
}

.daevanion-warning-mini-toggle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 199, 120, 0.45);
    background: rgba(50, 23, 23, 0.95);
    color: #ffd58e;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.daevanion-warning-mini-toggle:hover {
    background: rgba(100, 35, 35, 0.95);
}

.daevanion-warning-wrap.is-open .daevanion-warning-mini-toggle {
    display: none;
}

.daevanion-warning-wrap.is-collapsed .daevanion-warning-box {
    display: none;
}

.daevanion-warning-box {
    position: relative;
    margin: 0;
    padding-right: 40px;
}

.daevanion-warning-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 199, 120, 0.35);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.18);
    color: #ffd8a0;
    line-height: 1;
    cursor: pointer;
}

.daevanion-warning-close:hover {
    background: rgba(255, 199, 120, 0.08);
}

.warning-box img {
    height: 2em;
    width: auto;
    vertical-align: middle;
    margin: 0 4px;
}

#stigma-tab-bar {
    margin: 4px auto 10px;
    width: fit-content;
}

.daevanion-panel {
    overflow: visible;
}

.daevanion-table-wrap {
    width: auto;
    text-align: center;
    overflow-x: auto;
}

.daevanion-table {
    width: auto;
    display: inline-table;
    border-collapse: collapse;
    min-width: 0;
}

.daevanion-table th,
.daevanion-table td {
    border: 1px solid rgba(190, 160, 90, 0.28);
    padding: 5px;
    vertical-align: middle;
    background: rgba(8, 10, 16, 0.42);
}

.daevanion-table th {
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    color: #d8c495;
    text-align: left;
    background: rgba(20, 15, 9, 0.62);
}

.daevanion-table tr:nth-child(4n + 3) td,
.daevanion-table tr:nth-child(4n + 4) td {
    background: rgba(10, 12, 19, 0.55);
}

.daevanion-cell-default,
.daevanion-cell-used {
    min-width: 58px;
}

.daevanion-cell-default {
    vertical-align: top !important;
}

.daevanion-cell-used {
    min-width: 240px;
}

.daevanion-skill-btn {
    width: 56px;
    height: 56px;
    border: 1px solid rgba(150, 160, 190, 0.34);
    border-radius: 8px;
    background: rgba(14, 17, 26, 0.92);
    color: #e4eafc;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.daevanion-skill-btn:hover,
.daevanion-skill-btn:focus-visible {
    border-color: rgba(223, 196, 135, 0.8);
    background: rgba(20, 24, 36, 0.96);
}

.daevanion-skill-btn:disabled {
    cursor: default;
    opacity: 0.95;
}

.daevanion-skill-btn.is-selected {
    border-color: rgba(95, 210, 175, 0.75);
    box-shadow: inset 0 0 0 1px rgba(95, 210, 175, 0.28);
}
.daevanion-skill-btn.is-selected .daevanion-skill-icon-wrap::after {
    opacity: 1;
}

.daevanion-row-improved {
    background: rgba(12, 16, 28, 0.95);
}

.daevanion-row-normal {
    background: rgba(12, 14, 19, 0.95);
}

.daevanion-default-skill {
    background: rgba(24, 18, 10, 0.88);
}

.daevanion-skill-icon-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.daevanion-skill-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: url('../icons/border_slot.png') center / contain no-repeat;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.daevanion-skill-btn:hover .daevanion-skill-icon-wrap::after,
.daevanion-skill-btn:focus-visible .daevanion-skill-icon-wrap::after {
    opacity: 1;
}

.daevanion-skill-icon {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
}

.daevanion-used-skill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.daevanion-used-icon-wrap {
    width: 72px;
    height: 72px;
    min-width: 72px;
    background: url('../icons/daevanion_frame.png') center / contain no-repeat;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.daevanion-used-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.daevanion-used-name {
    color: #f3e6ca;
    font-size: 0.84rem;
    line-height: 1.3;
    text-align: left;
}

.daevanion-used-empty {
    color: #a5adbf;
    font-size: 0.82rem;
}

.daevanion-builder-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-height: 28px;
    margin-bottom: 12px;
    padding-right: 4px;
}

.daevanion-builder-head .stigma-preset-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.daevanion-builder-head .stigma-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(200, 170, 100, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #f2e7cc;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.daevanion-builder-head .stigma-preset-btn:hover,
.daevanion-builder-head .stigma-preset-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 210, 120, 0.45);
}

.daevanion-builder-head .stigma-preset-btn img {
    width: 40px;
    height: 20px;
    object-fit: contain;
}

.daevanion-builder-head .gc-reset-btn {
    right: 4px;
    margin: 0;
}

.stigma-tooltip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.stigma-tooltip-grid .gc-item-tooltip-card {
    width: 320px;
    max-width: min(46vw, 360px);
}

.gc-item-tooltip-growth {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 1px;
    padding: 0 5px;
    border: 1px solid rgba(116, 220, 145, 0.18);
    border-radius: 6px;
    background: rgba(68, 130, 86, 0.12);
    color: #bfeac8;
    font-weight: 600;
    white-space: nowrap;
}

.gc-item-tooltip-growth::before {
    content: '';
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    background: url('../icons/comp_greater.svg') center / contain no-repeat;
    opacity: 0.8;
}

.gc-item-tooltip-growth.is-reduction::before {
    transform: rotate(180deg);
}

.gc-item-tooltip-growth.is-per-level {
    border-color: rgba(147, 234, 173, 0.24);
    background: rgba(83, 149, 98, 0.16);
}

.gc-item-tooltip-growth.is-reduction {
    border-color: rgba(128, 214, 154, 0.22);
    background: rgba(73, 139, 92, 0.14);
}

.stigma-panel {
    margin: 8px 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 180, 90, 0.35);
    border-radius: 8px;
    background: linear-gradient(rgba(20, 14, 9, 0.68), rgba(20, 14, 9, 0.68)),
                url('../icons/stigma-panel-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.stigma-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stigma-title {
    align-items: center;
    display: flex;
    font-size: 0.92em;
    font-weight: 700;
    color: var(--warning);
}

.stigma-help {
    font-size: 0.74em;
    color: #c7c0af;
    margin-bottom: 8px;
}

.stigma-row {
    margin-bottom: 8px;
}

.stigma-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 6px;
}

.stigma-main-map {
    position: relative;
    width: min(100%, 400px);
    max-width: 400px;
    aspect-ratio: 400 / 315;
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
    border-radius: 8px;
    overflow: visible;
    flex-shrink: 0;
}

.stigma-map-slot {
    position: absolute;
    transform: translateZ(0);
    z-index: 1;
}

.stigma-map-slot:focus-within {
    z-index: 250;
}

.stigma-row-label {
    font-size: 0.74em;
    color: #d8d2c0;
    margin-bottom: 4px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
}

.stigma-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px 12px;
    justify-items: center;
}

.stigma-slot {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px;
    width: 90px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stigma-slot-label {
    font-size: 0.72em;
    color: #a9adc2;
    margin-bottom: 2px;
    text-align: center;
}

.stigma-map-node .stigma-slot-label {
    display: none;
}

.stigma-current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 78px;
    margin-left: auto;
    margin-right: auto;
    min-height: 78px;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    background-color: transparent;
    background-position: 0 -78px;
    background-repeat: no-repeat;
    background-size: 85px 156px;
    cursor: pointer;
}

.stigma-current.is-filled {
    filter: saturate(1.06);
}

.stigma-current:hover {
    background-position: 0 0;
}

.stigma-current.stigma-tier-green {
    background-image: url('../icons/green_slots.png');
}

.stigma-current.stigma-tier-blue {
    background-image: url('../icons/blue_slots.png');
}

.stigma-current.stigma-tier-gold {
    background-image: url('../icons/gold_slots.png');
}

.stigma-current-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: none;
    background: rgba(0, 0, 0, 0.28);
    object-fit: cover;
    flex-shrink: 0;
}

.stigma-option-grid {
    display: none;
    grid-template-columns: repeat(4, 44px);
    gap: 8px;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(8, 9, 12, 0.94);
    border: 1px solid rgba(180, 150, 88, 0.5);
    border-radius: 8px;
    padding: 6px;
    width: max-content;
    max-width: none;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.stigma-option-group-label {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: rgba(224, 196, 132, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 4px;
    margin-bottom: 2px;
}

.stigma-slot:focus-within .stigma-option-grid {
    display: grid;
}

.stigma-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 5px;
    border: 1px solid rgba(196, 162, 94, 0.24);
    background: rgba(0, 0, 0, 0.22);
    color: #ece7db;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
    position: relative;
}

.stigma-option:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(224, 196, 132, 0.68);
}

.stigma-option.selected {
    border-color: rgba(224, 196, 132, 0.9);
    background: rgba(25, 20, 10, 0.56);
}

.stigma-option.selected:hover::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background: url('../icons/border_slot.png') center / contain no-repeat;
    pointer-events: none;
}

.stigma-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stigma-option-empty {
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
}

.stigma-option-empty-mark {
    font-size: 1.15em;
    line-height: 1;
    color: #d2c8af;
}

.stigma-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: transparent;
}

.stigma-slot-note {
    margin-top: 3px;
    font-size: 0.72em;
    color: #ffb88f;
    text-align: center;
}

.stigma-vision {
    margin-top: 4px;
    padding: 10px;
    border: 1px solid rgba(255, 186, 90, 0.26);
    border-radius: 6px;
    background: rgba(28, 22, 14, 0.6);
}

.stigma-vision-center {
    width: 85px;
    padding: 0;
    border: none;
    background: transparent;
    text-align: center;
    margin-top: 0;
}

.stigma-vision-center .stigma-current {
    margin-bottom: 2px;
}

.stigma-vision-center .stigma-vision-label {
    font-size: 0.68em;
    margin-bottom: 2px;
}

.stigma-vision-center .stigma-vision-name {
    font-size: 0.62em;
    color: #f0dfb1;
    line-height: 1.2;
}

.stigma-vision-label {
    font-size: 0.72em;
    color: #bcb5a0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stigma-vision-name {
    font-size: 0.9em;
    color: #ffd786;
    font-weight: 700;
    margin-top: 2px;
}

.stigma-vision-meta {
    font-size: 0.74em;
    color: #e0d2b4;
    margin-top: 2px;
}

.stigma-vision-desc {
    font-size: 0.75em;
    color: #d2c8b0;
    margin-top: 4px;
    line-height: 1.35;
}

.stigma-status {
    margin-top: 8px;
    font-size: 0.76em;
    color: #c7c3b6;
}

#stigma-builder .stigma-panel {
    overflow: visible;
}

#stigma-builder .stigma-builder-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-height: 28px;
    margin-bottom: 12px;
    padding-right: 4px;
}

#stigma-builder .stigma-preset-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

#stigma-builder .stigma-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(200, 170, 100, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #f2e7cc;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#stigma-builder .stigma-preset-btn:hover,
#stigma-builder .stigma-preset-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 210, 120, 0.45);
}

#stigma-builder .stigma-preset-btn img {
    width: 40px;
    height: 20px;
    object-fit: contain;
}

/* Subtle copied animation for share button */
#stigma-builder .stigma-share-btn {
    position: relative;
}

#stigma-builder .stigma-share-btn.copied {
    /* subtle feedback: quick, small scale only */
    animation: stigma-share-pop 0.42s cubic-bezier(.2,.9,.3,1);
    border-color: rgba(120, 200, 140, 0.65);
    background: linear-gradient(180deg, rgba(80,190,120,0.12), rgba(40,130,80,0.04));
}

/* checkmark shown inline via label text when copied */

@keyframes stigma-share-pop {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-1px) scale(1.01); }
    100% { transform: translateY(0) scale(1); }
}

#stigma-builder .stigma-builder-head .stigma-title {
    margin: 0 auto;
    text-align: center;
}

#stigma-builder .stigma-builder-head .gc-reset-btn {
    right: 4px;
    margin: 0;
}

#stigma-builder .stigma-two-col {
    display: grid;
    grid-template-columns: minmax(525px, 1fr) minmax(350px, 450px);
    gap: 150px;
    align-items: start;
    max-width: 980px;
    margin: 0 auto;
}

#stigma-builder .stigma-left {
    min-width: 0;
}

#stigma-builder .stigma-layout {
    justify-content: flex-start;
}

/* Scale main stigma content up by ~25%. */
#stigma-builder .stigma-main-map {
    width: min(100%, 500px);
    max-width: 500px;
    background-image: url('../../assets/icons/visionStigmaBg.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
}

#stigma-builder .stigma-main-map.is-vision-active {
    background-image: url('../../assets/icons/visionStigmaBg.png');
    background-position: center top;
}

#stigma-builder .stigma-slot {
    width: 112px;
}

#stigma-builder .stigma-current {
    width: 106px;
    height: 98px;
    min-height: 98px;
    background-size: 106px 196px;
    background-position: 0 -98px;
}

#stigma-builder .stigma-current-icon {
    width: 50px;
    height: 50px;
}

#stigma-builder .stigma-option-grid {
    grid-template-columns: repeat(var(--stigma-option-cols, 4), 52px);
    gap: 8px;
    justify-content: center;
    justify-items: center;
    width: max-content;
}

#stigma-builder .stigma-option {
    width: 52px;
    height: 52px;
}

#stigma-builder .stigma-option-icon {
    width: 38px;
    height: 38px;
}

/* Builder item hover: no movement/scale, only border_slot shadow behind icon. */
#stigma-builder .stigma-current,
#stigma-builder .stigma-option {
    position: relative;
    overflow: visible;
}

/* Neutralize inherited tooltip-trigger hover glow/scale from shared gear stylesheet. */
#stigma-builder .stigma-main-map .gc-item-tooltip-trigger,
#stigma-builder .stigma-main-map .gc-item-tooltip-trigger:hover,
#stigma-builder .stigma-main-map .gc-item-tooltip-trigger:focus-visible,
#stigma-builder .stigma-option.gc-item-tooltip-trigger,
#stigma-builder .stigma-option.gc-item-tooltip-trigger:hover,
#stigma-builder .stigma-option.gc-item-tooltip-trigger:focus-visible {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    transition: none;
}

#stigma-builder .stigma-current-icon,
#stigma-builder .stigma-option-icon {
    position: relative;
    z-index: 1;
}

#stigma-builder .stigma-current::before,
#stigma-builder .stigma-option::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    background: url('../../assets/icons/border_slot.png') center / contain no-repeat;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

#stigma-builder .stigma-current:hover,
#stigma-builder .stigma-current.is-filled:hover {
    background-position: 0 0;
    filter: none;
}

#stigma-builder .stigma-option:hover:not(:disabled) {
    transform: none;
    border-color: rgba(196, 162, 94, 0.24);
    box-shadow: none;
}

#stigma-builder .stigma-current:hover::before,
#stigma-builder .stigma-current:focus-visible::before,
#stigma-builder .stigma-option:hover::before,
#stigma-builder .stigma-option:focus-visible::before {
    opacity: 1;
}

#stigma-builder .stigma-option.selected:hover::after {
    content: none;
}

#stigma-builder .stigma-clear-btn {
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 1px solid rgba(148, 122, 88, 0.72);
    border-radius: 4px;
    background-image:
        linear-gradient(145deg, rgba(150, 140, 120, 0.25), rgba(42, 38, 32, 0.78)),
        url('../../assets/icons/stigmas_locked.png');
    background-size: cover;
    background-position: center;
    color: #f08383;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    opacity: 0.9;
}

#stigma-builder .stigma-clear-btn:hover:not(:disabled),
#stigma-builder .stigma-clear-btn:focus-visible {
    color: #ffd3d3;
    border-color: rgba(189, 157, 113, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 223, 178, 0.22), 0 0 6px rgba(255, 96, 96, 0.32);
    text-shadow: 0 0 5px rgba(255, 96, 96, 0.42);
}

#stigma-builder .stigma-clear-btn.is-disabled,
#stigma-builder .stigma-clear-btn:disabled {
    opacity: 0.35;
    cursor: default;
    text-shadow: none;
}

#stigma-builder .stigma-vision-marker {
    transform: translate(-50%, -50%);
    z-index: 2;
}

#stigma-builder .stigma-vision-trigger,
#stigma-builder .stigma-vision-trigger:hover,
#stigma-builder .stigma-vision-trigger:focus-visible {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    padding: 0;
    min-width: 0;
    cursor: pointer;
}

#stigma-builder .stigma-vision-trigger {
    position: relative;
    overflow: visible;
}

#stigma-builder .stigma-vision-trigger::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    background: url('../../assets/icons/border_slot.png') center / contain no-repeat;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

#stigma-builder .stigma-vision-trigger:hover::before,
#stigma-builder .stigma-vision-trigger:focus-visible::before {
    opacity: 1;
}

#stigma-builder .stigma-vision-text {
    font-size: 0.72em;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(238, 214, 155, 0.9);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.65);
}

#stigma-builder .stigma-vision-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    display: block;
    position: relative;
    z-index: 1;
}

#stigma-builder .stigma-legend {
    background: rgba(10, 12, 18, 0.55);
    border: 1px solid rgba(120, 132, 160, 0.35);
    border-radius: 8px;
    padding: 12px;
}

#stigma-builder .stigma-legend-title {
    color: #d7e2ff;
    font-size: 0.84em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

#stigma-builder .stigma-legend-row {
    display: grid;
    grid-template-columns: 52px 20px 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 12px;
}

#stigma-builder .stigma-legend-row-main {
    align-items: center;
}

#stigma-builder .stigma-legend-row:last-child {
    margin-bottom: 0;
}

#stigma-builder .stigma-legend-arrow {
    color: #c7d0e8;
    font-size: 0.95em;
    line-height: 38px;
    text-align: center;
}

#stigma-builder .stigma-legend-combos {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#stigma-builder .stigma-legend-combo {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

#stigma-builder .stigma-legend-plus {
    color: #aeb8cf;
    font-weight: 700;
    font-size: 0.8em;
}

#stigma-builder .stigma-legend-fallback-text,
#stigma-builder .stigma-legend-empty {
    color: #b9c3da;
    font-size: 0.78em;
    line-height: 1.3;
    padding-top: 10px;
}

#stigma-builder .stigma-legend-icon {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(160, 172, 205, 0.4);
    border-radius: 6px;
    padding: 0;
    background: rgba(7, 9, 14, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#stigma-builder .stigma-legend-icon img {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
}

#stigma-builder .stigma-legend-icon-vision {
    border-color: rgba(225, 193, 125, 0.78);
}

#stigma-builder .stigma-vision-group {
    margin-bottom: 12px;
}

#stigma-builder .stigma-vision-group-delimited {
    border-top: 1px solid rgba(140, 150, 178, 0.28);
    padding-top: 12px;
}

#stigma-builder .stigma-legend-target .stigma-legend-icon-vision {
    width: 56px;
    height: 56px;
}

#stigma-builder .stigma-legend-row-fallback {
    border-top: 1px solid rgba(140, 150, 178, 0.28);
    margin-top: 12px;
    padding-top: 12px;
}

#stigma-builder .stigma-legend-icon-placeholder {
    width: 50px;
    height: 50px;
    display: inline-block;
}

#stigma-builder .stigma-legend-icon-placeholder::before {
    content: '';
    width: 100%;
    height: 100%;
    display: block;
}

#stigma-builder .stigma-legend-plus.is-hidden {
    visibility: hidden;
}

@media (max-width: 768px) {

    #stigma-tab-bar {
        width: 100%;
    }

    #stigma-tab-bar .gc-tab {
        min-height: 44px;
    }

    .daevanion-table {
        min-width: 640px;
    }

    .daevanion-cell-default,
    .daevanion-cell-used {
        min-width: 56px;
    }

    .daevanion-cell-used {
        min-width: 200px;
    }

    .daevanion-used-name {
        font-size: 0.78rem;
    }

    #stigma-builder .stigma-two-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #stigma-builder .stigma-main-map {
        width: min(100%, 320px);
        max-width: 320px;
        margin: 0 auto;
        background-size: 90% auto;
        background-position: center top;
        padding-bottom: 90px;
    }

    #stigma-builder .stigma-layout {
        justify-content: center;
    }

    #stigma-builder .stigma-map-slot {
        transform: translate(-50%, -50%);
    }

    #stigma-builder .stigma-slot {
        width: 72px;
    }

    #stigma-builder .stigma-current {
        width: 70px;
        height: 64px;
        min-height: 64px;
        background-size: 70px 128px;
        background-position: 0 -64px;
    }

    #stigma-builder .stigma-current-icon {
        width: 32px;
        height: 32px;
    }

    #stigma-builder .stigma-option-grid {
        grid-template-columns: repeat(var(--stigma-option-cols, 4), 34px);
        gap: 6px;
    }

    #stigma-builder .stigma-option {
        width: 34px;
        height: 34px;
    }

    #stigma-builder .stigma-option-icon {
        width: 24px;
        height: 24px;
    }

    #stigma-builder .stigma-clear-btn {
        width: 14px;
        height: 14px;
        left: -10px;
    }

    #stigma-builder .stigma-clear-btn {
        display: none;
    }

    /* MAIN 6 */

    #stigma-builder .stigma-map-slot:nth-child(1) {
        left: calc(50%) !important;
        top: calc(14%) !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(2) {
        left: calc(25%) !important;
        top: calc(35%) !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(3) {
        left: calc(74%) !important;
        top: calc(35%) !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(4) {
        left: calc(28%) !important;
        top: calc(68%) !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(5) {
        left: calc(51%) !important;
        top: calc(80%) !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(6) {
        left: calc(73%) !important;
        top: calc(67%) !important;
    }

    /* SIDE 3 BELOW */

    #stigma-builder .stigma-map-slot:nth-child(7) {
        left: 20% !important;
        top: 110% !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(8) {
        left: 50% !important;
        top: 110% !important;
    }

    #stigma-builder .stigma-map-slot:nth-child(9) {
        left: 80% !important;
        top: 110% !important;
    }

    #stigma-builder .stigma-vision-marker {
        left: 51% !important;
        top: 46% !important;
    }

    #stigma-builder .stigma-vision-icon {
        width: 30px;
        height: 30px;
    }

    #stigma-builder .stigma-legend {
        width: min(100%, 320px);
        margin: 55px auto 0;
    }

    #stigma-builder .stigma-legend-row {
        grid-template-columns: 40px 16px 1fr;
    }

    #stigma-builder .stigma-legend-icon,
    #stigma-builder .stigma-legend-icon-vision {
        width: 42px;
        height: 42px;
    }

    #stigma-builder .stigma-legend-icon img {
        width: 24px;
        height: 24px;
    }

    #stigma-builder .stigma-preset-btn {
        padding: 8px 8px;
        font-size: 0.78rem;
    }

    /* Hide labels for preset icon buttons on mobile, but keep label for the share button */
    #stigma-builder .stigma-preset-btn:not(.stigma-share-btn) span {
        display: none;
    }
}

.stigma-mobile-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.stigma-mobile-modal.is-open {
    display: block;
}

.stigma-mobile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(4px);
}

.stigma-mobile-modal-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);

    background: #11151c;
    border: 1px solid rgba(190,160,90,.45);
    border-radius: 14px;

    padding: 18px;
    max-height: 80vh;
    overflow-y: auto;
}

.stigma-mobile-close {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 34px;
    height: 34px;

    border: none;
    border-radius: 8px;

    background: rgba(255,255,255,.08);
    color: white;

    cursor: pointer;
}

.stigma-mobile-dialog-title {
    color: #f5e9c9;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.stigma-mobile-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.stigma-mobile-action-button {
    border: 1px solid rgba(190,160,90,.45);
    background: rgba(255,255,255,.08);
    color: #f3ebd7;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.stigma-mobile-action-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.stigma-mobile-group {
    margin-bottom: 14px;
}

.stigma-mobile-group-label {
    color: #c4b387;
    font-size: 0.76rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

    .stigma-mobile-skill-card {
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .stigma-mobile-skill-card-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 10px;
    }

    .stigma-mobile-skill-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .stigma-mobile-skill-title {
        color: #f5e9c9;
        font-weight: 700;
        font-size: 0.97rem;
    }

    .stigma-mobile-skill-meta {
        color: #d6c8a1;
        font-size: 0.82rem;
        margin-bottom: 8px;
    }

    .stigma-mobile-skill-meta-line {
        margin-bottom: 4px;
    }

    .stigma-mobile-skill-description {
        color: #e7dfc9;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .stigma-option-grid-mobile {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

.stigma-mobile-open-btn {
    display: none;
}

@media (max-width: 768px) {

    .stigma-mobile-open-btn {
        display: block;
        margin-top: 6px;

        border: 1px solid rgba(190,160,90,.45);
        background: rgba(0,0,0,.35);

        color: #ddd;
        border-radius: 8px;

        padding: 4px 10px;
        font-size: 12px;
    }

    #stigma-builder .stigma-option-grid {
        display: none !important;
    }

    body.stigma-modal-open {
        overflow: hidden;
    }

    #stigma-builder .stigma-legend-icon-placeholder {
        width: 42px;
        height: 42px;
    }
}
