/* ===========================================
   SPIELREGELN PAGE - GSAP Card Animations
   =========================================== */

/* -----------------------------------------
   HERO CARDS (Floating Animation)
   ----------------------------------------- */
.spielregeln-hero {
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.hero-cards {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-card {
    position: absolute;
    width: 80px;
    height: 120px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(100px) rotate(0deg);
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    border-radius: 8px 8px 0 0;
}

.hero-card-1::before { background: #f5a623; }
.hero-card-2::before { background: #f5a623; }
.hero-card-3::before { background: #4CAF50; }
.hero-card-4::before { background: #4CAF50; }

.hero-card-1 { left: 5%; top: 20%; }
.hero-card-2 { left: 12%; top: 50%; }
.hero-card-3 { right: 5%; top: 20%; }
.hero-card-4 { right: 12%; top: 50%; }

.spielregeln-hero h1,
.spielregeln-hero p {
    position: relative;
    z-index: 1;
}

/* -----------------------------------------
   MATCHING DEMO (Interactive Animation)
   ----------------------------------------- */
.matching-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 3rem 1rem 4rem;
    margin: 2rem auto;
    max-width: 700px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    position: relative;
}

.demo-stapel {
    perspective: 1000px;
}

.demo-card {
    width: 100px;
    height: 150px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-card:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: #f5a623;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 8px;
    text-align: left;
}

.card-word {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
}

.card-footer {
    background: #f5a623;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 8px;
    text-align: right;
    transform: rotate(180deg);
}

/* Vowel colors */
.demo-card[data-vowel="a"] .card-header,
.demo-card[data-vowel="a"] .card-footer { background: #f5a623; }

.demo-card[data-vowel="e"] .card-header,
.demo-card[data-vowel="e"] .card-footer { background: #e53935; }

.demo-card[data-vowel="i"] .card-header,
.demo-card[data-vowel="i"] .card-footer { background: #4CAF50; }

.demo-card[data-vowel="o"] .card-header,
.demo-card[data-vowel="o"] .card-footer { background: #2196F3; }

.demo-card[data-vowel="u"] .card-header,
.demo-card[data-vowel="u"] .card-footer { background: #9C27B0; }

/* Stack card styling */
.demo-card-stack {
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        4px 4px 0 -2px white,
        4px 4px 0 0 rgba(0, 0, 0, 0.1),
        8px 8px 0 -2px white,
        8px 8px 0 0 rgba(0, 0, 0, 0.08);
}

/* Hand cards */
.demo-hand {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.demo-card-option {
    opacity: 0;
    transform: translateY(50px);
    cursor: pointer;
    overflow: visible;
}

/* Match badge */
.match-badge {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-badge.nomatch {
    background: #e53935;
}

.demo-card-option.show-match .match-badge {
    opacity: 1;
}

/* Highlight matching cards */
.demo-card-option.highlight {
    box-shadow: 0 0 0 3px #4CAF50, 0 15px 35px rgba(76, 175, 80, 0.3);
}

.demo-card-option.highlight-fail {
    box-shadow: 0 0 0 3px #e53935, 0 15px 35px rgba(229, 57, 53, 0.2);
    opacity: 0.6;
}

/* Replay button */
.demo-replay {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease;
    opacity: 0;
    margin-top: 1rem;
}

.demo-replay:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.demo-replay span {
    font-size: 1.2rem;
}

/* -----------------------------------------
   REGEL-KARTEN (Scroll Reveal)
   ----------------------------------------- */
.regel-karten {
    opacity: 1;
}

.regel-karte {
    opacity: 0;
    transform: translateY(30px);
}

.regel-karte.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------
   SPIELVARIANTEN (Stagger Reveal)
   ----------------------------------------- */
.variante {
    opacity: 0;
    transform: translateX(-20px);
}

.variante.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* -----------------------------------------
   FAQ ITEMS (Accordion Animation)
   ----------------------------------------- */
.faq-item {
    opacity: 0;
    transform: translateY(20px);
}

.faq-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------
   RESPONSIVE
   ----------------------------------------- */
@media (max-width: 768px) {
    .hero-card {
        width: 60px;
        height: 90px;
        font-size: 0.8rem;
    }

    .hero-card-1 { left: 2%; top: 10%; }
    .hero-card-2 { left: 8%; top: 60%; }
    .hero-card-3 { right: 2%; top: 10%; }
    .hero-card-4 { right: 8%; top: 60%; }

    .demo-card {
        width: 80px;
        height: 120px;
    }

    .card-word {
        font-size: 1.1rem;
    }

    .demo-hand {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-cards {
        display: none;
    }

    .matching-demo {
        padding: 1.5rem 0.5rem;
    }

    .demo-card {
        width: 70px;
        height: 105px;
    }

    .card-header,
    .card-footer {
        padding: 4px 6px;
        font-size: 0.6rem;
    }

    .card-word {
        font-size: 1rem;
    }
}

/* ===========================================
   MAU-MAU SECTION STYLES
   =========================================== */

/* Section subtitle */
.section-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Mau-Mau Playing Cards */
.maumau-card {
    width: 80px;
    height: 112px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.maumau-card:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    line-height: 1;
}

.card-corner.top-left {
    top: 4px;
    left: 6px;
}

.card-corner.bottom-right {
    bottom: 4px;
    right: 6px;
    transform: rotate(180deg);
}

.corner-wert {
    font-weight: 700;
    font-size: 0.9rem;
}

.card-center {
    font-size: 2rem;
}

/* Card colors */
.maumau-card[data-farbe="herz"] .corner-symbol,
.maumau-card[data-farbe="herz"] .card-center { color: #e53935; }

.maumau-card[data-farbe="karo"] .corner-symbol,
.maumau-card[data-farbe="karo"] .card-center { color: #e53935; }

.maumau-card[data-farbe="pik"] .corner-symbol,
.maumau-card[data-farbe="pik"] .card-center { color: #333; }

.maumau-card[data-farbe="kreuz"] .corner-symbol,
.maumau-card[data-farbe="kreuz"] .card-center { color: #333; }

.maumau-card[data-farbe="herz"] .corner-wert { color: #e53935; }
.maumau-card[data-farbe="karo"] .corner-wert { color: #e53935; }
.maumau-card[data-farbe="pik"] .corner-wert { color: #333; }
.maumau-card[data-farbe="kreuz"] .corner-wert { color: #333; }

/* Stack card */
.maumau-card-stack {
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.15),
        3px 3px 0 -1px white,
        3px 3px 0 0 rgba(0, 0, 0, 0.1),
        6px 6px 0 -1px white,
        6px 6px 0 0 rgba(0, 0, 0, 0.08);
}

/* Option cards */
.maumau-card-option {
    opacity: 0;
    transform: translateY(40px);
}

.maumau-card-option .match-badge {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
}

.maumau-card-option .match-badge.nomatch {
    background: #e53935;
}

.maumau-card-option.show-match .match-badge {
    opacity: 1;
}

.maumau-card-option.highlight {
    box-shadow: 0 0 0 3px #4CAF50, 0 12px 25px rgba(76, 175, 80, 0.3);
}

.maumau-card-option.highlight-fail {
    box-shadow: 0 0 0 3px #e53935;
    opacity: 0.6;
}

/* Sonderregeln Grid */
.sonderregeln-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.sonderregel-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
    opacity: 0;
    transform: translateY(20px);
}

.sonderregel-card.sieben { border-left-color: #e53935; }
.sonderregel-card.acht { border-left-color: #FF9800; }
.sonderregel-card.bube { border-left-color: #9C27B0; }
.sonderregel-card.ass { border-left-color: #4CAF50; }
.sonderregel-card.dame { border-left-color: #E91E63; }
.sonderregel-card.koenig { border-left-color: #FFC107; }

.sonderregel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.sonderregel-karte {
    width: 40px;
    height: 56px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    flex-shrink: 0;
}

.sonderregel-card.sieben .sonderregel-karte { border-color: #e53935; color: #e53935; }
.sonderregel-card.acht .sonderregel-karte { border-color: #FF9800; color: #FF9800; }
.sonderregel-card.bube .sonderregel-karte { border-color: #9C27B0; color: #9C27B0; }
.sonderregel-card.ass .sonderregel-karte { border-color: #4CAF50; color: #4CAF50; }
.sonderregel-card.dame .sonderregel-karte { border-color: #E91E63; color: #E91E63; }
.sonderregel-card.koenig .sonderregel-karte { border-color: #FFC107; color: #FFC107; }

.sonderregel-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.sonderregel-card > p {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    line-height: 1.6;
}

.sonderregel-detail {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Zusatzregeln */
.zusatzregeln {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.zusatzregel {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
}

.zusatzregel h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.zusatzregel p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Varianten Liste */
.varianten-liste {
    margin: 1.5rem 0;
}

.variante-detail {
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
}

.variante-detail summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.variante-detail summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

.variante-detail[open] summary::after {
    content: '−';
}

.variante-detail summary::-webkit-details-marker {
    display: none;
}

.variante-detail p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Vergleich Tabelle */
.vergleich-tabelle {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.vergleich-tabelle th,
.vergleich-tabelle td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.vergleich-tabelle th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.vergleich-tabelle th:first-child {
    border-radius: 8px 0 0 0;
}

.vergleich-tabelle th:last-child {
    border-radius: 0 8px 0 0;
}

.vergleich-tabelle tbody tr:hover {
    background: var(--bg-light);
}

.vergleich-tabelle td:first-child {
    font-weight: 600;
    color: var(--text-muted);
}

.vergleich-fazit {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f4fc 0%, #d4edda 100%);
    border-radius: 8px;
    text-align: center;
}

/* Mau-Mau FAQ */
.maumau-faq .faq-item {
    opacity: 0;
    transform: translateY(20px);
}

/* Responsive */
@media (max-width: 768px) {
    .maumau-card {
        width: 65px;
        height: 91px;
    }

    .card-center {
        font-size: 1.5rem;
    }

    .corner-wert {
        font-size: 0.75rem;
    }

    .sonderregeln-grid {
        grid-template-columns: 1fr;
    }

    .vergleich-tabelle {
        font-size: 0.85rem;
    }

    .vergleich-tabelle th,
    .vergleich-tabelle td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .maumau-card {
        width: 55px;
        height: 77px;
    }

    .card-center {
        font-size: 1.2rem;
    }

    .card-corner {
        font-size: 0.55rem;
    }

    .corner-wert {
        font-size: 0.65rem;
    }

    .sonderregel-karte {
        width: 32px;
        height: 45px;
        font-size: 1rem;
    }

    /* Vergleich-Tabelle scrollbar auf Mobile */
    .vergleich-box {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vergleich-tabelle {
        min-width: 400px;
        font-size: 0.8rem;
    }

    .vergleich-tabelle th,
    .vergleich-tabelle td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .vergleich-tabelle td:last-child {
        white-space: normal;
        min-width: 100px;
    }
}
