/* ═══════════════════════════════════════════════════════════════════════════
   DEEP-DIVE PAGE STYLES v2.29.0
   Flashcard Deep-Dive mit Whiteboard und Claude-Analyse
   + Rotating Gradient Border Animation fuer Flashcard Focus
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-blue);
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.session-info {
    display: flex;
    gap: var(--space-md);
}

.info-badge {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-badge.xp {
    background: var(--gradient-xp);
    color: white;
    font-weight: 600;
}

/* Main Layout - v2.30.0: Breiteres Layout fuer bessere Raumnutzung */
.deepdive-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* Hero Section - v2.30.2: Kompakter, Frage praesenter */
.flashcard-hero {
    display: flex;
    gap: var(--space-lg);
    align-items: stretch;
    min-height: auto;  /* Kein fixes min-height mehr */
    padding: var(--space-lg);
    background: var(--gradient-header);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

/* v2.28.4: Flashcard-Container dehnt sich auf volle Höhe */
.flashcard-container {
    flex: 1;
    display: flex;
    align-items: stretch;  /* Flashcard dehnt sich auf volle Höhe */
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.29.0: Rotating Gradient Border Animation fuer Flashcard
   Animierter Cyan-Purple-Green Gradient wie Pricing Card
   ═══════════════════════════════════════════════════════════════════════════ */

@property --flashcard-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* v2.28.4: Flashcard nimmt volle Höhe des Containers ein */
/* v2.29.0: Mit rotierendem Gradient-Border */
.flashcard {
    width: 100%;
    height: 100%;  /* Volle Höhe des Containers */
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    /* v2.29.0: Positionierung fuer ::before Pseudo-Element */
    position: relative;
    isolation: isolate;  /* Stacking Context fuer z-index: -1 */
}

/* v2.29.0: Animierter Gradient-Border */
.flashcard::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--flashcard-angle, 0deg),
        #5BB6FF 0deg,      /* Cyan */
        #B38CFF 90deg,     /* Purple */
        #00C98B 180deg,    /* Green */
        #5BB6FF 270deg,    /* Cyan */
        #B38CFF 360deg     /* Purple */
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: flashcard-border-rotate 4s linear infinite;
    opacity: 0.7;
    z-index: -1;
}

@keyframes flashcard-border-rotate {
    0% { --flashcard-angle: 0deg; }
    100% { --flashcard-angle: 360deg; }
}

