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

/* ============================================
   GLASSMORPHISM DARK THEME UI DESIGN
   ============================================ */

:root {
    /* Dark Theme Color Variables */
    --glass-bg-dark: rgba(0, 0, 0, 0.5);
    --glass-bg-medium: rgba(0, 0, 0, 0.3);
    --glass-bg-light: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
}

/* ============================================
   🍪 COOKIE BANNER
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    padding: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-banner-content h3 {
    color: var(--text-primary);
    font-size: 1.4em;
    margin: 0;
}

.cookie-banner-content p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.cookie-categories {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-category {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    flex: 1;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cookie-category-header strong {
    color: var(--text-primary);
    font-size: 1.1em;
}

.cookie-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: bold;
}

.cookie-badge.required {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.cookie-badge.optional {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.cookie-description {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.cookie-notice {
    background: rgba(102, 126, 234, 0.15);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95em;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-btn-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.cookie-btn-link:hover {
    color: white;
}

.cookie-btn-secondary {
    background: rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.cookie-btn-secondary:hover {
    background: #5a6268;
}

.cookie-btn-primary {
    background: #667eea;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.cookie-btn-primary:hover {
    background: #5a67d8;
}

/* ============================================
   AD-SENSE CONSENT MODAL
   ============================================ */

.cookie-consent-modal .modal-content {
    max-width: 500px;
}

.adsense-consent-info ul {
    list-style-position: inside;
    padding-left: 10px;
    margin: 15px 0;
    color: var(--text-secondary);
}

.adsense-consent-info li {
    margin-bottom: 10px;
}

.adsense-consent-notice a {
    color: #81c784;
    text-decoration: none;
}

.adsense-consent-notice a:hover {
    text-decoration: underline;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    min-height: 100vh;
    padding: 18px;
    font-size: 14px; /* Base font-size reduziert */
}

