:root {
    --green-felt: #2e7d32;
    --card-white: #ffffff;
    --card-red: #d32f2f;
    --card-black: #212121;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1b5e20;
    color: white;
    text-align: center;
    overflow-x: hidden;
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--green-felt);
    min-height: 100vh;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
}

#scoreboard {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    display: inline-block;
}

.hidden { display: none !important; }

#setup-screen {
    margin-top: 20px;
}

.intro-box {
    max-width: 600px;
    margin: 0 auto 30px auto;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    text-align: left;
    line-height: 1.6;
    font-size: 1rem;
}

.intro-box p {
    margin-bottom: 15px;
}

#setup-screen button {
    display: block;
    margin: 10px auto;
    padding: 15px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    background: #fff;
    border: none;
    border-radius: 8px;
    transition: transform 0.2s;
}

#setup-screen button:hover { transform: scale(1.05); background: #eee; }

#table {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

#deck-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    height: 180px;
}

/* Karten-Design */
.card {
    width: 90px;
    height: 140px;
    flex-shrink: 0;
    background: var(--card-white);
    border-radius: 10px;
    color: var(--card-black);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: box-shadow 0.2s;
}

.card.back {
    background: #c62828;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
    border: 5px solid white;
    color: white;
}

.card.red { color: var(--card-red); }
.card.joker { background: #ffd54f; color: #000; }

.card-suit { font-size: 2.2rem; }
.card-rank-top { position: absolute; top: 5px; left: 5px; font-size: 1rem; }
.card-rank-bottom { position: absolute; bottom: 5px; right: 5px; font-size: 1rem; transform: rotate(180deg); }

#hand {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
    min-height: 200px;
    padding: 20px;
    background: rgba(0,0,0,0.1);
    border-radius: 15px;
    overflow-x: auto;
}

#hand .card:active { transform: translateY(-10px); }

/* Highlight für die neu gezogene Karte */
.new-card {
    border: 3px solid gold !important;
    box-shadow: 0 0 20px gold;
    z-index: 10;
}

/* Karten, die Teil einer Kombination sind */
.combined {
    transform: translateY(-15px);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    border: 2px solid #4caf50;
}

/* Animation für fliegende Karten */
.flying-card {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Joker Schock Effekt */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg) scale(2.5); }
    10% { transform: translate(-1px, -2px) rotate(-1deg) scale(2.5); }
    20% { transform: translate(-3px, 0px) rotate(1deg) scale(2.5); }
    30% { transform: translate(3px, 2px) rotate(0deg) scale(2.5); }
    40% { transform: translate(1px, -1px) rotate(1deg) scale(2.5); }
    50% { transform: translate(-1px, 2px) rotate(-1deg) scale(2.5); }
    60% { transform: translate(-3px, 1px) rotate(0deg) scale(2.5); }
    70% { transform: translate(3px, 1px) rotate(-1deg) scale(2.5); }
    80% { transform: translate(-1px, -1px) rotate(1deg) scale(2.5); }
    90% { transform: translate(1px, 2px) rotate(0deg) scale(2.5); }
    100% { transform: translate(1px, -2px) rotate(-1deg) scale(2.5); }
}

.joker-shock {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -100px;
    margin-left: -60px;
    z-index: 2000;
    animation: shake 0.5s infinite;
    box-shadow: 0 0 100px rgba(0,0,0,0.9);
    pointer-events: none;
    transform-origin: center;
    border: 5px solid gold;
    background: #fff9c4;
}

.joker-shock span {
    font-size: 5rem;
}

/* Sieg-Feier Animation */
@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: gold;
    z-index: 1500;
    animation: confetti-fall 3s linear forwards;
}

.victory-glow {
    text-shadow: 0 0 20px gold, 0 0 40px orange;
    transform: scale(1.5);
    display: inline-block;
    animation: pulse-gold 1s infinite alternate;
}

@keyframes pulse-gold {
    from { transform: scale(1.2); }
    to { transform: scale(1.4); }
}

/* Joker Spott-Lachen */
@keyframes laugh-popup {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

.joker-laugh {
    position: fixed;
    font-size: 3rem;
    z-index: 1600;
    font-weight: bold;
    color: #c62828;
    text-shadow: 2px 2px 5px black;
    animation: laugh-popup 0.5s ease-out forwards;
    pointer-events: none;
}

/* Pulsierender Ziehstapel Hinweis */
@keyframes pulse-highlight {
    0% { box-shadow: 0 0 5px gold; transform: scale(1); }
    50% { box-shadow: 0 0 30px gold; transform: scale(1.05); }
    100% { box-shadow: 0 0 5px gold; transform: scale(1); }
}

.pulse-draw {
    animation: pulse-highlight 1.5s infinite ease-in-out;
    border: 3px solid gold !important;
}

#game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 50px;
    border-radius: 20px;
    border: 2px solid white;
    z-index: 100;
}