.card-front {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-topic {
    display: inline-block;
    align-self: flex-start;
    background: var(--accent-blue);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* v2.30.3: Frage praesenter - groessere Schrift */
.card-question {
    font-size: 1.75rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

/* v2.30.2: Schwierigkeit als dezente inline Badge */
.card-difficulty {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    width: fit-content;
}

/* v2.28.4: Super-Visual Section - Alle Elemente gleich breit */
.sv-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;  /* Alle Kinder gleich breit */
    justify-content: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    width: 280px;  /* Gemeinsame Breite - mehr Platz fuer Availability */
}

/* Super-Visual Button - v2.28.4: Volle Breite des Containers */
.btn-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    width: 100%;    /* Volle Breite (220px von sv-section) */
    height: 180px;  /* Feste Hoehe */
    background: var(--bg-secondary);
    border: 2px dashed var(--accent-purple);
    border-radius: var(--radius-lg);
    color: var(--accent-purple);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
    /* align-self entfernt - wird durch sv-section zentriert */
}

.btn-visual:hover {
    background: rgba(139, 92, 246, 0.15);
    border-style: solid;
    transform: scale(1.02);
}

.btn-visual .btn-visual-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-visual .btn-visual-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* v2.29.0: Button-State Styles fuer Refresh-Modus */
.btn-visual .sv-refresh-icon[hidden] {
    display: none;
}

.btn-visual.has-image {
    border-style: solid;
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.btn-visual.has-image:hover {
    background: rgba(34, 197, 94, 0.2);
}

.btn-visual.has-image .sv-normal-icon {
    display: none;
}

.btn-visual.has-image .sv-refresh-icon {
    display: block !important;
}

.btn-visual.has-image .btn-visual-label {
    color: var(--accent-green);
}

/* Refresh Icon Rotation auf Hover */
.btn-visual.has-image:hover .sv-refresh-icon {
    animation: refreshSpin 0.8s ease-in-out;
}

@keyframes refreshSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Trennlinie */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: var(--space-lg) 0;
}

/* v2.30.0: Vertikales Lanes-Layout statt 2-Spalten */
.answer-section {
    margin-bottom: var(--space-xl);
}

.answer-columns {
    display: flex;
    flex-direction: column;
    gap: 0;  /* Divider uebernehmen Abstand */
}

@media (max-width: 900px) {
    /* Bereits vertikal - keine Aenderung noetig */
    .answer-columns {
        gap: 0;
    }

    .flashcard-hero {
        flex-direction: column;
    }

    /* v2.28.4: Mobile Layout fuer sv-section */
    .sv-section {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-visual {
        width: 100%;
        flex-direction: row;
        padding: var(--space-md);
    }

    .sv-thumbnail-container {
        width: 100px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.29.0: SYMMETRISCHES ANTWORT + WHITEBOARD LAYOUT
   Beide Spalten haben jetzt identische visuelle Struktur
   ═══════════════════════════════════════════════════════════════════════════ */

/* Gemeinsame Basis fuer beide Spalten */
.answer-input,
.whiteboard-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
}

/* Labels fuer beide Seiten */
.answer-input label,
.whiteboard-container label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

/* Textarea */
.answer-input textarea {
    flex: 1;  /* Nimmt verfuegbaren Platz ein */
    min-height: 260px;  /* v2.29.0: Angepasst fuer Symmetrie mit Whiteboard */
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition-fast);
}

.answer-input textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.answer-input textarea::placeholder {
    color: var(--text-muted);
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Whiteboard Hint (unter Label) */
.whiteboard-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-xs) 0;
}

/* v2.29.0: Toolbar ohne eigene Border (Parent hat jetzt Border) */
.whiteboard-toolbar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--bg-primary);
    transform: scale(1.15);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 var(--space-xs);
}

.btn-sm {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-sm:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* v2.30.1: Resizable Whiteboard fuer flexibles Zeichnen */
.whiteboard-container {
    position: relative;
    min-height: 420px;   /* Start-Hoehe (350px canvas + toolbar) */
    max-height: 850px;   /* Max: ca. doppelte Start-Hoehe */
}

#whiteboard {
    width: 100%;
    height: 350px;
    background: var(--bg-secondary);
    border-radius: 0;  /* Handle hat jetzt den border-radius */
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom: none;  /* Handle uebernimmt */
    cursor: crosshair;
    touch-action: none;
}

