html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* AppBar (TASK-096-Folgeanpassung): etwas hoeher als der MudBlazor-Default, Verlaufshintergrund
   kommt per Inline-Style aus MainLayout.razor (haengt vom Light/Dark-Zustand ab). Skaliert die
   MudBlazor-eigene Toolbar-Hoehe hoch statt --mud-appbar-height selbst zu ueberschreiben, damit
   MudMainContent's Padding-Berechnung (die an --mud-appbar-height haengt) automatisch mitzieht. */
.lerniq-appbar .mud-toolbar {
    --mud-internal-toolbar-height: 80px;
}

.lerniq-appbar-mascot {
    height: 70px;
    width: auto;
    margin-left: 0.5rem;
}

.lerniq-appbar-title {
    font-weight: 800;
    letter-spacing: 0.01em;
}

/* TASK-062: Universeller Game-UI-Refresh - einheitlicher zentrierter Wrapper für alle
   Spielseiten (Crossword/WordSearch/Jeopardy/Memory/Zuordnung/Hangman/SLN/Subnetting/Quiz/Simulation). */
.game-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Der Sticky Ad-Footer (.ad-banner-footer, 60px, position: fixed) legt sich sonst ueber
   den unteren Seiteninhalt statt Platz zu beanspruchen - Padding kompensiert das, damit
   z.B. das Dashboard bis zum Ende scrollbar bleibt. */
.main-content {
    padding-bottom: 76px;
}

/* Dashboard - Spiele-Kacheln mit Tabler-Icons */
.game-tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.game-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 100px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-tile:hover {
    transform: translateY(-2px);
}

.game-tile-icon {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--mud-palette-primary, #2a78d6);
}

/* Wiederverwendbare Korrekt/Falsch-Flash-Animation, seitenübergreifend einsetzbar
   über die Klassen .anim-correct / .anim-wrong. */
@keyframes flashCorrect {
    0% { background-color: transparent; }
    30% { background-color: rgba(29, 158, 117, 0.35); }
    100% { background-color: transparent; }
}

@keyframes flashWrong {
    0% { background-color: transparent; }
    30% { background-color: rgba(192, 57, 43, 0.35); }
    100% { background-color: transparent; }
}

.anim-correct {
    animation: flashCorrect 0.6s ease;
}

.anim-wrong {
    animation: flashWrong 0.6s ease;
}

/* Welcome / landing page (Milestone 15) */
.welcome-hero {
    max-width: 720px;
    margin: 2.5rem auto 3rem;
    padding: 0 1rem;
    text-align: center;
}

.welcome-mascot {
    height: 140px;
    width: auto;
    margin-bottom: 0.5rem;
}

.welcome-title {
    font-weight: 800;
}

.welcome-subtitle {
    color: var(--mud-palette-text-secondary, #6c757d);
}

.welcome-xp-chip {
    font-weight: 700;
}

.welcome-section {
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.welcome-section-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.welcome-step-card, .welcome-feature-card {
    height: 100%;
    border-radius: 12px;
}

.welcome-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mud-palette-primary, #2a78d6);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Login / Register */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-form {
    width: 100%;
    max-width: 420px;
}

/* Quiz answer feedback - MudButton's own Color/Variant styling reads poorly at low
   opacity when Disabled, so the correct/wrong state is forced via explicit classes instead. */
.quiz-option-btn.correct {
    background-color: #E0F2F1 !important;
    border-color: #00897B !important;
    color: #004D40 !important;
}

.quiz-option-btn.wrong {
    background-color: #FFEBEE !important;
    border-color: #E53935 !important;
    color: #B71C1C !important;
}

/* Lückentext (TASK-047) - Fragetext + Blank-Inputs im Fließtext, gleiches Prinzip wie oben:
   explizite Klassen statt MudTextField's Disabled/ReadOnly-Dimmung fürs Korrekt/Falsch-Feedback. */
.quiz-fillblank-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.15rem;
    line-height: 2.4;
}

.quiz-blank-input {
    display: inline-flex;
    width: 140px;
    vertical-align: middle;
}

