@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Essential body styles for this page - not modifying genesis-header defaults */
body {
    background: #0a0e27;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

    /* Classic tunnel effect - concentric circles moving outward */
    body::before {
        content: '';
        position: fixed;
        top: 50%;
        left: 50%;
        width: 300vmax;
        height: 300vmax;
        transform: translate(-50%, -50%);
        background: radial-gradient(circle at center, transparent 0%, transparent 2.5%, rgba(138, 43, 226, 0.08) 2.5%, rgba(138, 43, 226, 0.08) 3.5%, transparent 3.5%, transparent 6.5%, rgba(0, 191, 255, 0.08) 6.5%, rgba(0, 191, 255, 0.08) 7.5%, transparent 7.5%, transparent 10.5%, rgba(255, 0, 255, 0.08) 10.5%, rgba(255, 0, 255, 0.08) 11.5%, transparent 11.5%, transparent 14.5%, rgba(0, 255, 191, 0.08) 14.5%, rgba(0, 255, 191, 0.08) 15.5%, transparent 15.5%, transparent 18.5%, rgba(138, 43, 226, 0.08) 18.5%, rgba(138, 43, 226, 0.08) 19.5%, transparent 19.5%, transparent 22.5%, rgba(0, 191, 255, 0.08) 22.5%, rgba(0, 191, 255, 0.08) 23.5%, transparent 23.5%, transparent 26.5%, rgba(255, 0, 255, 0.08) 26.5%, rgba(255, 0, 255, 0.08) 27.5%, transparent 27.5%, transparent 30.5%, rgba(0, 255, 191, 0.08) 30.5%, rgba(0, 255, 191, 0.08) 31.5%, transparent 31.5%, transparent 34.5%, rgba(138, 43, 226, 0.08) 34.5%, rgba(138, 43, 226, 0.08) 35.5%, transparent 35.5%, transparent 38.5%, rgba(0, 191, 255, 0.08) 38.5%, rgba(0, 191, 255, 0.08) 39.5%, transparent 39.5%, transparent 42.5%, rgba(255, 0, 255, 0.08) 42.5%, rgba(255, 0, 255, 0.08) 43.5%, transparent 43.5%, transparent 46.5%, rgba(0, 255, 191, 0.08) 46.5%, rgba(0, 255, 191, 0.08) 47.5%, transparent 47.5% );
        background-size: 100% 100%;
        z-index: -2;
        animation: tunnelPulse 6s ease-in-out infinite;
        opacity: 0.3;
        pointer-events: none;
    }

@keyframes tunnelPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Secondary tunnel layer for depth */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 300vmax;
    height: 300vmax;
    transform: translate(-50%, -50%) rotate(45deg);
    background: radial-gradient(circle at center, transparent 0%, transparent 4.5%, rgba(138, 43, 226, 0.06) 4.5%, rgba(138, 43, 226, 0.06) 5.5%, transparent 5.5%, transparent 8.5%, rgba(0, 191, 255, 0.06) 8.5%, rgba(0, 191, 255, 0.06) 9.5%, transparent 9.5%, transparent 12.5%, rgba(255, 0, 255, 0.06) 12.5%, rgba(255, 0, 255, 0.06) 13.5%, transparent 13.5%, transparent 16.5%, rgba(0, 255, 191, 0.06) 16.5%, rgba(0, 255, 191, 0.06) 17.5%, transparent 17.5%, transparent 20.5%, rgba(138, 43, 226, 0.06) 20.5%, rgba(138, 43, 226, 0.06) 21.5%, transparent 21.5%, transparent 24.5%, rgba(0, 191, 255, 0.06) 24.5%, rgba(0, 191, 255, 0.06) 25.5%, transparent 25.5%, transparent 28.5%, rgba(255, 0, 255, 0.06) 28.5%, rgba(255, 0, 255, 0.06) 29.5%, transparent 29.5%, transparent 32.5%, rgba(0, 255, 191, 0.06) 32.5%, rgba(0, 255, 191, 0.06) 33.5%, transparent 33.5%, transparent 36.5%, rgba(138, 43, 226, 0.06) 36.5%, rgba(138, 43, 226, 0.06) 37.5%, transparent 37.5%, transparent 40.5%, rgba(0, 191, 255, 0.06) 40.5%, rgba(0, 191, 255, 0.06) 41.5%, transparent 41.5%, transparent 44.5%, rgba(255, 0, 255, 0.06) 44.5%, rgba(255, 0, 255, 0.06) 45.5%, transparent 45.5% );
    background-size: 100% 100%;
    z-index: -1;
    animation: tunnelPulseReverse 8s ease-in-out infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes tunnelPulseReverse {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
    }

    50% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0.8);
    }
}

