/* ==========================================================================
   lerneule.schule – Lerneule Karten-Duell (styles.css)
   Liebevolles 2D-TCG-Design, Mobile First, 100 % lokal ohne externe Fonts.
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--le-bg);
    color: var(--le-ink);
    font-family: var(--le-font-sans);
    -webkit-tap-highlight-color: transparent;
    min-height: 100%;
}

.mono {
    font-family: var(--le-font-mono);
}

button {
    font-family: inherit;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

/* ==========================================================================
   1. STARTSEITE (HUB)
   ========================================================================== */

.tcg-hub-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 14px calc(52px + env(safe-area-inset-bottom, 0px));
}

.tcg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 14px;
}

.tcg-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tcg-brand-badge {
    display: inline-block;
    width: fit-content;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--le-amber-soft);
    color: #92400e;
}

.tcg-brand h1 {
    margin: 0;
    font-size: clamp(1.3rem, 3.4vw, 1.9rem);
    font-weight: 900;
    line-height: 1.15;
}

.tcg-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 48px;
}

.tcg-icon-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-surface);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, background 0.14s ease;
}

.tcg-icon-btn.sm {
    min-width: 40px;
    min-height: 40px;
    font-size: 1rem;
    font-weight: 900;
}

.tcg-icon-btn:active {
    transform: scale(0.94);
}

.tcg-icon-btn.is-off {
    opacity: 0.55;
    background: var(--le-bg-soft);
}

/* Spieler-Banner */
.tcg-profile-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 52%, #e0e7ff 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.22);
    box-shadow: var(--le-shadow-sm);
    margin-bottom: 14px;
}

.tcg-player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tcg-avatar-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f59e0b, #7c3aed);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.2);
}

.tcg-avatar-ring > svg,
.tcg-avatar-ring > div {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
}

.tcg-player-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6d28d9;
}

.tcg-player-name {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.2;
}

.tcg-player-sub {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--le-ink-muted);
    margin-top: 2px;
}

.tcg-wallet-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tcg-wallet-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    border: 1.5px solid rgba(43, 33, 24, 0.12);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.tcg-wallet-ico {
    font-size: 1.35rem;
}

.tcg-wallet-pill strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.1;
}

.tcg-wallet-pill small {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--le-ink-muted);
}

/* Sektionen */
.tcg-section {
    margin-bottom: 22px;
}

.tcg-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
}

.tcg-section-head h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 900;
}

.tcg-hint-pill {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--le-bg-soft);
    color: var(--le-ink-muted);
}

/* ==========================================================================
   3D-FLIP-KARTEN GRUNDLAGE (STUFEN, GEGNER & WELTEN)
   ========================================================================== */

.tcg-flip-scene {
    perspective: 1100px;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: transform 0.2s ease;
}

.tcg-flip-scene:hover:not(.is-flipped) {
    transform: translateY(-4px);
}

.tcg-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateY(0deg);
    will-change: transform;
    transition: transform 0.54s cubic-bezier(0.22, 1, 0.36, 1);
}

.tcg-flip-scene.is-flipped .tcg-flip-inner {
    transform: rotateY(180deg);
}

.tcg-flip-face {
    position: absolute;
    inset: 0;
    border-radius: 22px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tcg-flip-front {
    transform: rotateY(0deg);
}

.tcg-flip-back {
    transform: rotateY(180deg);
}

.tcg-flip-scene:not(.is-flipped) .tcg-flip-back {
    pointer-events: none;
}

.tcg-flip-scene.is-flipped .tcg-flip-front {
    pointer-events: none;
}

.tcg-flip-back-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1.5px solid var(--le-border-strong);
    background: rgba(255, 255, 255, 0.92);
    color: var(--le-ink-muted);
    font-size: 0.78rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
}

.tcg-flip-back-btn:hover {
    background: #ffffff;
    color: var(--le-ink);
}

/* ---------- STUFEN-FLIP-KARTEN ---------- */

.tcg-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .tcg-tier-grid {
        grid-template-columns: 1fr;
    }
}

.tcg-tier-scene {
    height: 146px;
}

.tcg-tier-face {
    padding: 14px;
    border: 2.5px solid var(--le-border);
    box-shadow: var(--le-shadow-sm);
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 5px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tcg-tier-scene.tier-grundschule .tcg-flip-front {
    background: linear-gradient(145deg, #fffbeb 0%, #ffedd5 100%);
    border-color: #fdba74;
}

.tcg-tier-scene.tier-sek1_starter .tcg-flip-front {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0e7ff 100%);
    border-color: #93c5fd;
}

.tcg-tier-scene.tier-sek1_fortgeschritten .tcg-flip-front {
    background: linear-gradient(145deg, #fefce8 0%, #ede9fe 100%);
    border-color: #c4b5fd;
}

.tcg-tier-scene.is-active .tcg-flip-front,
.tcg-tier-scene.is-active .tcg-flip-back {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22), 0 10px 22px rgba(124, 58, 237, 0.16);
}

.tcg-tier-active-pill {
    position: absolute;
    top: 9px;
    left: 10px;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: #7c3aed;
    color: #ffffff;
}

.tcg-tier-turn-ico {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcg-tier-medal-big {
    font-size: 2.3rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.tcg-tier-name {
    font-size: 1rem;
    font-weight: 900;
    color: #1e293b;
}

.tcg-tier-class-pill {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
}

.tcg-tier-scene .tcg-flip-back {
    background: #ffffff;
    border-color: #7c3aed;
    padding: 12px 13px;
    justify-content: space-between;
    text-align: left;
    align-items: stretch;
}

.tcg-tier-back-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.tcg-tier-back-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: #4c1d95;
}

.tcg-tier-back-desc {
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--le-ink-muted);
    line-height: 1.3;
    margin: 2px 0;
}

.tcg-tier-back-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 900;
}

