:root {
    --sp-bg: #0b0613;
    --sp-surface: rgba(35, 15, 60, 0.85);
    --sp-card: rgba(35, 15, 60, 0.85);
    --sp-border: rgba(91, 33, 182, 0.5);
    --sp-border-hi: rgba(192, 132, 252, 0.5);
    --sp-purple: #7e22ce;
    --sp-purple-md: #a855f7;
    --sp-purple-lt: #c084fc;
    --sp-text: #e6d9ff;
    --sp-text-dim: #b8a3d8;
    --sp-muted: #7c6a9a;
    --sp-glow: rgba(126, 34, 206, 0.35);
    --sp-glow-hi: rgba(192, 132, 252, 0.45);
    --sp-radius: 12px;
    --sp-font-body: 'Cinzel', serif;
    --sp-font-head: 'Uncial Antiqua', cursive;
}

.sp-page {
    padding: 40px 0;
    max-width: 1800px;
    margin: 0 auto;
}

.sp-page-title {
    text-align: center;
    font-family: var(--sp-font-head);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 2rem;
    color: var(--sp-purple-lt);
    text-shadow: 0 0 15px var(--sp-purple);
    letter-spacing: 2px;
}

.sp-section-title {
    margin: 2.5rem 0 1rem;
    color: var(--sp-purple-md);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--sp-font-head);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
}

    .sp-section-title::before,
    .sp-section-title::after {
        content: '';
        flex: 1;
        height: 1px;
    }

    .sp-section-title::before {
        background: linear-gradient(90deg, transparent, #5b21b6);
    }

    .sp-section-title::after {
        background: linear-gradient(90deg, #5b21b6, transparent);
    }

.sp-card {
    background: var(--sp-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1.75rem;
    box-shadow: 0 0 20px var(--sp-glow);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

    .sp-card:hover {
        border-color: var(--sp-border-hi);
        box-shadow: 0 0 35px var(--sp-glow-hi);
    }

.sp-card-title {
    font-family: var(--sp-font-head);
    font-size: 1.1rem;
    color: var(--sp-purple-lt);
    text-shadow: 0 0 10px var(--sp-purple);
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sp-btn i {
    margin-right: 0.35em;
}

.sp-btn i:only-child {
    margin-right: 0;
}

.sp-form-group {
    margin-bottom: 1rem;
}

.sp-label {
    display: block;
    font-family: var(--sp-font-body);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sp-muted);
    margin-bottom: 0.35rem;
}

.sp-input {
    width: 100%;
    background: rgba(20, 8, 35, 0.9);
    border: 1px solid rgba(91, 33, 182, 0.45);
    border-radius: 8px;
    color: var(--sp-text);
    font-family: var(--sp-font-body);
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

    .sp-input:focus {
        border-color: var(--sp-purple-lt);
        box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.15), 0 0 12px rgba(126, 34, 206, 0.2);
    }

    .sp-input::placeholder {
        color: var(--sp-muted);
        opacity: 0.7;
    }

.sp-field-hint {
    font-size: 0.72rem;
    color: var(--sp-muted);
    margin-top: 0.3rem;
    font-family: var(--sp-font-body);
}

    .sp-field-hint code {
        background: rgba(91, 33, 182, 0.2);
        border: 1px solid rgba(91, 33, 182, 0.3);
        border-radius: 3px;
        padding: 0 4px;
        font-size: 0.85em;
        color: var(--sp-purple-lt);
    }

.sp-form-error {
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.5);
    border-left: 3px solid #e53935;
    border-radius: 0 8px 8px 0;
    color: #ff6b6b;
    font-size: 0.85rem;
    font-family: var(--sp-font-body);
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.75rem;
}

    .sp-form-error i {
        margin-right: 0.3rem;
    }

    .sp-form-error a {
        color: var(--sp-purple-lt);
        text-decoration: underline;
        font-weight: 600;
    }

        .sp-form-error a:hover {
            color: #c084fc;
        }

/* Info variant of form error (for informational messages) */
.sp-form-error.sp-form-info {
    background: rgba(126, 34, 206, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-left: 3px solid var(--sp-purple-md);
    color: var(--sp-text);
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--sp-font-body);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

    .sp-btn:hover:not(:disabled) {
        transform: translateY(-2px);
    }

    .sp-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.sp-btn-primary {
    background: rgba(126, 34, 206, 0.3);
    border: 1px solid var(--sp-purple-md);
    color: var(--sp-purple-lt);
    box-shadow: 0 0 12px rgba(126, 34, 206, 0.2);
}

    .sp-btn-primary:hover:not(:disabled) {
        background: rgba(168, 85, 247, 0.35);
        border-color: var(--sp-purple-lt);
        box-shadow: 0 0 20px rgba(192, 132, 252, 0.4);
        color: #fff;
    }

.sp-btn-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #86efac;
}

    .sp-btn-success:hover:not(:disabled) {
        background: rgba(34, 197, 94, 0.25);
        box-shadow: 0 0 14px rgba(34, 197, 94, 0.25);
    }

.sp-btn-danger {
    background: rgba(229, 57, 53, 0.15);
    border: 1px solid rgba(229, 57, 53, 0.4);
    color: #fca5a5;
}

    .sp-btn-danger:hover:not(:disabled) {
        background: rgba(229, 57, 53, 0.25);
        box-shadow: 0 0 14px rgba(229, 57, 53, 0.25);
    }

.sp-btn-ghost {
    background: transparent;
    border: 1px solid rgba(91, 33, 182, 0.4);
    color: var(--sp-muted);
}

    .sp-btn-ghost:hover:not(:disabled) {
        border-color: var(--sp-purple-lt);
        color: var(--sp-purple-lt);
        box-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
    }

.sp-btn-sm {
    font-size: 0.72rem;
    padding: 0.3rem 0.7rem;
}

.sp-btn-full {
    width: 100%;
}

.sp-index-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 860px) {
    .sp-index-grid {
        grid-template-columns: 1fr;
    }
}

.sp-success-panel {
    margin-top: 1.25rem;
    padding: 1.1rem;
    background: rgba(20, 8, 35, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-left: 3px solid var(--sp-purple-md);
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.sp-success-title {
    font-family: var(--sp-font-head);
    font-size: 0.95rem;
    color: var(--sp-purple-lt);
    text-shadow: 0 0 8px var(--sp-purple);
    margin-bottom: 0.5rem;
}

.sp-success-body {
    font-size: 0.82rem;
    color: var(--sp-text-dim);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-family: var(--sp-font-body);
}

.sp-token-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.sp-token-value {
    flex: 1;
    background: rgba(20, 8, 35, 0.8);
    border: 1px solid rgba(91, 33, 182, 0.4);
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: var(--sp-purple-lt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-tracker-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid rgba(91, 33, 182, 0.25);
    text-decoration: none;
    color: var(--sp-text);
    border-radius: 8px;
    transition: background 0.2s, box-shadow 0.2s;
}

    .sp-tracker-item:last-child {
        border-bottom: none;
    }

    .sp-tracker-item:hover {
        background: rgba(126, 34, 206, 0.1);
        box-shadow: inset 0 0 20px rgba(126, 34, 206, 0.08);
    }

.sp-tracker-info {
    flex: 1;
    min-width: 0;
}

.sp-tracker-name {
    font-family: var(--sp-font-body);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e9d5ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .sp-tracker-name.is-mine {
        color: var(--sp-purple-lt);
    }

        .sp-tracker-name.is-mine::after {
            content: '';
            display: inline-block;
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            content: '\f044';
            margin-left: 0.35em;
            font-size: 0.75em;
            opacity: 0.7;
        }

.sp-tracker-stats {
    font-size: 0.75rem;
    color: var(--sp-text-dim);
    margin-top: 0.2rem;
    font-family: var(--sp-font-body);
}

    .sp-tracker-stats strong {
        color: var(--sp-purple-lt);
    }

.sp-progress-wrap {
    width: 80px;
    flex-shrink: 0;
    text-align: right;
}

.sp-progress-bar {
    height: 4px;
    background: rgba(91, 33, 182, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.sp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7e22ce, #c084fc);
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 0 6px rgba(192, 132, 252, 0.5);
}

.sp-progress-pct {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--sp-purple-lt);
    font-family: var(--sp-font-body);
}

.sp-empty-list {
    color: var(--sp-muted);
    font-size: 0.88rem;
    padding: 2.5rem 0;
    text-align: center;
    font-family: var(--sp-font-body);
}

.sp-stats-bar {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sp-stat-pill {
    background: rgba(35, 15, 60, 0.85);
    border: 1px solid rgba(91, 33, 182, 0.45);
    border-radius: 16px;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    font-family: var(--sp-font-body);
    font-weight: 600;
    color: var(--sp-text-dim);
    letter-spacing: 0.04em;
}

    .sp-stat-pill strong {
        color: var(--sp-purple-lt);
    }

    .sp-stat-pill .pct {
        color: var(--sp-muted);
        font-weight: 400;
        font-size: 0.8em;
        margin-left: 0.2rem;
    }

.sp-filter-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.sp-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

    .sp-search-box .fa-search {
        position: absolute;
        left: 0.85rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--sp-muted);
        font-size: 0.85rem;
        pointer-events: none;
    }

.sp-search-input {
    width: 100%;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
}

.sp-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--sp-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

    .sp-search-clear:hover {
        color: var(--sp-purple-lt);
        background: rgba(126, 34, 206, 0.15);
    }

@media (max-width: 700px) {
    .sp-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-search-box {
        width: 100%;
    }

    .sp-filter-select {
        width: 100%;
    }
}

.sp-view-only-banner {
    background: rgba(20, 8, 35, 0.8);
    border: 1px solid rgba(91, 33, 182, 0.4);
    border-left: 3px solid var(--sp-purple-md);
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-family: var(--sp-font-body);
    color: var(--sp-text-dim);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

    .sp-view-only-banner strong {
        color: var(--sp-purple-lt);
    }

.sp-tracker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sp-tracker-name-large {
    font-family: var(--sp-font-head);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #e9d5ff;
    text-shadow: 0 0 12px rgba(126, 34, 206, 0.5);
    letter-spacing: 1px;
    line-height: 1.1;
}

.sp-tracker-meta {
    font-size: 0.75rem;
    color: var(--sp-muted);
    margin-top: 0.2rem;
    font-family: var(--sp-font-body);
}

    .sp-tracker-meta span {
        color: var(--sp-purple-lt);
    }

.sp-tracker-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

#spriteRows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
    max-width: 100%;
}

@media (max-width: 900px) {
    #spriteRows {
        grid-template-columns: 1fr;
    }
}

.sp-type-row {
    background: var(--sp-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1rem;
    box-shadow: 0 0 20px var(--sp-glow);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

    .sp-type-row:hover {
        border-color: var(--sp-border-hi);
        box-shadow: 0 0 35px var(--sp-glow-hi);
    }

.sp-type-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(91, 33, 182, 0.3);
}

.sp-type-row-title {
    font-family: var(--sp-font-head);
    font-size: 0.95rem;
    color: var(--sp-purple-lt);
    text-shadow: 0 0 8px var(--sp-purple);
    letter-spacing: 1px;
    margin: 0;
}

.sp-type-row-count {
    font-size: 0.65rem;
    font-family: var(--sp-font-body);
    color: var(--sp-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.sp-variant-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

@media (max-width: 600px) {
    .sp-variant-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sp-variant-tile {
    background: rgba(20, 8, 35, 0.6);
    border: 1px solid rgba(91, 33, 182, 0.4);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

    .sp-variant-tile:hover {
        transform: translateY(-2px);
        border-color: rgba(168, 85, 247, 0.6);
        box-shadow: 0 4px 16px rgba(126, 34, 206, 0.3);
    }

    /* Unowned = dimmed */
    .sp-variant-tile.not-owned {
        opacity: 0.5;
        filter: grayscale(0.5);
    }

        .sp-variant-tile.not-owned:hover {
            opacity: 0.85;
            filter: grayscale(0.2);
        }

    /* Owned */
    .sp-variant-tile.is-owned {
        border-color: rgba(168, 85, 247, 0.5);
        box-shadow: 0 0 14px rgba(126, 34, 206, 0.25);
    }

    /* Mastered — gold glow */
    .sp-variant-tile.is-mastered {
        border-color: rgba(250, 204, 21, 0.6);
        box-shadow: 0 0 20px rgba(250, 204, 21, 0.25), 0 0 8px rgba(250, 204, 21, 0.2);
    }

.sp-tile-img-wrap {
    position: relative;
    aspect-ratio: 3/4;
    background: radial-gradient(circle at center, rgba(91, 33, 182, 0.15) 0%, rgba(11, 6, 19, 0.8) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sp-tile-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: relative;
        z-index: 1;
    }

/* Placeholder silhouette */
.sp-tile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
}

.sp-placeholder-silhouette {
    width: 52%;
    aspect-ratio: 1/1.6;
    background: rgba(91, 33, 182, 0.25);
    border: 1px solid rgba(91, 33, 182, 0.3);
    border-radius: 40% 40% 30% 30% / 30% 30% 50% 50%;
    position: relative;
    box-shadow: 0 0 12px rgba(91, 33, 182, 0.2);
}

    .sp-placeholder-silhouette::before {
        content: '';
        position: absolute;
        top: -30%;
        left: 50%;
        transform: translateX(-50%);
        width: 55%;
        aspect-ratio: 1;
        background: rgba(91, 33, 182, 0.25);
        border: 1px solid rgba(91, 33, 182, 0.3);
        border-radius: 50%;
    }

.sp-placeholder-name {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--sp-font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sp-muted);
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Badges */
.sp-mastered-badge {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    z-index: 10;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 6, 19, 0.9);
    border: 2px solid rgba(250, 204, 21, 0.8);
    border-radius: 50%;
    color: #fde047;
    font-size: 0.75rem;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.sp-owned-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 10;
    background: rgba(126, 34, 206, 0.9);
    border: 1px solid rgba(192, 132, 252, 0.8);
    color: #e9d5ff;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--sp-font-body);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(126, 34, 206, 0.5), 0 0 10px rgba(126, 34, 206, 0.3);
}

/* Tile name */
.sp-tile-name {
    font-family: var(--sp-font-body);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    padding: 0.5rem 0.4rem 0.35rem;
    color: #e9d5ff;
    line-height: 1.2;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 6, 19, 0.4);
}

.sp-tile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem 0.4rem 0.5rem;
    background: rgba(11, 6, 19, 0.3);
}

.sp-tile-toggle {
    width: 100%;
    background: rgba(20, 8, 35, 0.7);
    border: 1px solid rgba(91, 33, 182, 0.4);
    border-radius: 5px;
    color: var(--sp-muted);
    font-family: var(--sp-font-body);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

    .sp-tile-toggle:hover {
        border-color: var(--sp-purple-lt);
        color: var(--sp-purple-lt);
        background: rgba(126, 34, 206, 0.15);
        box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
    }

    .sp-tile-toggle.active {
        background: rgba(126, 34, 206, 0.25);
        border-color: var(--sp-purple-md);
        color: #e9d5ff;
        box-shadow: 0 0 12px rgba(168, 85, 247, 0.3), inset 0 0 8px rgba(168, 85, 247, 0.1);
    }

    .sp-tile-toggle.mastered-toggle.active {
        background: rgba(250, 204, 21, 0.2);
        border-color: rgba(250, 204, 21, 0.6);
        color: #fef08a;
        box-shadow: 0 0 12px rgba(250, 204, 21, 0.25), inset 0 0 8px rgba(250, 204, 21, 0.1);
    }

.sp-tile-status {
    display: flex;
    gap: 0.3rem;
    padding: 0.4rem 0.4rem 0.5rem;
    background: rgba(11, 6, 19, 0.3);
}

.sp-status-pip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--sp-font-body);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.25rem;
    border-radius: 4px;
    border: 1px solid rgba(91, 33, 182, 0.3);
    color: var(--sp-muted);
    background: rgba(20, 8, 35, 0.5);
}

.sp-pip-owned {
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--sp-purple-lt);
    background: rgba(168, 85, 247, 0.08);
}

.sp-pip-mastered {
    border-color: rgba(250, 204, 21, 0.4);
    color: #fde047;
    background: rgba(250, 204, 21, 0.06);
}

.sp-pip-off {
    opacity: 0.3;
}

.sp-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--sp-muted);
}

.sp-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.sp-empty-state h3 {
    font-family: var(--sp-font-head);
    font-size: 1rem;
    color: var(--sp-purple-md);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.sp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 6, 19, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

    .sp-modal-backdrop.hidden {
        display: none;
    }

.sp-modal {
    background: rgba(25, 10, 45, 0.98);
    border: 1px solid rgba(91, 33, 182, 0.6);
    border-radius: var(--sp-radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(126, 34, 206, 0.4);
}

.sp-modal-title {
    font-family: var(--sp-font-head);
    font-size: 1.1rem;
    color: var(--sp-purple-lt);
    text-shadow: 0 0 10px var(--sp-purple);
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.sp-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.sp-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .sp-toggle-row label {
        margin: 0;
        font-family: var(--sp-font-body);
        font-size: 0.88rem;
        color: var(--sp-text);
        text-transform: none;
        letter-spacing: 0;
    }

input[type="checkbox"].sp-check {
    width: 17px;
    height: 17px;
    accent-color: var(--sp-purple-md);
    cursor: pointer;
}

.sp-admin-type-block {
    background: var(--sp-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 0 20px var(--sp-glow);
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .sp-admin-type-block:hover {
        border-color: var(--sp-border-hi);
        box-shadow: 0 0 28px var(--sp-glow-hi);
    }

.sp-admin-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(20, 8, 35, 0.6);
    border-bottom: 1px solid rgba(91, 33, 182, 0.3);
}

.sp-admin-type-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sp-admin-variants-list {
    padding: 0.25rem 0;
}

.sp-no-variants {
    padding: 1rem 1.25rem;
    color: var(--sp-muted);
    font-size: 0.82rem;
    font-family: var(--sp-font-body);
    font-style: italic;
}

.sp-admin-variant-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid rgba(91, 33, 182, 0.15);
    transition: background 0.15s;
}

    .sp-admin-variant-row:last-child {
        border-bottom: none;
    }

    .sp-admin-variant-row:hover {
        background: rgba(91, 33, 182, 0.08);
    }

.sp-admin-variant-img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: rgba(20, 8, 35, 0.8);
    border: 1px solid rgba(91, 33, 182, 0.3);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sp-admin-variant-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.sp-admin-no-img {
    color: var(--sp-muted);
    font-size: 1.1rem;
    opacity: 0.5;
}

.sp-admin-variant-name {
    flex: 1;
    font-family: var(--sp-font-body);
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e9d5ff;
}

.sp-admin-variant-filename {
    font-size: 0.72rem;
    color: var(--sp-muted);
    font-family: 'Courier New', monospace;
}

.sp-admin-variant-actions {
    display: flex;
    gap: 0.4rem;
}

.sp-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.sp-compare-badge {
    position: absolute;
    bottom: 0.35rem;
    right: 0.35rem;
    z-index: 10;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    cursor: help;
    pointer-events: auto;
}

.sp-compare-ahead-badge {
    background: rgba(34, 197, 94, 0.9);
    border: 2px solid rgba(34, 197, 94, 1);
    color: #fff;
}

.sp-compare-behind-badge {
    background: rgba(239, 68, 68, 0.9);
    border: 2px solid rgba(239, 68, 68, 1);
    color: #fff;
}

.sp-variant-tile.sp-compare-ahead {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.sp-variant-tile.sp-compare-behind {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* Compare legend in banner */
.sp-compare-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--sp-text-dim);
    font-family: var(--sp-font-body);
}

.sp-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sp-legend-badge {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.6rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sp-legend-ahead {
    background: rgba(34, 197, 94, 0.9);
    border: 2px solid rgba(34, 197, 94, 1);
    color: #fff;
}

.sp-legend-behind {
    background: rgba(239, 68, 68, 0.9);
    border: 2px solid rgba(239, 68, 68, 1);
    color: #fff;
}

/* Compare help in modal */
.sp-compare-help {
    background: rgba(20, 8, 35, 0.6);
    border: 1px solid rgba(91, 33, 182, 0.3);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sp-compare-help-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.sp-compare-help-item > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sp-compare-help-item strong {
    color: var(--sp-purple-lt);
    font-family: var(--sp-font-body);
    font-size: 0.8rem;
    font-weight: 700;
}

.sp-compare-help-item span {
    color: var(--sp-text-dim);
    font-family: var(--sp-font-body);
    font-size: 0.75rem;
    line-height: 1.4;
}

background: rgba(25, 10, 45, 0.97);
    border-left: 3px solid var(--sp-purple-md);
    border: 1px solid rgba(91, 33, 182, 0.5);
    border-left-width: 3px;
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
    padding: 0.7rem 1.1rem;
    font-size: 0.85rem;
    font-family: var(--sp-font-body);
    font-weight: 600;
    color: var(--sp-text);
    box-shadow: 0 0 20px rgba(126, 34, 206, 0.3);
    animation: sp-toastIn .25s ease, sp-toastOut .3s ease 2.2s forwards;
    letter-spacing: 0.03em;
}

    .sp-toast.error {
        border-color: rgba(229, 57, 53, 0.6);
        border-left-color: #e53935;
    }

    .sp-toast.success {
        border-color: rgba(34, 197, 94, 0.4);
        border-left-color: #22c55e;
    }

@keyframes sp-toastIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes sp-toastOut {
    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

.sp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(91, 33, 182, 0.3);
    border-top-color: var(--sp-purple-lt);
    border-radius: 50%;
    animation: sp-spin .65s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}

@keyframes sp-spin {
    to {
        transform: rotate(360deg);
    }
}

.sp-loading {
    color: var(--sp-muted);
    font-size: 0.88rem;
    font-family: var(--sp-font-body);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

@media (max-width: 640px) {
    .sp-variant-tile {
        width: 130px;
    }

    .sp-tracker-actions {
        gap: 0.35rem;
    }

    .sp-admin-type-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.sp-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

    .sp-filter-bar .sp-stats-bar {
        margin-bottom: 0;
        flex: 1;
    }

.sp-filter-select {
    width: auto;
    min-width: 160px;
    flex-shrink: 0;
    background: rgba(20, 8, 35, 0.9);
    border: 1px solid rgba(91, 33, 182, 0.5);
    border-radius: 8px;
    color: var(--sp-purple-lt);
    font-family: var(--sp-font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a855f7' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .sp-filter-select:focus {
        outline: none;
        border-color: var(--sp-purple-lt);
        box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.15);
    }

    .sp-filter-select option {
        background: #1a0f2b;
        color: var(--sp-text);
    }

@media (max-width: 640px) {
    .sp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-filter-select {
        width: 100%;
    }
}