/* Scanline effect overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient( 0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.05) 2px, rgba(0, 0, 0, 0.05) 4px );
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

/* Animated corner accents */
.corner-accent {
    position: fixed;
    width: 100px;
    height: 100px;
    border-style: solid;
    border-color: transparent;
    z-index: 0;
    pointer-events: none;
    animation: cornerPulse 3s ease-in-out infinite;
}

    .corner-accent.top-left {
        top: 20px;
        left: 20px;
        border-width: 3px 0 0 3px;
        border-color: rgba(138, 43, 226, 0.5) transparent transparent rgba(138, 43, 226, 0.5);
    }

    .corner-accent.top-right {
        top: 20px;
        right: 20px;
        border-width: 3px 3px 0 0;
        border-color: rgba(0, 191, 255, 0.5) rgba(0, 191, 255, 0.5) transparent transparent;
        animation-delay: 0.5s;
    }

    .corner-accent.bottom-left {
        bottom: 20px;
        left: 20px;
        border-width: 0 0 3px 3px;
        border-color: transparent transparent rgba(255, 0, 255, 0.5) rgba(255, 0, 255, 0.5);
        animation-delay: 1s;
    }

    .corner-accent.bottom-right {
        bottom: 20px;
        right: 20px;
        border-width: 0 3px 3px 0;
        border-color: transparent rgba(0, 255, 191, 0.5) rgba(0, 255, 191, 0.5) transparent;
        animation-delay: 1.5s;
    }

@keyframes cornerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

    .loading-overlay.active {
        display: flex;
    }

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

    .loading-spinner::before,
    .loading-spinner::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 4px solid transparent;
        border-top-color: #8a2be2;
        border-radius: 50%;
        animation: spinnerRotate 1.5s linear infinite;
    }

    .loading-spinner::after {
        border-top-color: #00bfff;
        animation-duration: 2s;
        animation-direction: reverse;
    }

@keyframes spinnerRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #fff;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.loading-subtext {
    color: #8ab3ff;
    font-size: 0.95em;
    opacity: 0.8;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Mobile adjustments to keep logo and content visible */
@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
        letter-spacing: 1px;
        padding: 0 15px;
        word-wrap: break-word;
    }

    .container {
        padding: 30px 15px;
    }
}

h1 {
    font-family: 'Press Start 2P', monospace;
    color: #fff;
    margin-bottom: 10px;
    text-align: center;
    font-size: clamp(1.4rem, 5vw, 2.5em); /* Responsive size to keep + visible on mobile */
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5), 0 0 20px rgba(138, 43, 226, 0.3), 0 0 30px rgba(138, 43, 226, 0.2);
    letter-spacing: 2px;
    padding: 0 10px; /* Prevent edge clipping */
}

.subtitle {
    text-align: center;
    color: #8ab3ff;
    font-size: 1.1em;
    margin-bottom: 40px;
    font-weight: 300;
}

    .subtitle a {
        color: #a78bfa;
        text-decoration: none;
        border-bottom: 2px solid rgba(167, 139, 250, 0.3);
        transition: all 0.3s;
        font-weight: 500;
    }

        .subtitle a:hover {
            color: #fff;
            border-bottom-color: #a78bfa;
        }