.tcg-tier-coin-tag {
    padding: 3px 9px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}

/* Tabs */
.tcg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tcg-tab {
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-surface);
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--le-ink-muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tcg-tab.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.tcg-tab-count {
    font-size: 0.74rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.tcg-tab:not(.is-active) .tcg-tab-count {
    background: var(--le-bg-soft);
    color: var(--le-ink);
}

/* ---------- WELT- & DECK-UMSCHALTER (MULTI-WORLD / MULTI-DECK) ---------- */

.tcg-world-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.tcg-world-pill {
    flex: 1 1 200px;
    min-height: 54px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 2px solid var(--le-border-strong);
    background: var(--le-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.tcg-world-pill:hover {
    border-color: #818cf8;
    transform: translateY(-2px);
}

.tcg-world-pill.is-active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.16);
}

.tcg-world-pill.world-deutsch.is-active {
    border-color: #d97706;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.18);
}

.tcg-world-pill.world-geographie.is-active {
    border-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.18);
}

.tcg-world-pill.world-englisch.is-active {
    border-color: #e11d48;
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.18);
}

.tcg-world-pill-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tcg-world-pill-ico {
    font-size: 1.55rem;
    line-height: 1;
}

.tcg-world-pill-title {
    display: block;
    font-size: 0.94rem;
    font-weight: 900;
    color: var(--le-ink);
    line-height: 1.15;
}

.tcg-world-pill-sub {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--le-ink-muted);
}

.tcg-world-pill-stat {
    font-size: 0.76rem;
    font-weight: 900;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--le-bg-soft);
    color: var(--le-ink);
    white-space: nowrap;
}

.tcg-world-pill.is-active .tcg-world-pill-stat {
    background: #4f46e5;
    color: #ffffff;
}

.tcg-world-pill.world-deutsch.is-active .tcg-world-pill-stat {
    background: #d97706;
    color: #ffffff;
}

.tcg-world-pill.world-geographie.is-active .tcg-world-pill-stat {
    background: #0d9488;
    color: #ffffff;
}

.tcg-world-pill.world-englisch.is-active .tcg-world-pill-stat {
    background: #e11d48;
    color: #ffffff;
}

/* ---------- GEGNER-FLIP-KARTEN (GROSSES PORTRÄT & NAME VORNE) ---------- */

.tcg-chapter-kicker {
    display: inline-block;
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    margin-bottom: 6px;
}

.tcg-enemies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.tcg-special-section {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(245, 243, 255, 0.72) 0%, rgba(239, 246, 255, 0.72) 100%);
    border: 2px dashed #c4b5fd;
}

.tcg-special-section.is-unlocked {
    border-style: solid;
    border-color: #a78bfa;
    background: linear-gradient(145deg, rgba(250, 245, 255, 0.92) 0%, rgba(224, 242, 254, 0.85) 100%);
}

.tcg-special-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.tcg-hint-pill.is-unlocked {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
}

@media (max-width: 860px) {
    .tcg-enemies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tcg-special-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .tcg-enemies-grid,
    .tcg-special-grid {
        grid-template-columns: 1fr;
    }
}

.tcg-enemy-scene {
    height: 312px;
}

.tcg-enemy-front {
    padding: 14px 14px 16px;
    border: 3px solid #93c5fd;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.tcg-enemy-scene.stage-2 .tcg-enemy-front {
    border-color: #a78bfa;
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
}

.tcg-enemy-scene.stage-3 .tcg-enemy-front {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.2);
}

.tcg-enemy-scene.is-special .tcg-enemy-front {
    border-color: #8b5cf6;
    background: linear-gradient(145deg, #fdf4ff 0%, #ede9fe 52%, #e0f2fe 100%);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.22);
}

.tcg-enemy-scene.is-special .tcg-enemy-stage-tag {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
}

.tcg-enemy-scene.is-special .tcg-enemy-back {
    border-color: #7c3aed;
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
}

.tcg-enemy-scene.is-locked .tcg-enemy-front {
    border-color: #cbd5e1;
    border-style: dashed;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: none;
}

.tcg-enemy-scene.is-special.is-locked .tcg-enemy-front {
    border-color: #c4b5fd;
    background: linear-gradient(145deg, #faf5ff 0%, #f1f5f9 100%);
}

.tcg-enemy-front-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.tcg-enemy-stage-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
}

.tcg-enemy-scene.stage-2 .tcg-enemy-stage-tag {
    background: #ede9fe;
    color: #6d28d9;
}

.tcg-enemy-scene.stage-3 .tcg-enemy-stage-tag {
    background: #fef3c7;
    color: #b45309;
}

.tcg-enemy-portrait-big {
    width: 136px;
    height: 136px;
    filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.16));
    transition: transform 0.25s ease;
    animation: idleBob 3.4s ease-in-out infinite;
}

