/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    min-height: 100vh;
    color: #e2e8f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(45, 45, 94, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 8px;
}

header p {
    font-size: 1rem;
    color: #a0aec0;
    margin-bottom: 0;
}

/* Workspace Layout */
.workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 30px;
}

/* Zeichenfläche */
.drawing-area {
    background: rgba(45, 45, 94, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.canvas-controls h2 {
    color: #ffffff;
    font-size: 1.5rem;
    margin: 0;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.canvas-actions {
    margin-top: 15px;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 420px; /* Mindesthöhe für 8x8, maximal 660px für 64x64 */
    transition: all 0.5s ease; /* Sanfte Animation bei Größenänderung */
}

#pixel-canvas {
    border: 3px solid #4a5568;
    border-radius: 8px;
    cursor: crosshair;
    background: #1a1a2e;
    transition: all 0.5s ease; /* Sanfte Animation bei Größenänderung */
}

.bit-overlay {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    display: grid;
    border-radius: 5px;
    transition: all 0.5s ease; /* Sanfte Animation bei Größenänderung */
}

.bit-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 12px;
    color: #ffffff;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.canvas-info {
    text-align: center;
    color: #a0aec0;
}

.canvas-info p {
    margin: 5px 0;
}

/* Farbpalette mit integriertem Radiergummi */
.color-palette {
    background: rgba(45, 45, 94, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-palette h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Werkzeug-Sektion */
.tool-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4a5568;
}

.tool-section .btn-eraser {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Farben-Sektion */
.colors-section h3 {
    color: #e2e8f0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 6px;
    margin-bottom: 20px;
    max-height: calc(100vh - 500px); /* Dynamische Höhe basierend auf Viewport */
    min-height: 250px; /* Mindesthöhe für bessere Nutzung */
    overflow-y: auto;
    padding: 5px;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 70px;
}

.color-option:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.color-option.active {
    background: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    margin-bottom: 4px;
}

.color-option span {
    font-size: 9px;
    color: #a0aec0;
    text-align: center;
    line-height: 1.1;
}

.palette-info {
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 14px;
}

/* Buttons */
.btn-toggle, .btn-action, .btn-expand, .btn-unlock, .btn-primary, .btn-secondary, .btn-eraser, .btn-expand-prominent, .btn-submit {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-toggle {
    background: #4c51bf;
    color: white;
}

.btn-toggle:hover {
    background: #434190;
}

.btn-action {
    background: #e53e3e;
    color: white;
}

.btn-action:hover {
    background: #c53030;
}

.btn-expand {
    background: #38a169;
    color: white;
}

.btn-expand:hover {
    background: #2f855a;
}

.btn-expand-prominent {
    background: linear-gradient(45deg, #38a169, #48bb78);
    color: white;
    font-size: 16px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.btn-expand-prominent:hover {
    background: linear-gradient(45deg, #2f855a, #38a169);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56, 161, 105, 0.4);
}

.btn-expand-prominent.highlight {
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(56, 161, 105, 0.6);
}

.btn-expand-prominent:disabled {
    background: linear-gradient(45deg, #a0aec0, #cbd5e0);
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-expand-prominent:disabled:hover {
    background: linear-gradient(45deg, #a0aec0, #cbd5e0);
    transform: none;
    box-shadow: none;
}

.btn-submit {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-size: 16px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    background: linear-gradient(45deg, #5a67d8, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-eraser {
    background: #a0aec0;
    color: white;
}

.btn-eraser:hover {
    background: #718096;
}

.btn-eraser.active {
    background: #e53e3e;
    color: white;
}

.btn-unlock {
    width: 100%;
    background: linear-gradient(45deg, #ed8936, #f6ad55);
    color: white;
    padding: 12px;
    font-size: 16px;
}

.btn-unlock:hover {
    background: linear-gradient(45deg, #dd6b20, #ed8936);
    transform: translateY(-2px);
}

.btn-primary {
    background: #4c51bf;
    color: white;
}

.btn-primary:hover {
    background: #434190;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
}

/* Missionen */
.missions {
    background: rgba(45, 45, 94, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.missions h2 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.mission-card {
    background: rgba(26, 26, 46, 0.9);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #63b3ed;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Timer-Balken am oberen Rand der Missionsbox */
.mission-timer {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #00b894, #fdcb6e, #e17055);
    width: 100%;
    border-radius: 10px 10px 0 0;
    transition: width 0.5s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mission-timer.warning {
    background: linear-gradient(90deg, #e17055, #d63031);
    animation: pulse-timer 1s ease-in-out infinite alternate;
}

@keyframes pulse-timer {
    from { box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
    to { box-shadow: 0 2px 8px rgba(225, 112, 85, 0.4); }
}

.mission-card h3 {
    color: #ffffff;
    margin-bottom: 10px;
}

.mission-card p {
    color: #a0aec0;
    line-height: 1.5;
}

.mission-actions {
    text-align: center;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(45, 45, 94, 0.98);
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-content.success {
    border: 3px solid #38a169;
}

.modal-content.timer {
    border: 3px solid #f39c12;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
}

.modal-content.error {
    border: 3px solid #e53e3e;
}

.modal-header {
    background: rgba(45, 45, 94, 0.9);
    color: #ffffff;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.mascot {
    width: 120px; /* Ursprüngliche Kreisgröße */
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: contain; /* Behält Proportionen bei, zeigt vollständiges Bild */
    object-position: center; /* Zentriert das Bild */
    padding: 5px; /* Sehr wenig Padding = Byte füllt fast den ganzen Kreis aus */
    background: rgb(255, 250, 187); /* Weißer Hintergrund für besseren Kontrast */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: block;
    margin: 0 auto;
}

/* Success Modal */
.modal-content.success .mascot {
    width: 135px; /* Größerer Kreis */
    height: 135px;
    border: 5px solid #38a169;
    padding: 18px; /* Mehr Raum um das PNG */
    background: rgba(45, 45, 94, 0.9);
    object-fit: contain;
    object-position: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    animation: celebrateSuccess 2s ease-in-out;
}

/* Quiz Modal */
.modal:not(.analysis-modal):not(.feedback-modal) .mascot {
    width: 128px; /* Größerer Kreis */
    height: 128px;
    border: 4px solid #4a5568;
    padding: 16px; /* Raum um das PNG */
    background: rgba(45, 45, 94, 0.9);
    object-fit: contain;
    object-position: center;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
    animation: gentle-pulse 3s ease-in-out infinite;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #e2e8f0;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 12px;
    border: 2px solid #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(45, 45, 94, 0.8);
    color: #e2e8f0;
}

.quiz-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.quiz-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.quiz-input {
    margin-top: 15px;
}

.quiz-input input {
    width: 100%;
    padding: 12px;
    border: 2px solid #4a5568;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(45, 45, 94, 0.8);
    color: #e2e8f0;
}

.quiz-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.modal-footer {
    padding: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(45, 45, 94, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .control-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .canvas-container {
        min-height: 300px;
    }
    
    #pixel-canvas {
        max-width: 90vw;
        max-height: 90vw;
        width: auto !important;
        height: auto !important;
    }
    
    .bit-overlay {
        max-width: 90vw;
        max-height: 90vw;
        width: auto !important;
        height: auto !important;
    }
    
    .colors {
        grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
        max-height: calc(100vh - 600px);
        min-height: 180px;
        gap: 4px;
    }
    
    header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .canvas-container {
        min-height: 250px;
    }
    
    #pixel-canvas {
        max-width: 85vw;
        max-height: 85vw;
        width: auto !important;
        height: auto !important;
    }
    
    .bit-overlay {
        max-width: 85vw;
        max-height: 85vw;
        width: auto !important;
        height: auto !important;
    }
    
    .colors {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
        max-height: calc(100vh - 700px);
        min-height: 120px;
        gap: 3px;
    }
    
    .color-option {
        min-height: 55px;
        padding: 4px;
    }
    
    .color-swatch {
        width: 28px;
        height: 28px;
    }
    
    .canvas-actions {
        text-align: center;
    }
    
    .btn-expand-prominent, .btn-submit {
        width: 100%;
    }
}

/* Animationen */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-unlock.highlight {
    animation: pulse 2s infinite;
}

/* Analysis Modal */
.analysis-modal .modal-content {
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert alles horizontal */
}

.analysis-modal .modal-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert Mascot und Titel */
    justify-content: center;
}

.analysis-content .mascot {
    animation: bounce 1s infinite;
    width: 150px !important; /* Erzwinge exakte Breite */
    height: 150px !important; /* Erzwinge exakte Höhe */
    min-width: 150px; /* Verhindere Schrumpfung */
    min-height: 150px; /* Verhindere Schrumpfung */
    max-width: 150px; /* Verhindere Ausdehnung */
    max-height: 150px; /* Verhindere Ausdehnung */
    border-radius: 50% !important; /* Erzwinge Kreisform */
    border: 5px solid #4a5568;
    padding: 20px; /* Mehr Raum um das PNG */
    background: rgba(45, 45, 94, 0.9);
    object-fit: contain; /* Behält PNG-Proportionen */
    object-position: center;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    margin: 0 auto 20px auto;
    display: block;
    position: relative;
    z-index: 10;
    flex-shrink: 0; /* Verhindere Flex-Schrumpfung */
    aspect-ratio: 1/1; /* Erzwinge 1:1 Verhältnis */
}

.analysis-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
}

/* Feedback Modal für Byte's Rückmeldungen */
.feedback-modal .modal-content {
    max-width: 450px;
    border: 3px solid #ed8936; /* Dunkelorange Border */
    background: rgba(45, 45, 94, 0.98);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.feedback-modal .modal-header {
    background: rgba(45, 45, 94, 0.9);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-modal .modal-header h3 {
    margin: 10px 0 0 0;
    font-size: 1.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.feedback-modal .mascot {
    width: 135px; /* Größerer Kreis */
    height: 135px;
    border: 5px solid #4a5568;
    padding: 18px; /* Raum um das PNG */
    background: rgba(45, 45, 94, 0.9);
    object-fit: contain;
    object-position: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    display: block;
}

.feedback-modal .modal-body {
    padding: 25px;
    background: rgba(45, 45, 94, 0.9);
    border-radius: 0 0 12px 12px;
    color: #e2e8f0;
}

.feedback-modal .feedback-text {
    color: #e2e8f0;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1, 1); /* Gleichmäßiges Scaling */
    }
    40% {
        transform: translateY(-15px) scale(1, 1); /* Kein Scaling beim Sprung */
    }
    60% {
        transform: translateY(-8px) scale(1, 1); /* Kein Scaling beim Sprung */
    }
}

@keyframes gentle-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 7px 22px rgba(0, 0, 0, 0.25);
    }
}

@keyframes celebrateSuccess {
    0% { 
        transform: scale(1) rotate(0deg);
    }
    25% { 
        transform: scale(1.1) rotate(-5deg);
    }
    50% { 
        transform: scale(1.15) rotate(5deg);
    }
    75% { 
        transform: scale(1.05) rotate(-2deg);
    }
    100% { 
        transform: scale(1) rotate(0deg);
    }
}

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

.mission-card {
    animation: fadeIn 0.5s ease-out;
}

/* Bit-Overlay für verschiedene Bit-Tiefen */
.bit-overlay.grid-8x8 {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.bit-overlay.grid-16x16 {
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
}

.bit-cell.bit-1 {
    font-size: 18px;
}

.bit-cell.bit-2 {
    font-size: 14px;
}

.bit-cell.bit-3 {
    font-size: 10px;
}

.bit-cell.bit-4 {
    font-size: 8px;
}

/* === Taschenrechner Styling === */

/* Taschenrechner Button im Missionskasten */
.btn-calculator {
    background: linear-gradient(145deg, #2d5aa0, #1e3f73);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(45, 90, 160, 0.3);
}

.btn-calculator:hover {
    background: linear-gradient(145deg, #3667b8, #204788);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 90, 160, 0.4);
}

.btn-calculator:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 90, 160, 0.3);
}

/* Calculator Modal */
.modal-content.calculator {
    max-width: 320px;
    background: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content.calculator .modal-header {
    background: #2d2d2d;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content.calculator .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #00ff88;
}

.btn-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-close:hover {
    background-color: #ff4444;
}

/* Calculator Container */
.calculator-container {
    padding: 20px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
}

/* 8-Segment Display */
.calculator-display {
    background: #000000;
    border: 3px solid #333;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 15px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.seven-segment-display {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: bold;
    color: #00ff88;
    text-align: right;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #0a0a0a;
    border-radius: 4px;
    padding: 10px 15px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00ff88;
    position: relative;
    overflow: hidden;
}

.seven-segment-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 48%,
        rgba(0, 255, 136, 0.1) 49%,
        rgba(0, 255, 136, 0.1) 51%,
        transparent 52%
    );
    background-size: 4px 4px;
    pointer-events: none;
}

/* Calculator Buttons */
.calculator-buttons {
    display: grid;
    gap: 8px;
}

.calc-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-row:last-child {
    grid-template-columns: 2fr 1fr 1fr;
}

.calc-row:nth-last-child(2) {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.calc-btn {
    background: linear-gradient(145deg, #4a4a4a, #2d2d2d);
    border: 1px solid #555;
    border-radius: 8px;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    padding: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.calc-btn:hover {
    background: linear-gradient(145deg, #5a5a5a, #3d3d3d);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #3d3d3d, #2d2d2d);
}

/* Spezielle Button-Stile */
.calc-number {
    background: linear-gradient(145deg, #4a4a4a, #2d2d2d);
}

.calc-operator {
    background: linear-gradient(145deg, #ff9500, #cc7700);
    color: #ffffff;
}

.calc-operator:hover {
    background: linear-gradient(145deg, #ffaa20, #dd8800);
}

.calc-equals {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: #ffffff;
}

.calc-equals:hover {
    background: linear-gradient(145deg, #42A5F5, #1E88E5);
}

.calc-clear {
    background: linear-gradient(145deg, #ff4444, #cc2222);
    color: #ffffff;
}

.calc-clear:hover {
    background: linear-gradient(145deg, #ff5555, #dd3333);
}

.calc-empty {
    background: transparent;
    border: none;
    cursor: default;
    box-shadow: none;
}

.calc-empty:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.calc-zero {
    grid-column: span 2;
}

/* === PDF Export Styling === */

/* PDF Export Button */
.btn-export {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    display: none; /* Initial versteckt */
}

.btn-export:hover {
    background: linear-gradient(145deg, #5CBF60, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-export:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* PDF Export Modal */
.modal-content.pdf-export {
    max-width: 500px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content.pdf-export .modal-header {
    background: rgba(45, 45, 94, 0.9);
    color: #e2e8f0;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content.pdf-export .modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #4CAF50;
}

.pdf-export-container {
    padding: 0;
}

.pdf-info {
    margin-bottom: 20px;
}

.pdf-info p {
    color: #a0aec0;
    margin-bottom: 15px;
}

.missions-preview {
    background: rgba(45, 45, 94, 0.8);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.missions-preview strong {
    color: #e2e8f0;
}

.missions-list {
    margin-top: 10px;
}

.mission-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.mission-item:last-child {
    border-bottom: none;
}

.mission-thumbnail {
    width: 40px;
    height: 40px;
    border: 1px solid #4a5568;
    border-radius: 4px;
    margin-right: 12px;
    background: rgba(26, 26, 46, 0.8);
    image-rendering: pixelated;
}

.mission-info {
    flex: 1;
}

.mission-title {
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 4px 0;
}

.mission-details {
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
}

.no-missions {
    color: #718096;
    font-style: italic;
    text-align: center;
    margin: 10px 0;
}

.name-input-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.name-input-section label {
    display: block;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.name-input-section input {
    width: 100%;
    padding: 12px;
    border: 2px solid #4a5568;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: rgba(45, 45, 94, 0.8);
    color: #e2e8f0;
}

.name-input-section input:focus {
    outline: none;
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2);
}

.name-input-section input:valid {
    border-color: #38a169;
}

/* Button States */
.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary:disabled:hover {
    background: #ccc;
    transform: none;
    box-shadow: none;
}

/* Responsive Design für PDF Export */
@media (max-width: 768px) {
    .modal-content.pdf-export {
        max-width: 90vw;
        margin: 10px;
    }
    
    .mission-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-export {
        margin-left: 0;
        width: 100%;
    }
}

/* Animationen für Calculator */
@keyframes calcButtonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.calc-btn.pressed {
    animation: calcButtonPress 0.1s ease;
}

/* Responsive Design für Calculator */
@media (max-width: 768px) {
    .modal-content.calculator {
        max-width: 90vw;
        margin: 10px;
    }
    
    .seven-segment-display {
        font-size: 24px;
        min-height: 35px;
    }
    
    .calc-btn {
        padding: 12px;
        font-size: 16px;
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: rgba(45, 45, 94, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

footer .impressum {
    max-width: 800px;
    margin: 0 auto;
}

footer .impressum p {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

footer .impressum a {
    color: #63b3ed;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer .impressum a:hover {
    color: #4299e1;
    text-decoration: underline;
}