.quiz-blank-input.correct .mud-input-outlined-border {
    border-color: #00897B !important;
}

.quiz-blank-input.correct input {
    background-color: #E0F2F1 !important;
    color: #004D40 !important;
}

.quiz-blank-input.wrong .mud-input-outlined-border {
    border-color: #E53935 !important;
}

.quiz-blank-input.wrong input {
    background-color: #FFEBEE !important;
    color: #B71C1C !important;
}

.quiz-blank-correct-hint {
    color: #B71C1C;
    white-space: nowrap;
}

/* Quiz code snippets (TASK-033) - dark background regardless of theme, horizontal
   scroll confined to the code block so the page itself never scrolls sideways on mobile. */
.quiz-code-block {
    background-color: #282c34;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow-x: auto;
    max-width: 100%;
}

.quiz-code-block pre {
    margin: 0;
    padding: 1rem;
}

.quiz-code-block code {
    font-family: 'Consolas', 'Cascadia Code', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

/* Category dashboard cards */
.category-card {
    transition: transform 0.15s ease;
}

.category-card:hover {
    transform: translateY(-2px);
}

/* Simulation - centered layout + selectable cards */
.simulation-page {
    max-width: 700px;
    margin: 0 auto;
}

.simulation-select-card {
    cursor: pointer;
    user-select: none;
    padding: 1rem 0.5rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.simulation-select-card:hover {
    transform: translateY(-2px);
}

.simulation-select-card.selected {
    outline: 3px solid var(--mud-palette-primary, #2a78d6);
    outline-offset: -1px;
}

/* Memory game - 3D card flip */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.memory-card-slot {
    perspective: 800px;
    height: 100px;
    cursor: pointer;
}

.memory-card-slot.matched {
    cursor: default;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.4s;
    transform-style: preserve-3d;
}

.memory-card-slot.is-flipped .memory-card-inner,
.memory-card-slot.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.85rem;
    word-break: break-word;
}

.memory-card-face-back {
    background: var(--mud-palette-primary, #2a78d6);
    color: white;
}

.memory-card-face-front {
    background: color-mix(in srgb, var(--pair-color, #90BE6D) 22%, white);
    border: 2px solid var(--pair-color, #90BE6D);
    color: #1A1A1A;
    transform: rotateY(180deg);
}

.memory-card-slot.matched .memory-card-face-front {
    opacity: 0.6;
}

/* Karteikarten (Flashcards) - 3D card flip, analog zu .memory-card-* aber eigenes Layout/Sizing
   (variable Inhaltslänge: Bild/Code-Snippet/Erklärung/Bewertungs-Buttons statt kurzem Memory-Text). */
.flashcard-slot {
    perspective: 1500px;
    min-height: 320px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 320px;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.flashcard-slot.is-flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    overflow-y: auto;
    max-height: 70vh;
}

.flashcard-face-answer {
    transform: rotateY(180deg);
}

.flashcard-rating-btn {
    min-height: 56px;
}

/* Zuordnungsspiel - drag & drop chips + drop-zone slots */
.assignment-chip {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    margin: 0 0.5rem 0.5rem 0;
    border-radius: 20px;
    background: var(--mud-palette-primary, #2a78d6);
    color: white;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.assignment-chip.selected {
    outline: 3px solid var(--mud-palette-warning, #F8961E);
    outline-offset: 2px;
}

.assignment-chip.assigned {
    background: var(--mud-palette-success, #1D9E75);
    margin: 0;
    cursor: pointer;
}

.assignment-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 2px dashed var(--mud-palette-lines-default, #c9c9c9);
    border-radius: 8px;
    cursor: pointer;
}

.assignment-slot-label {
    font-weight: 500;
}

/* Jeopardy-Brett */
.jeopardy-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.jeopardy-category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 8px;
    background: var(--mud-palette-primary, #2a78d6);
    color: white;
    min-height: 3rem;
}

.jeopardy-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4.5rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-primary, #2a78d6) 12%, white);
    border: 2px solid var(--mud-palette-primary, #2a78d6);
    color: var(--mud-palette-primary, #2a78d6);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.jeopardy-tile:hover {
    transform: scale(1.04);
}

.jeopardy-tile.solved-correct {
    background: var(--mud-palette-success, #1D9E75);
    border-color: var(--mud-palette-success, #1D9E75);
    color: white;
    cursor: default;
}

.jeopardy-tile.solved-incorrect {
    background: var(--mud-palette-error, #C0392B);
    border-color: var(--mud-palette-error, #C0392B);
    color: white;
    cursor: default;
}

/* TASK-066: Jeopardy Online-PvP - vom Gegner beanspruchte Felder werden lila eingefaerbt (statt
   grün/rot wie bei eigenen Feldern), eigene noch offene Felder werden gesperrt, solange der Gegner
   am Zug ist. */
.jeopardy-tile.claimed-opponent {
    background: #7B4FA6;
    border-color: #7B4FA6;
}

.jeopardy-tile.locked {
    pointer-events: none;
    opacity: 0.6;
    cursor: default;
}

.podcast-card {
    border: 1px solid var(--mud-palette-lines-default, #c9c9c9);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.podcast-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.podcast-info .duration {
    margin-left: auto;
    font-weight: 400;
    opacity: 0.7;
}

.podcast-upload-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.podcast-upload-form input[type="text"],
.podcast-upload-form input[type="number"],
.podcast-upload-form select,
.podcast-upload-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--mud-palette-lines-default, #c9c9c9);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Level-up celebration overlay */
.level-up-overlay {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -20px);
    z-index: 1200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.level-up-overlay.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.level-up-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--mud-palette-surface, #ffffff);
    border: 2px solid var(--mud-palette-warning, #F8961E);
    border-radius: 16px;
    padding: 1.25rem 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: level-up-pop 0.5s ease;
}

.level-up-icon {
    font-size: 2.5rem;
    color: var(--mud-palette-warning, #F8961E);
}

@keyframes level-up-pop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Streak milestone highlight */
.streak-milestone {
    animation: streak-pulse 0.8s ease;
}

@keyframes streak-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Sprint 11/TASK-069: kurzer Puls auf der gerade freigeschalteten Achievement-Karte im Profil-Grid. */
@keyframes achievement-unlock-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(248, 150, 30, 0.6); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(248, 150, 30, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(248, 150, 30, 0); }
}

.achievement-unlock-pulse {
    animation: achievement-unlock-pulse 1.2s ease-out 2;
}

/* Achievement-Unlock-Toast */
.achievement-toast-overlay {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1200;
    pointer-events: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.achievement-toast-overlay.visible {
    opacity: 1;
    transform: translateX(0);
}

.achievement-toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--mud-palette-surface, #ffffff);
    border: 2px solid var(--mud-palette-warning, #F8961E);
    border-radius: 16px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: level-up-pop 0.5s ease;
}

.achievement-toast-icon {
    font-size: 2.25rem;
    flex-shrink: 0;
}

/* Kreuzworträtsel Wort-gefunden-Overlay */
.crossword-toast-overlay {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20px);
    z-index: 1200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.crossword-toast-overlay.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.crossword-toast-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    max-width: 320px;
    text-align: center;
    background: var(--mud-palette-surface, #ffffff);
    border: 2px solid var(--mud-palette-success, #3AA655);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: level-up-pop 0.5s ease;
}

.crossword-toast-icon {
    font-size: 2.5rem;
    color: var(--mud-palette-success, #3AA655);
}

/* Kreuzworträtsel - Buchstaben-Inputs: 16px verhindert iOS-Auto-Zoom beim Fokussieren,
   touch-action: manipulation verhindert Doppel-Tap-Zoom auf den kleinen Zellen. */
.crossword-cell-input {
    font-size: 16px;
    touch-action: manipulation;
}

@keyframes flashGreen {
    0% { background-color: #ffffff; }
    40% { background-color: #90ee90; }
    100% { background-color: #c8f7c5; }
}

.crossword-cell-flash {
    animation: flashGreen 0.7s ease;
}

/* Wortsuchrätsel - Live-Grau-Highlight während des Drag-Ziehens + Fund-Animation */
@keyframes fadeToGreen {
    0% { background-color: #ffe082; }
    100% { background-color: #c8f7c5; }
}

.wordsearch-cell-selecting {
    background-color: #d0d0d0 !important;
}

.wordsearch-cell-found {
    animation: fadeToGreen 0.6s ease forwards;
}

/* Memory - Shake-Animation bei nicht passendem Kartenpaar */
@keyframes memoryShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.memory-card-slot.shake .memory-card-inner {
    animation: memoryShake 0.4s ease;
}

/* Cookie consent banner (shown above the ad footer when AdSense is configured) */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 60px;
    z-index: 950;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.cookie-consent-text {
    flex: 1 1 320px;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Sticky ad footer */
.ad-banner-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

/* Router "not authorized" fallback */
.not-authorized {
    max-width: 400px;
    text-align: center;
    margin: 3rem auto;
}

.not-authorized .btn {
    display: inline-block;
    margin-top: 0.5rem;
}

/* Blazor framework defaults */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* TASK-073: CSS-only Confetti-Burst am Ende des Onboarding-Wizards (kein JS/Canvas noetig). */
.confetti-burst {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.confetti-piece {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    animation: confetti-fall 1.1s ease-in forwards;
}

.confetti-piece:nth-child(4n) { background: #F94144; }
.confetti-piece:nth-child(4n + 1) { background: #F8961E; }
.confetti-piece:nth-child(4n + 2) { background: #F9C74F; }
.confetti-piece:nth-child(4n + 3) { background: #90BE6D; }

.confetti-piece:nth-child(1) { left: 3%; animation-delay: 0ms; }
.confetti-piece:nth-child(2) { left: 10%; animation-delay: 60ms; }
.confetti-piece:nth-child(3) { left: 17%; animation-delay: 120ms; }
.confetti-piece:nth-child(4) { left: 24%; animation-delay: 20ms; }
.confetti-piece:nth-child(5) { left: 31%; animation-delay: 90ms; }
.confetti-piece:nth-child(6) { left: 38%; animation-delay: 150ms; }
.confetti-piece:nth-child(7) { left: 45%; animation-delay: 30ms; }
.confetti-piece:nth-child(8) { left: 52%; animation-delay: 100ms; }
.confetti-piece:nth-child(9) { left: 59%; animation-delay: 10ms; }
.confetti-piece:nth-child(10) { left: 66%; animation-delay: 80ms; }
.confetti-piece:nth-child(11) { left: 73%; animation-delay: 140ms; }
.confetti-piece:nth-child(12) { left: 80%; animation-delay: 40ms; }
.confetti-piece:nth-child(13) { left: 87%; animation-delay: 110ms; }
.confetti-piece:nth-child(14) { left: 94%; animation-delay: 160ms; }
.confetti-piece:nth-child(15) { left: 50%; animation-delay: 70ms; }
.confetti-piece:nth-child(16) { left: 20%; animation-delay: 130ms; }

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(260px) rotate(540deg); opacity: 0; }
}

/* TASK-088 (Sprint 13): Reaktion des Maskottchens auf Level-Up/Achievement-Unlock. */
.mascot-celebrating {
    animation: mascot-pulse 0.6s ease-in-out 3;
}

@keyframes mascot-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 193, 7, 0)); }
    50% { transform: scale(1.12); filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.8)); }
}

/* TASK-089 (Sprint 14): Shark Attack (ehem. Hangman) - Pinguin/Hai-Szene, rein CSS-animiert. */
.shark-attack-scene {
    position: relative;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #bfe3f7 0%, #bfe3f7 55%, #2a78d6 55%, #1a5aa8 100%);
}

.shark-attack-water {
    position: absolute;
    inset: 55% 0 0 0;
    background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0.12) 10px, transparent 10px, transparent 26px);
    animation: shark-water-scroll 6s linear infinite;
}

.shark-attack-iceberg {
    position: absolute;
    top: 6%;
    left: 4%;
    font-size: 2.4rem;
    opacity: 0.45;
    z-index: 1;
}

.shark-attack-floes {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 40%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    z-index: 2;
}

.shark-attack-floe {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 30%, #ffffff, #d9f0fb 65%, #b7e2f2 100%);
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15);
}

.shark-attack-floe.is-cracking {
    background: radial-gradient(ellipse at 35% 30%, #eef7fa, #a9c9d8 60%, #7fa9bd 100%);
    animation: shark-attack-floe-crack 0.9s ease-in forwards;
}

.shark-attack-penguin {
    position: absolute;
    left: 50%;
    bottom: 85%;
    transform: translateX(-50%);
    font-size: 2rem;
    line-height: 1;
    transform-origin: 50% 100%;
    animation: shark-attack-hop 0.35s ease-out;
}

.shark-attack-shark {
    position: absolute;
    right: calc((1 - var(--progress)) * 55% + 2%);
    bottom: 12%;
    font-size: 2.5rem;
    line-height: 1;
    transition: right 0.5s ease;
    animation: shark-bob 2s ease-in-out infinite;
    z-index: 3;
}

.shark-attack-scene.is-lost .shark-attack-penguin {
    animation: shark-attack-penguin-sink 0.9s ease-in forwards;
}

.shark-attack-scene.is-lost .shark-attack-shark {
    animation: shark-attack-lunge 0.5s ease-in-out 2;
}

.shark-attack-scene.is-won .shark-attack-penguin {
    animation: shark-attack-penguin-hop 0.6s ease-in-out 2;
}

.shark-attack-scene.is-won .shark-attack-shark {
    right: -15%;
    opacity: 0;
    transition: right 1s ease-in, opacity 1s ease-in 0.3s;
}

@keyframes shark-water-scroll {
    0% { background-position: 0 0; }
    100% { background-position: -260px 0; }
}

@keyframes shark-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes shark-attack-lunge {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-14px) scale(1.15); }
}

@keyframes shark-attack-hop {
    0% { transform: translate(-50%, -18px) scale(0.9); opacity: 0.6; }
    60% { transform: translate(-50%, -22px) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

@keyframes shark-attack-floe-crack {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    40% { transform: translateY(2px) rotate(-6deg); opacity: 1; }
    100% { transform: translateY(40px) rotate(-25deg); opacity: 0; }
}

@keyframes shark-attack-penguin-sink {
    0% { transform: translate(-50%, 0) rotate(0deg); opacity: 1; }
    50% { transform: translate(-50%, 10px) rotate(-15deg); opacity: 1; }
    100% { transform: translate(-50%, 60px) rotate(200deg); opacity: 0; }
}

@keyframes shark-attack-penguin-hop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

.shark-attack-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.shark-attack-keyboard-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.shark-attack-key {
    min-width: 44px;
    min-height: 44px;
}

.shark-attack-key.is-correct {
    background-color: #2e7d32 !important;
    color: #fff !important;
}

.shark-attack-key.is-incorrect {
    background-color: #c62828 !important;
    color: #fff !important;
}

/* TASK-093 (Sprint 15): "Buchstabe kaufen"-Modus - goldener Rand um die Tastatur */
.shark-attack-keyboard.is-buy-mode {
    border: 2px solid #F9C74F;
    border-radius: 12px;
    padding: 0.5rem;
}

/* TASK-092 (Sprint 15): geteiltes Gewinn-Overlay (WinCelebrationOverlay.razor) für alle Spielseiten */
.win-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.win-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.win-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 1rem;
    border-radius: 16px;
    background: var(--mud-palette-surface, #ffffff);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transform: scale(0.85);
    opacity: 0;
    animation: win-card-in 0.15s ease forwards;
}

@keyframes win-card-in {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.win-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.win-confetti-piece {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    animation-name: win-confetti-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes win-confetti-fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

.win-trophy-icon {
    font-size: 3.5rem;
    color: var(--mud-palette-warning, #F8961E);
}

.win-xp-chip {
    font-weight: 700;
    font-size: 1.1rem;
}

.win-subtitle {
    color: var(--mud-palette-text-secondary, #6b7280);
}