.tcg-enemy-scene:hover:not(.is-flipped) .tcg-enemy-portrait-big {
    transform: scale(1.07);
}

.tcg-enemy-scene.is-locked .tcg-enemy-portrait-big {
    animation: none;
    opacity: 0.78;
}

.tcg-enemy-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    color: #1e293b;
}

.tcg-enemy-front-foot {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
}

.tcg-tap-pill {
    font-size: 0.74rem;
    font-weight: 900;
    padding: 5px 11px;
    border-radius: 999px;
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.28);
}

.tcg-tap-pill.locked {
    background: #e2e8f0;
    color: #64748b;
    box-shadow: none;
}

/* Rückseite der Gegner-Karte (Details + Duell-Start) */
.tcg-enemy-back {
    padding: 14px;
    border: 3px solid #4f46e5;
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.2);
    justify-content: space-between;
    gap: 10px;
}

.tcg-enemy-scene.stage-3 .tcg-enemy-back {
    border-color: #d97706;
    background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%);
}

.tcg-enemy-scene.is-locked .tcg-enemy-back {
    border-color: #94a3b8;
    background: #ffffff;
}

.tcg-enemy-back-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tcg-enemy-back-id {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.tcg-enemy-mini-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.tcg-enemy-back-name {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
}

.tcg-enemy-role {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--le-ink-muted);
}

.tcg-enemy-quote-bubble {
    background: #ffffff;
    border: 1.5px solid rgba(79, 70, 229, 0.2);
    border-radius: 14px;
    padding: 9px 11px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.3;
    text-align: center;
}

.tcg-enemy-stats-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 900;
}

.tcg-stat-chip {
    padding: 5px 11px;
    border-radius: 999px;
    background: #ffffff;
    border: 1.5px solid var(--le-border);
    color: var(--le-ink);
}

.tcg-stat-chip.coins {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.tcg-badges-trio {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tcg-badge-slot {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tcg-badge-slot svg {
    width: 100%;
    height: 100%;
}

.tcg-btn-primary {
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.96rem;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
    transition: transform 0.14s ease, filter 0.14s ease;
}

.tcg-btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
}

.tcg-btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.tcg-btn-primary.full {
    width: 100%;
}

.tcg-btn-secondary {
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 14px;
    border: 2px solid #4f46e5;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 900;
    font-size: 0.94rem;
}

.tcg-ghost-btn {
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-surface);
    color: var(--le-ink);
    font-weight: 800;
    font-size: 0.86rem;
}

.tcg-ghost-btn.muted {
    color: var(--le-ink-muted);
    background: var(--le-bg-soft);
}

/* ---------- WEITERE WELTEN (KOMPAKTE FLIP-KÄRTCHEN) ---------- */

.tcg-worlds-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 680px) {
    .tcg-worlds-grid {
        grid-template-columns: 1fr;
    }
}

.tcg-world-scene {
    height: 118px;
}

.tcg-world-front {
    padding: 12px 14px;
    border: 2px dashed rgba(43, 33, 24, 0.2);
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.tcg-world-back {
    padding: 12px 14px;
    border: 2px solid rgba(43, 33, 24, 0.22);
    background: #ffffff;
    justify-content: space-between;
    text-align: left;
}

.tcg-world-ico {
    font-size: 2rem;
    line-height: 1;
}

.tcg-soon-tag {
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--le-ink-muted);
}

.tcg-world-front h3,
.tcg-world-back h3 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 900;
}

.tcg-world-back p {
    margin: 0;
    font-size: 0.76rem;
    color: var(--le-ink-muted);
    line-height: 1.3;
}

/* Deck-Galerie */
.tcg-combo-callout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #ede9fe 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    font-size: 0.86rem;
    margin-bottom: 14px;
}

.tcg-combo-ico {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.tcg-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}

.tcg-filter-pill {
    min-height: 40px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-surface);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--le-ink);
}

.tcg-filter-pill.is-active {
    background: var(--le-ink);
    border-color: var(--le-ink);
    color: #ffffff;
}

.tcg-deck-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 14px;
}

/* Shop Vorschau */
.tcg-shop-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    border: 1.5px solid rgba(217, 119, 6, 0.32);
    margin-bottom: 16px;
}

.tcg-shop-banner h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.tcg-shop-banner p {
    margin: 0;
    font-size: 0.88rem;
    max-width: 640px;
    color: #78350f;
}

.tcg-shop-wallet {
    background: rgba(255, 255, 255, 0.88);
    padding: 12px 18px;
    border-radius: 16px;
    text-align: center;
    border: 1.5px solid rgba(217, 119, 6, 0.25);
}

.tcg-shop-wallet span {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    color: #92400e;
}

.tcg-shop-wallet strong {
    font-size: 1.35rem;
    font-weight: 900;
}