.upload-zone {
    border: 3px dashed rgba(138, 43, 226, 0.5);
    background: rgba(138, 43, 226, 0.05);
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 40px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

    .upload-zone:hover {
        background: rgba(138, 43, 226, 0.15);
        border-color: #8a2be2;
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
    }

    .upload-zone.dragover {
        background: rgba(138, 43, 226, 0.25);
        border-color: #a78bfa;
        transform: scale(1.02);
    }

    .upload-zone p {
        font-size: 1.2em;
        color: #e0e0e0;
        margin-bottom: 10px;
    }

        .upload-zone p:last-child {
            font-size: 0.9em;
            color: #8ab3ff;
            opacity: 0.8;
        }

input[type="file"] {
    display: none;
}

.status {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding: 18px 24px;
    margin-bottom: 30px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 1.05em;
}

    .status.error {
        background: rgba(239, 68, 68, 0.15);
        border-left-color: #ef4444;
        color: #fca5a5;
    }

    .status.warning {
        background: rgba(251, 191, 36, 0.15);
        border-left-color: #fbbf24;
        color: #fcd34d;
    }

    .status.success {
        background: rgba(16, 185, 129, 0.1);
        border-left-color: #10b981;
        color: #6ee7b7;
    }

.results {
    display: none;
    margin-top: 40px;
}

    .results.visible {
        display: block;
        animation: fadeIn 0.5s ease-in;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-outputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.output-panel {
    background: rgba(95, 179, 255, 0.05);
    padding: 15px;
    border: 1px solid #5fb3ff;
}

    .output-panel h3 {
        color: #fff;
        margin-bottom: 10px;
    }

    .output-panel canvas {
        width: 100%;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        border: 1px solid #5fb3ff;
        background: #000;
    }

.download-btn {
    background: #5fb3ff;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s;
}

    .download-btn:hover {
        background: #fff;
        transform: translateY(-2px);
    }

.sprite-info {
    background: rgba(95, 179, 255, 0.05);
    padding: 15px;
    border: 1px solid #5fb3ff;
    margin-bottom: 20px;
}

    .sprite-info h3 {
        color: #fff;
        margin-bottom: 10px;
    }

    .sprite-info pre {
        background: #000;
        padding: 10px;
        overflow-x: auto;
        color: #50fa7b;
    }

.color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    margin-right: 10px;
    vertical-align: middle;
}

.prg-config {
    background: rgba(26, 26, 46, 0.8);
    padding: 30px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    margin-bottom: 30px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

    .prg-config h3 {
        color: #fff;
        font-size: 1.8em;
        margin-bottom: 25px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .prg-config h3::before {
            content: '⚙️';
            font-size: 0.9em;
        }

/* Color configuration section */
.color-config-section {
    margin: 30px 0;
    padding: 25px;
    background: rgba(138, 43, 226, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.color-config-title {
    font-size: 1.2em;
    color: #a78bfa;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .color-config-title::before {
        content: '🎨';
    }

.color-pickers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.color-picker-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(138, 43, 226, 0.3);
    transition: all 0.3s;
    position: relative;
}

    .color-picker-card:hover {
        border-color: #8a2be2;
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(138, 43, 226, 0.3);
    }

.color-picker-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.color-picker-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
}

.color-picker-card:hover .color-picker-swatch {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.color-picker-label {
    flex: 1;
}

    .color-picker-label .label-main {
        display: block;
        font-weight: 600;
        color: #fff;
        font-size: 1.1em;
        margin-bottom: 4px;
    }

    .color-picker-label .label-desc {
        display: block;
        font-size: 0.85em;
        color: #8ab3ff;
        opacity: 0.8;
    }

.color-picker-card select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid rgba(138, 43, 226, 0.5);
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

    .color-picker-card select:hover {
        border-color: #8a2be2;
        background: rgba(0, 0, 0, 0.7);
    }

    .color-picker-card select:focus {
        outline: none;
        border-color: #a78bfa;
        box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
    }

    .color-picker-card select option {
        background: #1a1a2e;
        padding: 8px;
    }

/* Badge to show what this color is used for */
.color-usage-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    font-size: 0.75em;
    color: #c4b5fd;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

details summary {
    padding: 16px 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #60a5fa;
    transition: all 0.3s;
}

    details summary:hover {
        background: rgba(59, 130, 246, 0.2);
        border-color: #3b82f6;
    }

details[open] summary {
    margin-bottom: 20px;
    border-radius: 8px 8px 0 0;
}

.preview-panel {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    margin-bottom: 30px;
    border-radius: 12px;
    text-align: center;
}

    .preview-panel h3 {
        color: #fff;
        margin-bottom: 15px;
        font-size: 1.2em;
    }

    .preview-panel canvas {
        max-width: 100%;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        border: 2px solid rgba(138, 43, 226, 0.4);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

.download-btn {
    background: linear-gradient(135deg, #8a2be2 0%, #6366f1 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    margin-top: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

    .download-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
        background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    }

    .download-btn:active {
        transform: translateY(0);
    }

    .download-btn.primary {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        font-size: 1.15em;
        padding: 18px 40px;
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }

        .download-btn.primary:hover {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            box-shadow: 0 8px 28px rgba(16, 185, 129, 0.6);
        }

/* Compression checkbox styling */
.compression-option {
    margin-top: 20px;
    padding: 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
}

    .compression-option label {
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        color: #e0e0e0;
        font-weight: 500;
    }

    .compression-option input[type="checkbox"] {
        width: 22px;
        height: 22px;
        cursor: pointer;
        accent-color: #8a2be2;
    }

/* Image outputs grid */
.image-outputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.output-panel {
    background: rgba(26, 26, 46, 0.6);
    padding: 20px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

    .output-panel h3 {
        color: #fff;
        margin-bottom: 15px;
        font-size: 1.1em;
    }

    .output-panel canvas {
        width: 100%;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        border: 1px solid rgba(138, 43, 226, 0.4);
        background: #000;
        border-radius: 6px;
    }

.sprite-info {
    background: rgba(26, 26, 46, 0.6);
    padding: 20px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    margin-bottom: 24px;
    border-radius: 12px;
}

    .sprite-info h3 {
        color: #fff;
        margin-bottom: 15px;
        font-size: 1.1em;
    }

    .sprite-info pre {
        background: #000;
        padding: 16px;
        overflow-x: auto;
        color: #10b981;
        border-radius: 6px;
        font-size: 0.9em;
    }

.color-swatch {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    margin-right: 12px;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Fjalldata link style */
a[href*="fjalldata"]:hover {
    color: #fff !important;
    border-bottom-color: #fff !important;
}

/* Sprite Editor Styles */
#spriteEditorSection {
    margin-top: 30px;
}

.control-panel {
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    margin-bottom: 15px;
}

.panel-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.sprite-select-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sprite-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 6px;
    padding: 6px;
    transition: all 0.2s;
}

    .sprite-select-item.active {
        background: rgba(0, 255, 0, 0.15);
        border-color: #00ff00;
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    }

    .sprite-select-item.unused {
        opacity: 0.5;
    }

    .sprite-select-item:hover {
        border-color: rgba(0, 255, 0, 0.6);
        background: rgba(0, 255, 0, 0.1);
    }

.sprite-main-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.sprite-number-badge {
    background: rgba(0, 255, 0, 0.3);
    color: #00ff00;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1em;
    min-width: 40px;
    text-align: center;
}

.sprite-corner-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.2s;
}

    .sprite-corner-btn.add {
        color: rgba(0, 255, 0, 0.8);
    }

        .sprite-corner-btn.add:hover {
            background: rgba(0, 255, 0, 0.2);
            color: #00ff00;
        }

    .sprite-corner-btn.remove {
        color: rgba(255, 100, 100, 0.8);
    }

        .sprite-corner-btn.remove:hover {
            background: rgba(220, 38, 38, 0.3);
            color: #ff6666;
        }

.sprite-coords-display {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    font-size: 0.85em;
}

    .sprite-coords-display.unused {
        justify-content: center;
    }

    .sprite-coords-display label {
        display: flex;
        align-items: center;
        gap: 4px;
        color: #8ab3ff;
        font-weight: 500;
    }

.coord-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #00ff00;
    padding: 4px 6px;
    border-radius: 3px;
    width: 50px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

    .coord-input::-webkit-outer-spin-button,
    .coord-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .coord-input[type=number] {
        -moz-appearance: textfield;
    }

    .coord-input:focus {
        outline: none;
        border-color: #00ff00;
        background: rgba(0, 255, 0, 0.1);
    }

.sprite-unused-text {
    color: rgba(138, 43, 226, 0.6);
    font-size: 0.9em;
    font-style: italic;
}

.sprite-select-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(138, 43, 226, 0.3);
    color: #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

    .sprite-select-btn.active {
        background: rgba(0, 255, 0, 0.15);
        border-color: #00ff00;
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    }

    .sprite-select-btn.used {
        opacity: 1;
    }

    .sprite-select-btn.unused {
        opacity: 0.5;
        font-style: italic;
    }

    .sprite-select-btn:hover {
        border-color: rgba(0, 255, 0, 0.6);
        background: rgba(0, 255, 0, 0.1);
    }

.sprite-btn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sprite-btn-top {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sprite-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.sprite-action-btn {
    background: rgba(138, 43, 226, 0.4);
    border: 1px solid rgba(138, 43, 226, 0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

    .sprite-action-btn:hover {
        background: rgba(138, 43, 226, 0.6);
        border-color: #8a2be2;
    }

    .sprite-action-btn.remove {
        background: rgba(220, 38, 38, 0.4);
        border-color: rgba(220, 38, 38, 0.6);
        padding: 2px 6px;
    }

        .sprite-action-btn.remove:hover {
            background: rgba(220, 38, 38, 0.6);
        }

.sprite-position {
    color: #8ab3ff;
    font-size: 0.85em;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.move-grid {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    gap: 4px;
    justify-content: center;
}

.move-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: #8ab3ff;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    user-select: none;
}

    .move-btn:hover {
        background: rgba(138, 43, 226, 0.3);
        border-color: #8a2be2;
    }

    .move-btn:active {
        background: rgba(138, 43, 226, 0.5);
        transform: scale(0.95);
    }

#spriteEditCanvas {
    border: 2px solid rgba(138, 43, 226, 0.4);
}

#spriteOverlayContainer {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
}

.sprite-overlay {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: border-color 0.2s;
}

    .sprite-overlay.selected {
        animation: spriteBorderPulse 1s ease-in-out infinite;
    }

@keyframes spriteBorderPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 1);
    }

    50% {
        border-color: rgba(255, 255, 255, 0.3);
    }
}

.sprite-overlay-number {
    position: absolute;
    color: #ffffff;
    font-size: 6px;
    font-family: sans-serif;
    line-height: 1;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