/* v2.30.1: Drag Handle fuer manuelles Resize */
.whiteboard-resize-handle {
    width: 100%;
    height: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.whiteboard-resize-handle:hover {
    background: var(--bg-hover);
}

.whiteboard-resize-handle::before {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    transition: background 0.2s ease, width 0.2s ease;
}

.whiteboard-resize-handle:hover::before {
    background: var(--accent-blue);
    width: 80px;
}

.whiteboard-resize-handle.dragging {
    background: rgba(59, 130, 246, 0.15);
}

.whiteboard-resize-handle.dragging::before {
    background: var(--accent-blue);
    width: 100px;
}

/* Action Bar - v2.30.1: Symmetrische Button-Verteilung */
.action-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

.btn-skip {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-skip:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Accessibility Button - Prominent */
.btn-accessibility {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-accessibility:hover {
    background: rgba(6, 182, 212, 0.15);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    z-index: 1000;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.modal[hidden] {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 75vw; /* v2.26.1: Breiter fuer bessere Uebersicht */
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease-out;
}

/* v2.26.1: Analyse-Inhalte in 2 Spalten bei breitem Modal */
.analysis-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.analysis-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 900px) {
    .analysis-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    font-size: 1.4rem;
}

/* Score Display */
.score-display {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.score {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-green);
    line-height: 1;
}

.score-label {
    display: block;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.xp-badge {
    display: inline-block;
    background: var(--gradient-xp);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    margin-top: var(--space-sm);
    font-weight: 600;
}

/* Analysis Sections */
.analysis-section {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-color);
}

.analysis-section h3 {
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.analysis-section.correct { border-left-color: var(--accent-green); }
.analysis-section.correct h3 { color: var(--accent-green); }

.analysis-section.missing { border-left-color: var(--accent-orange); }
.analysis-section.missing h3 { color: var(--accent-orange); }

.analysis-section.incorrect { border-left-color: var(--accent-red); }
.analysis-section.incorrect h3 { color: var(--accent-red); }

.analysis-section.tips { border-left-color: var(--accent-blue); }
.analysis-section.tips h3 { color: var(--accent-blue); }

.analysis-section.sketch { border-left-color: var(--accent-purple); }
.analysis-section.sketch h3 { color: var(--accent-purple); }

.analysis-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.analysis-section li {
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: var(--space-md);
    position: relative;
}

.analysis-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

/* Sketch Analysis */
.sketch-feedback {
    padding: var(--space-sm) 0;
}

.sketch-status {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.status-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.status-badge.relevant {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.status-badge.usable {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.status-badge.not-relevant,
.status-badge.not-usable {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.sketch-bonus {
    background: var(--gradient-xp);
    color: white;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.sketch-description {
    color: var(--text-secondary);
    font-style: italic;
    margin: var(--space-sm) 0;
    font-size: 0.9rem;
}

.sketch-tip {
    color: var(--accent-blue);
    font-size: 0.85rem;
    margin: 0;
}

/* Model Answer */
.model-answer {
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.model-answer summary {
    cursor: pointer;
    color: var(--accent-blue);
    font-weight: 500;
}

.model-answer summary:hover {
    text-decoration: underline;
}

.model-answer p {
    margin-top: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-lg);
}

/* Session Summary */
.session-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.summary-stat {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Load Error Message */
.load-error-message {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-secondary);
}

.load-error-message p {
    margin-bottom: var(--space-sm);
}

/* Accessibility Modal */
.a11y-modal {
    max-width: 400px;
}

.setting-group {
    margin-bottom: var(--space-lg);
}

.setting-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
}

/* WCAG 2.1 AA: High Contrast Mode */
.high-contrast {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #606060;
}

.high-contrast .flashcard,
.high-contrast .modal-content,
.high-contrast .analysis-section {
    border: 1px solid var(--border-color);
}

/* WCAG 2.1 AA: Enhanced Focus */
.focus-enhanced *:focus {
    outline: 4px solid var(--accent-cyan) !important;
    outline-offset: 4px !important;
}

.focus-enhanced *:focus:not(:focus-visible) {
    outline: none !important;
}

.focus-enhanced *:focus-visible {
    outline: 4px solid var(--accent-cyan) !important;
    outline-offset: 4px !important;
}

/* Responsive Font Sizes */
html {
    font-size: var(--base-font-size, 16px);
}

/* Button States */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2.25.1 ADDITIONS - Copy Button, Sketch Thumbnail, Super-Visual Modal
   ═══════════════════════════════════════════════════════════════════════════ */

/* Copy Button for Optimierungstipps */
.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-copy.copied {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    animation: copyPulse 0.3s ease;
}

.btn-copy .check-icon { display: none; }
.btn-copy.copied .copy-icon { display: none; }
.btn-copy.copied .check-icon { display: block; }

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Sketch Thumbnail in Analysis Modal */
.sketch-feedback-container {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.sketch-thumbnail-wrapper {
    flex-shrink: 0;
    width: 220px;
    height: 160px;
    border: 2px solid var(--accent-purple);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: zoom-in;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.sketch-thumbnail-wrapper:hover {
    transform: scale(1.03);
    border-color: var(--accent-cyan, #22d3ee);
}

.sketch-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUPER-VISUAL MODAL - Mini-Games während Bildgenerierung
   ═══════════════════════════════════════════════════════════════════════════ */

.supervisual-content {
    max-width: 650px;
    text-align: center;
}

.sv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.sv-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.sv-timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-orange);
    font-family: 'Courier New', monospace;
    min-width: 50px;
}

/* Progress Ring */
.sv-progress {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: var(--bg-card);
    stroke-width: 6;
    fill: none;
}

.progress-ring-fill {
    stroke: var(--accent-purple);
    stroke-width: 6;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-purple);
}

/* Game Area */
.sv-game-area {
    margin-bottom: var(--space-lg);
}

.sv-game-hint {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
}

.sv-game-selector {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.btn-game {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.btn-game:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-game.active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.sv-game-container {
    min-height: 200px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

/* Ready Banner */
.sv-ready-banner {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    animation: bannerSlideIn 0.4s ease;
}

/* v2.25.6 FIX: hidden Attribut respektieren (display: flex ueberschreibt sonst hidden) */
.sv-ready-banner[hidden] {
    display: none;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ready-pulse {
    font-size: 1.5rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.3); }
}

/* Image Display mit Kopierschutz */
.sv-image-display {
    margin-bottom: var(--space-lg);
}

.sv-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sv-image-wrapper img {
    max-width: 100%;
    max-height: 380px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    /* Kopierschutz */
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Transparenter Overlay verhindert jegliche Interaktion mit dem Bild */
.sv-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: auto;
}

.sv-topic-hint {
    margin-top: var(--space-md);
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.sv-close {
    margin-top: var(--space-md);
}

/* v2.28.3: Schliessen-Hinweis fuer Thumbnail */
.sv-close-hint {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    text-align: center;
    animation: hintFadeIn 0.5s ease;
}

.sv-close-hint[hidden] {
    display: none;
}

/* v2.28.3: Close-Button Puls-Animation */
.sv-close-pulse {
    animation: closePulse 2s infinite;
}

@keyframes closePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(6, 182, 212, 0);
    }
}

@keyframes hintFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══════════════════════════════════════════════════════════════════════
   HINT SYSTEM - Rate-Show Style (v2.26.0)
   Dreistufiges Hinweissystem mit CYAN/Tuerkis Design
   ═══════════════════════════════════════════════════════════════════════ */

/* v2.30.2: Hint-Buttons aufgefaechert mit mehr Luft */
/* Trennlinie auf Hoehe Thumbnail-Oberkante */
.hint-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-lg);
    margin-top: auto;           /* Pushed to bottom via flexbox */
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.hint-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: var(--space-md);
}

/* v2.30.2: Breitere Hint-Buttons */
.btn-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 65px;
    background: var(--bg-secondary);
    border: 2px solid #00CED1; /* CYAN */
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-hint:hover:not([disabled]) {
    background: rgba(0, 206, 209, 0.15);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 206, 209, 0.3);
}

.btn-hint .hint-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #B8FF00; /* Lime-Gruen wie im Screenshot */
}

.btn-hint .hint-cost {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Deaktivierter Zustand (nach Nutzung) */
.btn-hint[disabled] {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-hint[disabled] .hint-number {
    color: var(--text-muted);
}

.btn-hint[disabled]::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    color: var(--accent-green);
}

/* Loading State */
.btn-hint.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-hint.loading .hint-number::after {
    content: "...";
    animation: dots 1.2s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* ═══════════════════════════════════════════════════════════════════════
   HINT ACCORDION - FAQ-Style (v2.26.1)
   Alle Hinweise bleiben sichtbar, ausklappbar wie moderne FAQ
   ═══════════════════════════════════════════════════════════════════════ */

.hint-accordion {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.hint-accordion[hidden] {
    display: none;
}

/* Einzelner Hint-Item (Accordion) */
.hint-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.hint-item[data-level="1"] { border-left: 3px solid #00CED1; }
.hint-item[data-level="2"] { border-left: 3px solid #FFD700; }
.hint-item[data-level="3"] { border-left: 3px solid #FF6B6B; }

/* Header (klickbar fuer expand/collapse) */
.hint-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    user-select: none;
    background: transparent;
    transition: background 0.15s ease;
}

.hint-item-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hint-item-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hint-badge {
    background: #00CED1;
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.hint-item[data-level="2"] .hint-badge { background: #FFD700; }
.hint-item[data-level="3"] .hint-badge { background: #FF6B6B; }

.hint-penalty {
    color: #FF6B6B;
    font-size: 0.8rem;
    font-weight: 500;
}

.hint-expand-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.hint-item.expanded .hint-expand-icon {
    transform: rotate(180deg);
}

/* Content (ausklappbar) */
.hint-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    padding: 0 var(--space-md);
}

.hint-item.expanded .hint-item-content {
    max-height: 1000px;  /* v2.28.4 FIX: Mehr Platz fuer lange Hints (war 300px) */
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

.hint-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Level-spezifische Farben */
.btn-hint[data-level="1"] { border-color: #00CED1; }
.btn-hint[data-level="2"] { border-color: #FFD700; }
.btn-hint[data-level="3"] { border-color: #FF6B6B; }

.btn-hint[data-level="2"]:hover:not([disabled]) {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.btn-hint[data-level="3"]:hover:not([disabled]) {
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

/* Sequentielle Hint-Reihenfolge: Visuelles Feedback */
@keyframes hint-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-hint.hint-required {
    animation: hint-shake 0.3s ease-in-out;
    border-color: #FF6B6B !important;
}

/* Sequenz-Info Box (v2.26.1) - dezenter Hinweis rechts neben Buttons */
.hint-sequence-info {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-sm);
    margin-left: var(--space-sm);
    animation: sequenceInfoFadeIn 0.3s ease;
}

.hint-sequence-info[hidden] {
    display: none;
}

@keyframes sequenceInfoFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hint-sequence-icon {
    font-size: 1rem;
    color: #FF6B6B;
}

.hint-sequence-text {
    font-size: 0.8rem;
    color: #FF6B6B;
    white-space: nowrap;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .hint-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hint-label {
        width: 100%;
        text-align: center;
        margin-bottom: var(--space-xs);
    }

    .btn-hint {
        width: 60px;
        height: 60px;
    }

    .btn-hint .hint-number {
        font-size: 1.2rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   SUPER-VISUAL VERFUEGBARKEIT (v2.28.3)
   Zeigt verbleibende Free-Klicks und XP-Guthaben
   ═══════════════════════════════════════════════════════════════════════ */

.sv-availability {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    /* v2.28.4 FIX: width entfernt - war 140px, zu schmal fuer Inhalt */
}

.sv-availability-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;  /* v2.28.4 FIX: Verhindert Umbruch bei "/3 free" */
}

.sv-availability-icon {
    font-size: 1rem;
}

.sv-availability-value {
    font-weight: 600;
    color: var(--text-primary);
}

.sv-availability-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sv-availability-cost {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.sv-availability-divider {
    color: var(--border-color);
    opacity: 0.5;
}

/* Zustand: Kostenlose Klicks verfuegbar */
.sv-free.has-free .sv-availability-value {
    color: #10B981;  /* Gruen */
}

/* Zustand: Keine Free-Klicks mehr */
.sv-free.no-free .sv-availability-value {
    color: var(--text-muted);
}

/* Zustand: Genug XP */
.sv-xp.can-afford .sv-availability-value {
    color: #3B82F6;  /* Blau */
}

/* Zustand: Nicht genug XP */
.sv-xp.cannot-afford .sv-availability-value {
    color: #EF4444;  /* Rot */
}

/* ═══════════════════════════════════════════════════════════════════════
   SUPER-VISUAL THUMBNAIL + LIGHTBOX (v2.28.0)
   Geschuetzte Bildanzeige ohne Rechtsklick/Speichern
   ═══════════════════════════════════════════════════════════════════════ */

/* v2.28.4: Always-Visible Thumbnail mit Platzhalter */
.sv-thumbnail-container {
    width: 100%;  /* Volle Breite (220px von sv-section) */
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Platzhalter-Zustand: Grau, nicht klickbar */
.sv-thumbnail-container.placeholder {
    opacity: 0.6;
    cursor: default;
}

.sv-thumbnail-container.placeholder:hover {
    transform: none;
}

/* Bild-Zustand: Voll sichtbar, klickbar */
.sv-thumbnail-container:not(.placeholder):hover {
    transform: scale(1.03);
}

/* Thumbnail Wrapper - v2.28.4: Volle Breite des Containers */
.sv-thumbnail-wrapper {
    position: relative;
    width: 100%;    /* Volle Breite (220px von sv-section) */
    height: 180px;  /* Feste Hoehe wie Button */
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Bildschutz */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Platzhalter-Wrapper: Gestrichelte Border */
.sv-thumbnail-container.placeholder .sv-thumbnail-wrapper {
    border: 2px dashed var(--border-color);
}

/* Bild-Wrapper: Solide Border */
.sv-thumbnail-container:not(.placeholder) .sv-thumbnail-wrapper {
    border: 2px solid var(--accent-purple);
}

/* Platzhalter-Inhalt (SVG + Text) */
.sv-thumbnail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-muted);
}

.sv-thumbnail-placeholder svg {
    opacity: 0.5;
}

.sv-thumbnail-placeholder span {
    font-size: 0.7rem;
}

.sv-thumbnail-placeholder[hidden] {
    display: none;
}

/* Bild */
.sv-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.sv-thumbnail-wrapper img[hidden] {
    display: none;
}

/* Transparenter Schutz-Overlay (nur wenn Bild sichtbar) */
.sv-thumbnail-container:not(.placeholder) .sv-thumbnail-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: auto;
}

/* Thumbnail Label */
.sv-thumbnail-label {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    /* v2.28.4 FIX: Text umbrechen statt abschneiden */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

.sv-thumbnail-container:not(.placeholder) .sv-thumbnail-label {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════
   LIGHTBOX - 75% Bildschirm Grossansicht
   ═══════════════════════════════════════════════════════════════════════ */

.sv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-lightbox[hidden] {
    display: none;
}

/* Dunkler Backdrop */
.sv-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

/* Content Container - 75% des Bildschirms */
.sv-lightbox-content {
    position: relative;
    width: 75vw;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Wrapper mit Bildschutz */
.sv-lightbox-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sv-lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* Transparenter Schutz-Overlay fuer Lightbox */
.sv-lightbox-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: auto;
}

/* Close Button */
.sv-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Lightbox Animation */
.sv-lightbox .sv-lightbox-content {
    animation: lightboxFadeIn 0.2s ease-out;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive fuer Thumbnail + Lightbox */
@media (max-width: 768px) {
    .sv-thumbnail-container {
        width: 100px;
    }

    .sv-lightbox-content {
        width: 95vw;
        height: 80vh;
    }

    .sv-lightbox-image-wrapper img {
        max-height: 80vh;
    }

    .sv-lightbox-close {
        top: -40px;
        right: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   COPYRIGHT PROTECTION OVERLAY (v2.28.1)
   Freundlicher Hinweis bei Kopierversuchen
   ═══════════════════════════════════════════════════════════════════════ */

.copyright-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: copyrightFadeIn 0.3s ease;
}

.copyright-overlay[hidden] {
    display: none;
}

.copyright-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.copyright-overlay-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl, 16px);
    padding: var(--space-xl) var(--space-xxl, 2rem);
    max-width: 500px;
    text-align: center;
    border: 2px solid #F59E0B;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
    margin: var(--space-md);
}

.copyright-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.copyright-title {
    color: #F59E0B;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    margin-top: 0;
}

.copyright-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.copyright-reassurance {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--space-lg);
}

.copyright-notice {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.copyright-warning {
    color: #F59E0B;
    font-weight: 500;
    margin-bottom: var(--space-xl);
}

.copyright-dismiss {
    background: #F59E0B;
    color: #000;
    border: none;
    padding: var(--space-sm) var(--space-xl);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.copyright-dismiss:hover {
    background: #D97706;
}

@keyframes copyrightFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Responsive fuer Copyright Overlay */
@media (max-width: 480px) {
    .copyright-overlay-content {
        padding: var(--space-lg);
        max-width: 95vw;
    }

    .copyright-icon {
        font-size: 2.5rem;
    }

    .copyright-title {
        font-size: 1.25rem;
    }
}