.container {
    max-width: 1260px; /* 90% von 1400px */
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 27px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

header {
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.header-title {
    flex: 1;
    text-align: center;
}

header h1 {
    color: #ffffff;
    font-size: 2.1em; /* 90% von 2.5em */
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em; /* 90% von 1.1em */
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* Feedback Button */
.feedback-section {
    display: flex;
    align-items: center;
}

.feedback-btn {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.feedback-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.lang-btn.active {
    background: rgba(102, 126, 234, 0.4);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.lang-separator {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
}

.controls {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 13px;
}

.upload-button {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
}

.upload-button:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.file-name {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.settings {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.setting-group input[type="number"],
.setting-group select {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    width: 150px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group input[type="number"]:focus,
.setting-group select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.setting-group input[type="number"] {
    width: 100px;
}

.primary-button {
    background: rgba(40, 167, 69, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(40, 167, 69, 0.4);
}

.primary-button:hover:not(:disabled) {
    background: rgba(40, 167, 69, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

.primary-button:disabled {
    background: rgba(128, 128, 128, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

.secondary-button {
    background: rgba(108, 117, 125, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(108, 117, 125, 0.3);
}

.secondary-button:hover {
    background: #5a6268;
}

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

.preview-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.preview-panel h3 {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
    font-size: 1.3em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.preview-box {
    /* Glassmorphic checkered pattern für Transparenz-Anzeige */
    background:
        rgba(255, 255, 255, 0.05),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-position: 0 0, 0 0, 0 10px, 10px -10px, -10px 0px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-box img {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    image-rendering: pixelated;
}

.placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.data-section {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.data-section h3 {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: rgba(102, 126, 234, 0.95);
}

.tab-button.active {
    color: rgba(102, 126, 234, 0.95);
    border-bottom-color: rgba(102, 126, 234, 0.95);
}

.tab-content {
    display: none;
}

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

.table-wrapper {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.code-block {
    background: rgba(45, 45, 45, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f8f8f2;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    max-height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

.loading-progress-container {
    width: 400px;
    max-width: 80vw;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    margin-top: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 13px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

.loading-progress-text {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    z-index: 2;
    pointer-events: none;
}

/* Modal Styles - Glassmorphism */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: rgba(45, 45, 45, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: rgba(102, 126, 234, 0.95);
}

.image-viewport {
    width: 80vw;
    max-width: 900px;
    height: 70vh;
    /* Checkered pattern für Transparenz-Anzeige */
    background:
        linear-gradient(45deg, #505050 25%, transparent 25%),
        linear-gradient(-45deg, #505050 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #505050 75%),
        linear-gradient(-45deg, transparent 75%, #505050 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #404040;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    margin: 20px 0;
}

.image-viewport:active {
    cursor: grabbing;
}

.image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: none;
}

#modalImage,
#confirmSpriteImage,
#confirmRemoveImage {
    max-width: none;
    max-height: none;
    image-rendering: pixelated;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
}

#modalInfo {
    margin-top: 20px;
    color: #fff;
    text-align: center;
    font-size: 16px;
}

tbody td:first-child img {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

tbody td:first-child img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Main Tab System - Glassmorphism */
.main-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-tab-button {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.main-tab-button:hover {
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.4);
}

.main-tab-button.active {
    background: rgba(102, 126, 234, 0.3);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.5);
}

.main-tab-content {
    display: none;
}

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

.tab-description {
    text-align: center;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* KI Extractor Layout */
.extractor-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Canvas Section */
.canvas-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.extractor-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Extractor Toolbar */
.extractor-toolbar {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.toolbar-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-section label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.mode-button {
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.mode-button:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.mode-button.active {
    background: rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.6);
    color: white;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

.mode-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#brushSize {
    cursor: pointer;
}

#brushSizeLabel {
    font-weight: 600;
    color: rgba(76, 175, 80, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-width: 40px;
}

.canvas-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.18);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.2);
}

.canvas-placeholder {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    pointer-events: none;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#extractorCanvas,
#maskCanvas,
#paintCanvas,
#removerCanvas,
#removerMaskCanvas,
#samExtractorCanvas,
#samExtractorMaskCanvas,
#samRemoverCanvas,
#samRemoverMaskCanvas {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

#maskCanvas,
#removerMaskCanvas,
#samExtractorMaskCanvas,
#samRemoverMaskCanvas {
    pointer-events: none;
    opacity: 0.6;
}

#paintCanvas {
    pointer-events: none;
    opacity: 0.5;
}

.extractor-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sprite Collection Section - Glassmorphism */
.collection-section {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

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

.collection-header h3 {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.collection-count {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sprite-collection {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 15px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    align-content: start;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.sprite-item {
    position: relative;
    /* Glassmorphic checkered pattern */
    background:
        rgba(255, 255, 255, 0.1),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 16px 16px, 16px 16px, 16px 16px, 16px 16px;
    background-position: 0 0, 0 0, 0 8px, 8px -8px, -8px 0px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.2);
}

.sprite-item:hover {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-4px);
    background: rgba(0, 0, 0, 0.35);
}

.sprite-item img {
    max-width: 100%;
    max-height: 80px;
    image-rendering: pixelated;
    object-fit: contain;
}

.sprite-item-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    word-break: break-all;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.sprite-item-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(220, 53, 69, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

.sprite-item-delete:hover {
    background: rgba(200, 35, 51, 0.9);
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.6);
}

.collection-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.collection-controls button {
    flex: 1;
}

.collection-settings {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.2);
}

.collection-settings h4 {
    margin: 0 0 10px 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Sheet Preview */
#extractorSheetPreview {
    margin-top: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

#extractorSheetPreview h4 {
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sheet-preview-container {
    max-height: 400px;
    overflow: auto;
    background:
        rgba(255, 255, 255, 0.05),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-position: 0 0, 0 0, 0 10px, 10px -10px, -10px 0px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sheet-preview-container img {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Kein background - Transparenz wird durch checkered pattern des Containers sichtbar */
}

.sheet-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.sheet-controls button {
    flex: 1;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.modal-buttons button {
    min-width: 120px;
}

/* Removed - now handled by .image-viewport and img selectors above */

/* Sicherstellen dass Buttons immer sichtbar bleiben */
.modal-content h3 {
    color: white;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
    flex-shrink: 0;
}

.modal-buttons {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: #2d2d2d;
    padding-top: 10px;
    width: 100%;
}

@media (max-width: 768px) {
    .preview-section {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .modal-content {
        padding: 15px;
    }

    #modalImage {
        max-height: 60vh;
    }

    .extractor-layout {
        grid-template-columns: 1fr;
    }

    .sprite-collection {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .main-tab-button {
        padding: 12px 20px;
        font-size: 16px;
    }
}


.extractor-subtab-button {
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.extractor-subtab-button:hover {
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.3);
}

.extractor-subtab-button.active {
    background: rgba(102, 126, 234, 0.3);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.5);
}

.extractor-subtab-content {
    display: none;
}

.extractor-subtab-content.active {
    display: block;
}


.remover-canvas-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.remover-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.remover-info-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 12px;
    height: fit-content;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.remover-info-panel h3 {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.remover-info-panel ol {
    margin-left: 20px;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.remover-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 1024px) {
    .remover-layout {
        grid-template-columns: 1fr;
    }
}


.sam-params label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: help;
    position: relative;
}

.sam-params input[type="range"] {
    width: 100px;
    cursor: pointer;
}

.sam-params span {
    font-weight: bold;
    color: rgba(102, 126, 234, 0.95);
    min-width: 35px;
    text-align: center;
}

/* Tooltip für SAM Parameter */
.sam-tooltip {
    position: fixed;
    background: #2d2d2d;
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    width: 320px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    display: none;
    font-weight: normal;
    margin-top: -10px;
}

.sam-tooltip.show {
    display: block;
}

.sam-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    border: 8px solid transparent;
    border-top-color: #2d2d2d;
}

.sam-tooltip h4 {
    color: rgba(102, 126, 234, 0.95);
    margin: 0 0 8px 0;
    font-size: 13px;
}

.sam-tooltip p {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.9);
}

.sam-tooltip strong {
    color: #4CAF50;
}

.sam-tooltip code {
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    color: rgba(125, 211, 252, 0.95);
    font-family: 'Courier New', monospace;
}

.grabcut-params .param-label:hover {
    color: rgba(102, 126, 234, 0.95);
}

.grabcut-params .value-input {
    width: 60px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: bold;
    font-size: 0.95em;
    text-align: center;
    transition: all 0.3s ease;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(31, 38, 135, 0.2);
}

.grabcut-params .value-input:hover {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.grabcut-params .value-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Remove spinner arrows from number inputs */
.grabcut-params .value-input::-webkit-inner-spin-button,
.grabcut-params .value-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.grabcut-params .value-input {
    -moz-appearance: textfield;
}

.toolbar-section input[type="range"] {
    flex: 1;
    margin: 0 10px;
}


.batch-upload-section {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.batch-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.batch-upload-header h3 {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.batch-file-list {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-file-list .placeholder {
    text-align: center;
    color: #a0aec0;
    margin: 40px 0;
}

.batch-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.batch-file-item:hover {
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.batch-file-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    background:
        rgba(255, 255, 255, 0.05),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
    background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.batch-file-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.batch-file-item-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.batch-file-item-size {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.batch-file-item-delete {
    padding: 5px 10px;
    background: rgba(220, 53, 69, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: rgba(255, 100, 100, 0.95);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.batch-file-item-delete:hover {
    background: rgba(220, 53, 69, 0.6);
    border-color: rgba(220, 53, 69, 0.8);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    transform: scale(1.05);
}

.batch-settings {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.batch-results {
    margin-top: 20px;
}

.batch-results h3 {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#batchResultsContainer {
    display: grid;
    gap: 30px;
}

.batch-sheet-result {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.batch-sheet-result h4 {
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-sheet-preview {
    position: relative;
    height: 150px;
    overflow: hidden;
    background:
        rgba(0, 0, 0, 0.3),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-position: 0 0, 0 0, 0 10px, 10px -10px, -10px 0px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.batch-sheet-preview:hover {
    border: 2px solid rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
    transform: scale(1.02);
}

.batch-sheet-preview img {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    object-fit: contain;
}

.batch-sheet-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.batch-sheet-controls button {
    flex: 1;
}

.batch-collapsible-section {
    margin-top: 15px;
}

.batch-section-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-section-toggle:hover {
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.batch-section-content {
    margin-top: 10px;
}

.batch-coordinates-table {
    overflow-x: auto;
}

.batch-coordinates-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.batch-coordinates-table th,
.batch-coordinates-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-coordinates-table th {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.batch-coordinates-table td {
    color: rgba(255, 255, 255, 0.85);
}

.sprite-preview-cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        rgba(255, 255, 255, 0.05),
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 100%, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
    background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
    transition: all 0.3s ease;
}

.sprite-preview-cell img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.sprite-name-input {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.sprite-name-input:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.25);
}

.sprite-name-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.batch-code-section {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.batch-code-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.batch-code-tab {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.15);
}

.batch-code-tab:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.batch-code-tab.active {
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.5);
}

.batch-code-content {
    display: none;
}

.batch-code-content.active {
    display: block;
}

.batch-code-content pre {
    background: rgba(45, 55, 72, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(226, 232, 240, 0.95);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

/* ============================================
   FOOTER
   ============================================ */

.page-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

.footer-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
}

.footer-copyright {
    text-align: right;
}
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.3);
    margin: 0;
}

.batch-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.batch-code-header button {
    padding: 5px 12px;
    font-size: 12px;
}


*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    margin: 2px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

*::-webkit-scrollbar-thumb:active {
    background: rgba(102, 126, 234, 0.8);
}

*::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.4) rgba(0, 0, 0, 0.2);
}


/* Mobile (Landscape) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    .main-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .main-tab-button {
        width: 100%;
        text-align: center;
    }

    .sub-tabs {
        flex-direction: column;
        gap: 6px;
    }

    .sub-tab-button {
        width: 100%;
    }

    .controls,
    .collection-controls,
    .sheet-controls {
        flex-direction: column;
    }

    .controls button,
    .collection-controls button {
        width: 100%;
    }

    .sprite-collection {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .batch-coordinates-table {
        font-size: 12px;
    }

    .mode-buttons {
        flex-wrap: wrap;
    }

    .mode-button {
        flex: 1 1 45%;
    }
}

/* Mobile (Portrait) */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 10px;
        border-radius: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .feedback-btn {
        width: 100%;
        text-align: center;
        font-size: 0.9em;
        padding: 8px 16px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.1em;
    }

    .main-tab-button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .sub-tab-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .primary-button,
    .secondary-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .sprite-collection {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .sprite-item {
        padding: 6px;
    }

    .sprite-item img {
        max-height: 60px;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    .canvas-container {
        min-height: 300px;
    }

    .batch-coordinates-table {
        font-size: 11px;
    }

    .batch-coordinates-table th,
    .batch-coordinates-table td {
        padding: 6px;
    }

    *::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
}


.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
.footer-links a:hover {
    color: #667eea;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
}

.footer-copyright {
    text-align: center;
}

@media (max-width: 480px) {
    .page-footer {
        margin-top: 30px;
        padding-top: 20px;
    }

    .footer-content {
        font-size: 0.85em;
    }
}


@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.cookie-category {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cookie-icon {
    font-size: 1.3em;
}

.cookie-category-header strong {
    flex: 1;
    color: #ffffff;
}

.cookie-badge {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-badge.required {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.cookie-badge.optional {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.cookie-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    margin-left: 35px;
    margin-bottom: 0;
}

.cookie-notice {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-btn-primary {
    background: rgba(102, 126, 234, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cookie-btn-primary:hover {
    background: rgba(102, 126, 234, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1em;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.cookie-btn-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.cookie-btn-link:hover {
    color: #667eea;
}

/* AdSense Consent Modal */
.cookie-consent-modal {
    z-index: 10001;
}

.cookie-consent-modal .modal-content {
    max-width: 500px;
}

.adsense-consent-info {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.adsense-consent-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.adsense-consent-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.adsense-consent-info li {
    color: rgba(255, 255, 255, 0.8);
    padding: 5px 0;
    font-size: 0.95em;
}

.adsense-consent-notice {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    margin: 15px 0;
}

.adsense-consent-notice a {
    color: #667eea;
    text-decoration: none;
}

.adsense-consent-notice a:hover {
    text-decoration: underline;
}

/* ============================================
   🌍 LANGUAGE SWITCHER - WEBSITE MATCHING DESIGN
   ============================================ */
.language-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.lang-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    font-weight: 600;
}

.lang-separator {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
    font-weight: 300;
}

/* Header Layout */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.header-title {
    flex: 1;
    text-align: center;
}

.gem-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile: Bessere Anordnung */
@media (max-width: 768px) {
    .language-switcher {
        order: -1;
        margin-right: auto;
    }
    
    .header-content {
        justify-content: flex-start;
    }
    
    .gem-display {
        margin-left: auto;
    }
}

/* Fixed Position für Subpages */
.back-to-home-btn + .language-switcher,
[style*="position: fixed"] .language-switcher {
    background: rgba(255, 255, 255, 0.08);
}
    .header-content {
        justify-content: flex-start;
    }
    
    .gem-display {
        margin-left: auto;
    }
}

/* ============================================
   🏠 BACK TO HOME BUTTON
   ============================================ */
.back-to-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-to-home-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.back-to-home-btn svg {
    width: 24px;
    height: 24px;
}