.tcg-shop-toast {
    padding: 11px 16px;
    border-radius: 14px;
    background: #dcfce7;
    border: 1.5px solid #22c55e;
    color: #14532d;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 14px;
    animation: popIn 0.22s ease;
}

.tcg-shop-toast.is-err {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}

.tcg-shop-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
}

.tcg-shop-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border: 2px solid var(--le-border);
    border-radius: 20px;
    padding: 10px;
    box-shadow: var(--le-shadow-sm);
}

.tcg-shop-card-wrap.is-owned {
    border-color: #4ade80;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.tcg-shop-card-wrap.is-risk-wrap {
    border-color: rgba(239, 68, 68, 0.35);
}

.tcg-shop-buy-btn {
    min-height: 44px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 13px;
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.88rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.28);
    transition: transform 0.14s ease, filter 0.14s ease;
}

.tcg-shop-buy-btn:hover:not(:disabled) {
    filter: brightness(1.06);
}

.tcg-shop-buy-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.tcg-shop-buy-btn.is-owned {
    background: #dcfce7;
    color: #15803d;
    border: 1.5px solid #86efac;
    box-shadow: none;
    cursor: default;
}

.tcg-deck-toggle-btn {
    min-height: 36px;
    width: 100%;
    padding: 5px 10px;
    border-radius: 10px;
    border: 1.5px solid #4ade80;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.76rem;
    font-weight: 900;
}

.tcg-deck-toggle-btn.is-off {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
}

.tcg-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.tcg-pack-card {
    background: var(--le-surface);
    border: 2px dashed var(--le-border-strong);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tcg-pack-ico {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    background: var(--le-bg-soft);
}

.tcg-pack-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
}

.tcg-pack-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--le-ink-muted);
    flex: 1;
}

.tcg-pack-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--le-border);
    font-size: 0.82rem;
    font-weight: 800;
}

/* ==========================================================================
   2. LIEBEVOLLE 2D-SAMMELKARTEN (GALERIE, HAND & SPIELFELD)
   ========================================================================== */

.tcg-card {
    --card-color: #4f46e5;
    --card-soft: #eef2ff;
    --card-border: #818cf8;

    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, var(--card-soft) 100%);
    border: 2.5px solid var(--card-border);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.10);
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease, border-color 0.16s ease;
    user-select: none;
    overflow: hidden;
}

/* Feiner Holo-Glanz-Streifen auf seltenen Karten */
.tcg-card.rarity-rare::after,
.tcg-card.rarity-epic::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 30%, rgba(255, 255, 255, 0.45) 48%, transparent 64%);
    pointer-events: none;
    opacity: 0.65;
}

.tcg-card.type-Konter { --card-color: #dc2626; --card-soft: #fff5f5; --card-border: #f87171; }
.tcg-card.type-Blocker { --card-color: #2563eb; --card-soft: #eff6ff; --card-border: #60a5fa; }
.tcg-card.type-Heiler { --card-color: #16a34a; --card-soft: #f0fdf4; --card-border: #4ade80; }
.tcg-card.type-Verstaerker { --card-color: #7c3aed; --card-soft: #f5f3ff; --card-border: #a78bfa; }
.tcg-card.type-Helfer { --card-color: #0d9488; --card-soft: #f0fdfa; --card-border: #2dd4bf; }
.tcg-card.type-Stoerer { --card-color: #d97706; --card-soft: #fffbeb; --card-border: #fbbf24; }

.tcg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.tcg-card-title {
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.15;
    color: #1e293b;
}

.tcg-ap-gem {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    border: 2px solid #ffffff;
}

.tcg-card-art {
    width: 100%;
    aspect-ratio: 16 / 11;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.tcg-card-art svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tcg-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.69rem;
    font-weight: 800;
}

.tcg-card-type-pill {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--card-color);
    color: #ffffff;
}

.tcg-card-tag {
    color: #64748b;
}

.tcg-card.is-risk {
    border-color: #ef4444;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.16);
}

.tcg-risk-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 900;
}

.tcg-card-power-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    text-align: center;
    font-size: 0.72rem;
}

.tcg-pow-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 5px;
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    line-height: 1.15;
}

.tcg-pow-cell.fail {
    background: #f8fafc;
    color: #64748b;
}

.tcg-pow-cell.fail.is-risk {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.tcg-pow-cell.win {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.tcg-pow-lbl {
    font-size: 0.6rem;
    font-weight: 800;
    opacity: 0.85;
}

.tcg-pow-val {
    font-size: 0.74rem;
    font-weight: 900;
}

.tcg-prev-chip.risk {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.tcg-card-desc {
    font-size: 0.74rem;
    color: #475569;
    line-height: 1.3;
}

.tcg-card-copies {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-align: right;
}

/* Interaktive Handkarte */
.tcg-hand-card {
    text-align: left;
    cursor: pointer;
    min-height: 190px;
}

.tcg-hand-card.is-playable:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
    z-index: 4;
}

.tcg-hand-card.is-playable:active {
    transform: translateY(-2px) scale(0.98);
}

.tcg-hand-card.is-unaffordable {
    opacity: 0.56;
    filter: grayscale(0.28);
    cursor: not-allowed;
}

/* Gelegte Spielfeld-Karte */
.tcg-field-card {
    width: 158px;
    cursor: pointer;
    animation: cardDropIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.tcg-field-card .tcg-card-art {
    aspect-ratio: 16 / 9;
}

.tcg-field-card.can-be-target {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45), 0 10px 20px rgba(245, 158, 11, 0.25);
    animation: pulseTarget 0.9s infinite alternate;
}

.tcg-field-card.is-root-combo {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 8px 20px rgba(16, 185, 129, 0.25);
}

.tcg-field-badge {
    font-size: 0.69rem;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    text-align: center;
}

.tcg-field-badge.combo-x3 {
    background: linear-gradient(135deg, #10b981, #7c3aed);
    color: #ffffff;
}

.tcg-field-return-hint {
    font-size: 0.66rem;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}

/* ==========================================================================
   3. 2D-KAMPFARENA
   ========================================================================== */

.tcg-arena-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px 12px calc(32px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tcg-arena-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tcg-arena-top-left,
.tcg-arena-top-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.tcg-back-btn {
    min-height: 40px;
    padding: 7px 13px;
    border-radius: 12px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-surface);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--le-ink);
}

.tcg-pill {
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    background: var(--le-surface);
    border: 1.5px solid var(--le-border);
}

.tcg-pill.round-pill {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

.tcg-pill.tier-pill {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* 2D-Bühne (Klassenraum-Magie-Tafel) */
.tcg-stage {
    position: relative;
    border-radius: 24px;
    padding: 16px 16px 14px;
    background: radial-gradient(circle at 50% 25%, #234e52 0%, #1b3a4b 58%, #13293d 100%);
    border: 4px solid #b45309;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22), inset 0 0 40px rgba(0, 0, 0, 0.25);
    display: grid;
    grid-template-columns: 1fr minmax(210px, 1.15fr) 1fr;
    align-items: end;
    gap: 12px;
    overflow: hidden;
    min-height: 230px;
}

.tcg-stage.theme-deutsch {
    background: radial-gradient(circle at 50% 25%, #581c4f 0%, #3b1948 56%, #1e1b4b 100%);
    border-color: #d97706;
}

.tcg-stage.theme-geographie {
    background: radial-gradient(circle at 50% 25%, #0f766e 0%, #0e4a5a 56%, #0c2d48 100%);
    border-color: #14b8a6;
}

.tcg-stage.theme-englisch {
    background: radial-gradient(circle at 50% 25%, #1e3a8a 0%, #4c1d45 58%, #0f172a 100%);
    border-color: #f43f5e;
}

.tcg-stage-bg-symbols {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.tcg-stage-bg-symbols span {
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    font-weight: 900;
    font-size: 2.8rem;
    animation: floatSym 7s ease-in-out infinite;
}

.tcg-stage-bg-symbols span:nth-child(1) { top: 12%; left: 6%; animation-delay: 0s; }
.tcg-stage-bg-symbols span:nth-child(2) { top: 18%; left: 32%; animation-delay: 1.2s; }
.tcg-stage-bg-symbols span:nth-child(3) { top: 10%; right: 28%; animation-delay: 2.4s; }
.tcg-stage-bg-symbols span:nth-child(4) { bottom: 26%; left: 18%; animation-delay: 3.1s; }
.tcg-stage-bg-symbols span:nth-child(5) { bottom: 22%; right: 16%; animation-delay: 0.7s; }
.tcg-stage-bg-symbols span:nth-child(6) { top: 44%; left: 48%; animation-delay: 1.8s; }

/* Kämpfer-Podeste */
.tcg-combatant {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tcg-fighter-stage {
    position: relative;
    width: 118px;
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcg-fighter-avatar {
    position: relative;
    z-index: 2;
    width: 108px;
    height: 108px;
    animation: idleBob 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.32));
}

.tcg-fighter-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.player-avatar-box {
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #fde047, #38bdf8);
}

.player-avatar-box svg {
    border-radius: 50%;
    background: #ffffff;
}

.tcg-pedestal {
    position: absolute;
    bottom: -4px;
    width: 104px;
    height: 20px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.48);
    border: 2px solid rgba(255, 255, 255, 0.16);
    z-index: 1;
}

/* Glühende Schild-Kuppel */
.tcg-shield-dome {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3.5px solid #38bdf8;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 45%, rgba(56, 189, 248, 0.36) 100%);
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.65);
    z-index: 3;
    pointer-events: none;
    animation: shieldPulse 1.6s ease-in-out infinite;
}

/* Sprechblase */
.tcg-speech {
    background: #ffffff;
    color: #1e293b;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 6px 11px;
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    max-width: 210px;
    text-align: center;
    line-height: 1.25;
    position: relative;
}

.tcg-speech::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffffff transparent transparent;
}

/* HUD-Karte (Name + LP-Balken) */
.tcg-hud-card {
    width: 100%;
    max-width: 220px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 8px 10px;
    color: #ffffff;
}

.tcg-hud-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.84rem;
    margin-bottom: 5px;
}

.tcg-shield-chip {
    background: #0284c7;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 900;
}

.tcg-enemy-stage-chip {
    background: rgba(255, 255, 255, 0.16);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.tcg-hp-bar {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.tcg-hp-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-hp-fill {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.enemy-hp-fill {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.tcg-hp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Mitte: Attacken-Plakette */
.tcg-center-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    align-self: center;
}

.tcg-intent-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    color: #1e293b;
    border-radius: 18px;
    padding: 11px 13px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    border: 2.5px solid #fde047;
    text-align: center;
}

.tcg-intent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.tcg-intent-kicker {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.tcg-task-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
}

.tcg-task-badge.leicht {
    background: #dcfce7;
    color: #15803d;
}

.tcg-task-badge.zeit {
    background: #fef3c7;
    color: #b45309;
}

.tcg-task-badge.knifflig {
    background: #ffe4e6;
    color: #be123c;
}

.tcg-intent-name {
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 3px;
}

.tcg-intent-dmg-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tcg-intent-dmg {
    font-size: 0.96rem;
    font-weight: 900;
    color: #dc2626;
}

.tcg-intent-weakened {
    font-size: 0.78rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}

.tcg-intent-tip {
    font-size: 0.74rem;
    color: #475569;
    margin-top: 4px;
    font-weight: 700;
}

.tcg-live-banner {
    padding: 7px 14px;
    border-radius: 999px;
    background: #facc15;
    color: #451a03;
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: popIn 0.22s ease;
}

.tcg-live-banner.ok {
    background: #4ade80;
    color: #052e16;
}

.tcg-live-banner.miss {
    background: #fde68a;
    color: #78350f;
}

/* Effekt-Ebene */
.tcg-fx-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
}

.tcg-fx-orb {
    position: absolute;
    top: 45%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 0 22px currentColor;
}

.tcg-fx-orb.to-enemy {
    left: 18%;
    color: #fde047;
    background: radial-gradient(circle, #ffffff, #f59e0b);
    animation: flyToEnemy 0.55s cubic-bezier(0.3, 0.8, 0.4, 1) forwards;
}

.tcg-fx-orb.to-enemy.combo {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    color: #34d399;
    background: radial-gradient(circle, #ffffff, #10b981, #7c3aed);
}

.tcg-fx-orb.to-player {
    right: 18%;
    color: #fb7185;
    background: radial-gradient(circle, #ffffff, #ef4444);
    animation: flyToPlayer 0.55s cubic-bezier(0.3, 0.8, 0.4, 1) forwards;
}

.tcg-float-num {
    position: absolute;
    top: 30%;
    font-size: 1.55rem;
    font-weight: 900;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
    animation: floatUpFade 1.15s ease-out forwards;
    white-space: nowrap;
}

.tcg-float-num.enemy-pos { right: 14%; color: #fde047; }
.tcg-float-num.player-pos { left: 14%; color: #fb7185; }
.tcg-float-num.heal-pos { left: 16%; color: #4ade80; }
.tcg-float-num.shield-pos { left: 18%; color: #38bdf8; }

/* Spielfeld-Matte */
.tcg-playmat {
    background: var(--le-surface);
    border: 2px solid var(--le-border);
    border-radius: 20px;
    padding: 12px 14px;
    box-shadow: var(--le-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tcg-playmat-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tcg-ap-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    padding: 6px 12px;
    border-radius: 14px;
}

.tcg-ap-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e40af;
}

.tcg-ap-crystals {
    display: flex;
    gap: 5px;
}

.tcg-crystal {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transition: all 0.18s ease;
}

.tcg-crystal.bonus {
    background: linear-gradient(135deg, #fde047, #f59e0b);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.tcg-crystal.spent {
    background: #cbd5e1;
    box-shadow: none;
    transform: rotate(45deg) scale(0.8);
}

.tcg-ap-num {
    font-size: 0.84rem;
    font-weight: 900;
    color: #1e3a8a;
}

.tcg-preview-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 800;
}

.tcg-prev-hint {
    color: var(--le-ink-muted);
    font-weight: 700;
}

.tcg-prev-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--le-bg-soft);
}

.tcg-prev-chip.dmg { background: #fee2e2; color: #b91c1c; }
.tcg-prev-chip.sh { background: #dbeafe; color: #1d4ed8; }
.tcg-prev-chip.heal { background: #dcfce7; color: #15803d; }
.tcg-prev-chip.wk { background: #fef3c7; color: #92400e; }
.tcg-prev-chip.combo { background: linear-gradient(135deg, #10b981, #7c3aed); color: #ffffff; }

.tcg-ready-btn {
    min-height: 48px;
    padding: 11px 20px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.96rem;
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.34);
    transition: transform 0.14s ease, filter 0.14s ease;
}

.tcg-ready-btn:hover:not(:disabled) {
    filter: brightness(1.06);
}

.tcg-ready-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.tcg-amp-banner {
    padding: 8px 12px;
    border-radius: 12px;
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    color: #92400e;
    font-size: 0.84rem;
    text-align: center;
}

.tcg-field-zone {
    min-height: 112px;
    border: 2px dashed rgba(79, 70, 229, 0.22);
    border-radius: 16px;
    padding: 10px;
    background: linear-gradient(180deg, #faf8ff 0%, #f8fafc 100%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tcg-field-empty {
    color: var(--le-ink-soft);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
    padding: 12px;
}

/* Handkarten-Bereich */
.tcg-hand-section {
    background: var(--le-surface);
    border: 1.5px solid var(--le-border);
    border-radius: 20px;
    padding: 12px 14px 14px;
    box-shadow: var(--le-shadow-sm);
}

.tcg-hand-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.tcg-hand-hint {
    font-size: 0.76rem;
    color: var(--le-ink-muted);
}

.tcg-hand-zone {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}

/* ==========================================================================
   4. MODALS (AUFGABE, ERGEBNIS, HILFE)
   ========================================================================== */

.tcg-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.66);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow-y: auto;
}

.tcg-modal-card {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.35);
    position: relative;
    animation: popIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.tcg-task-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.tcg-task-attack-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--le-ink-muted);
}

.tcg-timer-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tcg-timer-track {
    flex: 1;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.tcg-timer-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #f59e0b);
    transition: width 0.25s linear;
}

.tcg-timer-fill.urgent {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.tcg-timer-num {
    font-weight: 900;
    font-size: 0.96rem;
    color: #b45309;
    min-width: 34px;
    text-align: right;
}

.tcg-task-question-box {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 18px;
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
}

.tcg-task-question-box h2 {
    margin: 0;
    font-size: clamp(1.15rem, 3.6vw, 1.45rem);
    font-weight: 900;
    line-height: 1.3;
}

.tcg-task-hint-box {
    margin-top: 10px;
    padding: 8px 11px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #fcd34d;
    font-size: 0.84rem;
    font-weight: 700;
    color: #92400e;
}

/* Schnelle 4-Antwort-Karten */
.tcg-choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.tcg-choices-grid.is-single-col {
    grid-template-columns: 1fr;
}

.tcg-choice-btn {
    min-height: 58px;
    padding: 11px 14px;
    border-radius: 16px;
    border: 2.5px solid #cbd5e1;
    background: #f8fafc;
    font-size: 1.15rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1.25;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.tcg-choice-btn.is-long {
    font-size: 0.94rem;
    font-weight: 800;
    text-align: left;
    min-height: 50px;
}

.tcg-choice-btn:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.tcg-choice-btn:active {
    transform: scale(0.96);
}

/* Touch-Zahlenfeld */
.tcg-answer-display-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tcg-answer-input {
    flex: 1;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 2px solid #94a3b8;
    font-size: 1.25rem;
    font-weight: 900;
    text-align: center;
    background: #f8fafc;
    color: #0f172a;
}

.tcg-answer-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
}

.tcg-submit-btn {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 14px;
    border: none;
    background: #16a34a;
    color: #ffffff;
    font-weight: 900;
    font-size: 1rem;
}

.tcg-keypad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.tcg-key {
    min-height: 48px;
    border-radius: 13px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font-size: 1.15rem;
    font-weight: 900;
    color: #1e293b;
    box-shadow: 0 2px 0 #cbd5e1;
}

.tcg-key:active {
    transform: translateY(2px);
    box-shadow: none;
}

.tcg-key.wide {
    grid-column: span 2;
}

.tcg-key.fn {
    background: #f1f5f9;
    color: #475569;
}

.tcg-key.ok {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
    box-shadow: 0 2px 0 #15803d;
}

.tcg-task-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

/* Ergebnis-Modal */
.result-modal {
    text-align: center;
}

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

.tcg-confetti-piece {
    position: absolute;
    top: -12px;
    width: 10px;
    height: 14px;
    border-radius: 3px;
    animation: confettiFall 2.2s linear forwards;
}

.tcg-result-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.tcg-result-teacher {
    width: 134px;
    height: 134px;
    animation: happyBounce 1.4s ease-in-out infinite;
}

.tcg-result-teacher svg {
    width: 100%;
    height: 100%;
}

.tcg-result-badge-pop {
    position: absolute;
    right: 16%;
    bottom: 2px;
    width: 58px;
    height: 58px;
    animation: popIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 6px 12px rgba(217, 119, 6, 0.35));
}

.result-modal h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 900;
}

.tcg-result-quote {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    font-size: 0.92rem;
    font-weight: 700;
    color: #14532d;
}

.result-modal.is-loss .tcg-result-quote {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}

.tcg-result-rewards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tcg-reward-chip {
    padding: 8px 14px;
    border-radius: 14px;
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    font-weight: 900;
    font-size: 0.9rem;
    color: #92400e;
}

.tcg-reward-chip.badge-new {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #5b21b6;
}

.tcg-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.tcg-rstat {
    background: var(--le-surface-alt);
    border: 1px solid var(--le-border);
    border-radius: 12px;
    padding: 8px 6px;
}

.tcg-rstat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
}

.tcg-rstat small {
    font-size: 0.72rem;
    color: var(--le-ink-muted);
    font-weight: 700;
}

.tcg-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Hilfe- & Visuelles Karten-Tutorial-Modal */
.help-modal {
    max-width: 640px;
}

.tcg-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.tcg-modal-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.tcg-tut-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.tcg-tut-tab {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 13px;
    border: 1.5px solid var(--le-border-strong);
    background: var(--le-bg-soft);
    color: var(--le-ink-muted);
    font-weight: 900;
    font-size: 0.85rem;
}

.tcg-tut-tab.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.tcg-tut-sample-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--le-ink-muted);
    margin-bottom: 12px;
}

.tcg-tut-chip {
    min-height: 36px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--le-border-strong);
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--le-ink);
}

.tcg-tut-chip.is-active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.tcg-tut-anatomie {
    display: grid;
    grid-template-columns: 205px 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

@media (max-width: 580px) {
    .tcg-tut-anatomie {
        grid-template-columns: 1fr;
    }

    .tcg-tut-card-preview {
        max-width: 225px;
        margin: 0 auto;
    }
}

.tcg-tut-card-preview {
    position: relative;
    padding: 8px;
}

.tcg-tut-pin {
    position: absolute;
    z-index: 5;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.tcg-tut-pin.p1 { top: 2px; right: 2px; background: #2563eb; }
.tcg-tut-pin.p2 { top: 56%; left: 0; background: #7c3aed; }
.tcg-tut-pin.p3 { bottom: 38px; left: 2px; background: #dc2626; }
.tcg-tut-pin.p4 { bottom: 38px; right: 2px; background: #16a34a; }

.tcg-tut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.tcg-tut-legend li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--le-surface-alt);
    border: 1px solid var(--le-border);
    border-radius: 12px;
    padding: 8px 10px;
}

.tcg-tut-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.tcg-tut-num.n1 { background: #2563eb; }
.tcg-tut-num.n2 { background: #7c3aed; }
.tcg-tut-num.n3 { background: #dc2626; }
.tcg-tut-num.n4 { background: #16a34a; }

.tcg-help-list {
    margin: 0 0 16px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    line-height: 1.4;
}

/* ==========================================================================
   5. ANIMATIONEN & RESPONSIVE FEINSCHLIFF
   ========================================================================== */

.anim-shake {
    animation: hitShake 0.42s ease !important;
}

.anim-lunge-right {
    animation: lungeRight 0.35s ease !important;
}

.anim-lunge-left {
    animation: lungeLeft 0.35s ease !important;
}

.anim-heal-glow {
    animation: healGlow 0.7s ease !important;
}

@keyframes idleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes happyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.03); }
}

@keyframes floatSym {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(8deg); }
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.04); opacity: 1; }
}

@keyframes pulseTarget {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}

@keyframes cardDropIn {
    from { opacity: 0; transform: translateY(14px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes hitShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-9px) rotate(-4deg); }
    45% { transform: translateX(9px) rotate(4deg); }
    70% { transform: translateX(-5px); }
}

@keyframes lungeRight {
    0%, 100% { transform: translateX(0); }
    45% { transform: translateX(26px) scale(1.06); }
}

@keyframes lungeLeft {
    0%, 100% { transform: translateX(0); }
    45% { transform: translateX(-26px) scale(1.06); }
}

@keyframes healGlow {
    0%, 100% { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3)); }
    50% { filter: drop-shadow(0 0 22px #4ade80); }
}

@keyframes flyToEnemy {
    0% { left: 16%; transform: scale(0.7); opacity: 1; }
    65% { transform: scale(1.25) translateY(-18px); opacity: 1; }
    100% { left: 78%; transform: scale(0.9); opacity: 0; }
}

@keyframes flyToPlayer {
    0% { right: 16%; transform: scale(0.7); opacity: 1; }
    65% { transform: scale(1.2) translateY(-14px); opacity: 1; }
    100% { right: 78%; transform: scale(0.9); opacity: 0; }
}

@keyframes floatUpFade {
    0% { opacity: 0; transform: translateY(12px) scale(0.8); }
    20% { opacity: 1; transform: translateY(0) scale(1.12); }
    100% { opacity: 0; transform: translateY(-48px) scale(0.95); }
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

/* Mobile & Tablet Anpassungen */
@media (max-width: 820px) {
    .tcg-stage {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "intent intent"
            "player enemy";
        padding: 12px;
        gap: 10px;
    }

    .tcg-center-info {
        grid-area: intent;
    }

    .tcg-combatant.player-side {
        grid-area: player;
    }

    .tcg-combatant.enemy-side {
        grid-area: enemy;
    }

    .tcg-fighter-stage {
        width: 92px;
        height: 92px;
    }

    .tcg-fighter-avatar {
        width: 84px;
        height: 84px;
    }

    .tcg-pedestal {
        width: 82px;
        height: 16px;
    }

    .tcg-playmat-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tcg-ready-btn {
        width: 100%;
    }

    .tcg-hand-zone {
        grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    }

    .tcg-field-card {
        width: 142px;
    }
}

@media (max-width: 480px) {
    .tcg-topbar-right {
        padding-right: 42px;
    }

    .tcg-speech {
        font-size: 0.7rem;
        padding: 5px 8px;
    }

    .tcg-hand-zone {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .tcg-card-title {
        font-size: 0.78rem;
    }
}
