/* --- PREMIUM MATTE OBSIDIAN & BIER-GOLD DESIGN SYSTEM --- */

:root {
    /* Farbpalette - Casino Schwarz & WeiÃŸ */
    --bg-obsidian: #000000;
    --bg-surface: rgba(14, 14, 16, 0.95);
    --bg-control: rgba(26, 26, 30, 0.9);
    
    /* Akzente - Casino Gold & Bernstein */
    --beer-gold: #d4a359;
    --beer-gold-rgb: 212, 163, 89;
    --amber-glow: #b8863b;
    --amber-glow-rgb: 184, 134, 59;
    --system-red: #ff453a;
    --system-green: #30d158;
    
    /* Typografie & Rahmen */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-tertiary: rgba(255, 255, 255, 0.3);
    
    --font-family-premium: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --border-glass-gold: 1.5px solid var(--beer-gold);
    --border-glass-white: 1.5px solid rgba(255, 255, 255, 0.3);
    --blur-glass: blur(15px);
}

/* Reset und Kern-Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: var(--font-family-premium);
    font-size: clamp(14px, 2.2vw, 16px);
    line-height: 1.4;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-text-size-adjust: 100%;
}

/* Scrollleisten-Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* Layout-Shell */
.layout-root {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    background: transparent !important;
}

/* scrollbarer Bereich */
.app-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
    background: transparent !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.start-page-content {
    padding-top: 0;
}

/* Statusplakette aktive Lobbys - Statusplakette oben links */
.active-lobbies-badge {
    position: fixed;
    top: clamp(10px, 2.5vw, 20px);
    left: clamp(10px, 2.5vw, 20px);
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 163, 89, 0.3);
    border-radius: 99px;
    padding: clamp(5px, 1.2vw, 8px) clamp(10px, 2vw, 16px);
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.2vw, 8px);
    z-index: 120;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.active-lobbies-badge:hover {
    background: rgba(18, 18, 22, 0.95);
    border-color: rgba(212, 163, 89, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.active-lobbies-badge .pulse-dot {
    width: 9px;
    height: 9px;
    background-color: var(--beer-gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--beer-gold);
    animation: goldPulse 2s infinite ease-in-out;
}

.active-lobbies-badge .badge-text {
    font-size: clamp(0.65rem, 1.8vw, 0.82rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--beer-gold);
}

@keyframes goldPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Header-Navigationsleiste - Komplett transparent, Logo zentriert, schwebende Elemente */
.app-header {
    background: transparent;
    border-bottom: none;
    position: relative;
    z-index: 50;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: clamp(1vh, 2.5vh, 3vh);
    margin-bottom: clamp(0.5vh, 1.5vh, 2vh);
}

.header-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 clamp(8px, 2.5vw, 16px);
    box-sizing: border-box;
    min-height: clamp(50px, 10vw, 80px);
}

.header-back-wrapper {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.header-back-btn {
    margin: 0;
    background: rgba(28, 26, 22, 0.7);
    border: 1px solid rgba(212, 163, 89, 0.35);
    border-radius: 20px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--beer-gold);
    cursor: pointer;
    font-family: var(--font-family-premium);
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.header-back-btn:hover {
    background: rgba(212, 163, 89, 0.15);
    border-color: var(--beer-gold);
    transform: scale(1.03);
}

.header-back-btn svg {
    fill: var(--beer-gold);
    width: 18px;
    height: 18px;
}

/* Benutzer-Sideboard-Styling - Kapselplakette oben rechts */
.player-sideboard {
    position: fixed;
    right: clamp(10px, 2.5vw, 20px);
    top: clamp(10px, 2.5vw, 20px);
    z-index: 150;
    background: rgba(28, 26, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--beer-gold);
    border-radius: 30px;
    padding: clamp(6px, 1.5vw, 10px) clamp(12px, 3vw, 22px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(212, 163, 89, 0.15);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: calc(100vw - 20px);
}

.player-sideboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 163, 89, 0.3);
}

.player-sideboard .sideboard-title {
    font-size: clamp(0.6rem, 1.6vw, 0.75rem);
    font-weight: 800;
    color: var(--beer-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    padding-right: clamp(6px, 1.5vw, 10px);
}

.player-sideboard .sideboard-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-sideboard .sideboard-name {
    color: #ffffff;
    font-size: clamp(0.85rem, 2.5vw, 1.15rem);
    font-weight: 800;
    font-family: var(--font-family-premium);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: clamp(80px, 25vw, 200px);
}

/* Linker Sideboard-Wrapper - Beherbergt sowohl die Spielstandsanzeige als auch die aktiven Fallen in einem Flex-Stack */
.left-sideboard-wrapper {
    position: fixed;
    left: 0;
    top: 15%;
    z-index: 100;
    width: clamp(180px, 16vw, 240px);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vw, 16px);
    pointer-events: none;
}

/* Deckelstands-Sideboard-Styling - Linke Seite, Gold-Design (vergrÃ¶ÃŸerte Breite) */
.score-sideboard {
    width: 100%;
    background: linear-gradient(135deg, rgba(28, 26, 22, 0.95) 0%, rgba(20, 20, 22, 0.95) 100%);
    border-right: 2px solid var(--beer-gold);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    padding: clamp(10px, 1.5vw, 16px) clamp(12px, 2vw, 20px) clamp(10px, 1.5vw, 16px) clamp(14px, 2vw, 22px);
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(8px, 1.2vw, 14px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: auto;
}

.score-sideboard:hover {
    transform: translateX(4px);
    box-shadow: 6px 6px 25px rgba(255, 255, 255, 0.08);
}

.score-sideboard .sideboard-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--beer-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.score-sideboard .team-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-sideboard .team-points {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--beer-gold);
    transition: all 0.2s ease;
    display: inline-block;
}

/* Deckelstands-Animationen */
@keyframes pointsFlashGreen {
    0% {
        color: #22c55e;
        text-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
        transform: scale(1.15);
    }
    100% {
        color: var(--beer-gold);
        text-shadow: none;
        transform: scale(1);
    }
}

@keyframes pointsFlashRed {
    0% {
        color: #ef4444;
        text-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
        transform: scale(1.15);
    }
    100% {
        color: var(--beer-gold);
        text-shadow: none;
        transform: scale(1);
    }
}

@keyframes rowFlashGreen {
    0% {
        background-color: rgba(34, 197, 94, 0.15);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes rowFlashRed {
    0% {
        background-color: rgba(239, 68, 68, 0.15);
    }
    100% {
        background-color: transparent;
    }
}

.score-sideboard .team-points.animate-points-up {
    animation: pointsFlashGreen 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.score-sideboard .team-points.animate-points-down {
    animation: pointsFlashRed 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sideboard-team-row.animate-points-up {
    animation: rowFlashGreen 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sideboard-team-row.animate-points-down {
    animation: rowFlashRed 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Aktive-Fallen-Panel (Linke Seite, unter der Deckeltabelle gestapelt) */
.active-traps-container {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vw, 10px);
    width: 100%;
    pointer-events: auto;
}

/* Dezente ZurÃ¼ck-Taste - Dimmere, kleinere SekundÃ¤rtasten, um versehentliche Klicks zu vermeiden */
.back-button-subtle {
    /* Unifiziert mit button-token */
}

.active-trap-card {
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, rgba(28, 26, 22, 0.95) 0%, rgba(20, 20, 22, 0.95) 100%);
    border-right: 1.5px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(5px, 1vw, 8px) clamp(8px, 1.2vw, 12px) clamp(5px, 1vw, 8px) clamp(10px, 1.5vw, 16px);
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.active-trap-card:hover {
    transform: translateX(4px);
    box-shadow: 6px 6px 20px rgba(255, 255, 255, 0.05);
}

.trap-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 140px;
}

.trap-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.trap-card-owner {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trap-card-actions {
    display: flex;
    gap: 6px;
}

.trap-card-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.trap-card-btn.caught {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #ef4444;
}

.trap-card-btn.caught:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.1);
}

.trap-card-btn.survived {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.6);
    color: #22c55e;
}

.trap-card-btn.survived:hover {
    background: #22c55e;
    color: #ffffff;
    transform: scale(1.1);
}

.user-badge-dot {
    width: 9px;
    height: 9px;
    background-color: #55efc4;
    border-radius: 50%;
    display: inline-block;
    animation: userBadgePulse 2s infinite ease-in-out;
}

@keyframes userBadgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(85, 239, 196, 0.4);
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 0 6px rgba(85, 239, 196, 0);
    }
}

/* Eigene vektoranimierte Logo-Elemente */
.logo-svg-container {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(var(--beer-gold-rgb), 0.35));
}

.logo-glass {
    fill: none;
    stroke: var(--beer-gold);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-beer-fill {
    fill: url(#logoGoldGrad);
}

.logo-beer-bubble {
    fill: #ffffff;
    opacity: 0.7;
    animation: logoRisingBubble 3s infinite linear;
}

.logo-beer-bubble-3d {
    fill: #ffffff;
    opacity: 0.6;
    animation: logoRisingBubble3D 2.5s infinite linear;
    transform-origin: center bottom;
}

.logo-foam {
    fill: #ffffff;
    animation: logoFoamWave 4s infinite ease-in-out alternate;
}

.logo-foam-3d {
    animation: logoFoamBreathing 3s infinite ease-in-out alternate;
    transform-origin: 46px 28px;
}

@keyframes logoRisingBubble {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-16px); opacity: 0; }
}

@keyframes logoRisingBubble3D {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    15% { opacity: 0.8; }
    85% { opacity: 0.8; }
    100% { transform: translateY(-45px) scale(1.1); opacity: 0; }
}

@keyframes logoFoamWave {
    0% { transform: translateX(-1px) rotate(-1deg); }
    100% { transform: translateX(1px) rotate(1deg); }
}

@keyframes logoFoamBreathing {
    0% { transform: scale(1); }
    100% { transform: scale(1.02) translateY(-0.8px); }
}

/* Obsidian-Ambient-Hintergrund-Lichtfluss */
.ios-ambient-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-obsidian);
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.ios-blob {
    position: absolute;
    width: 70vw;
    height: 70vw;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform;
}

.blob-1 {
    background: radial-gradient(circle, var(--beer-gold) 0%, transparent 80%);
    top: -25vh;
    left: -15vw;
    animation: driftBlob1 40s infinite alternate ease-in-out;
}

.blob-2 {
    background: radial-gradient(circle, var(--amber-glow) 0%, transparent 80%);
    bottom: -35vh;
    right: -15vw;
    animation: driftBlob2 45s infinite alternate ease-in-out;
}

.blob-3 {
    background: radial-gradient(circle, #5e5ce6 0%, transparent 80%);
    top: 40vh;
    left: 35vw;
    width: 50vw;
    height: 50vw;
    opacity: 0.04;
    animation: driftBlob3 35s infinite alternate ease-in-out;
}

@keyframes driftBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20vw, 15vh) scale(1.3); }
}

@keyframes driftBlob2 {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(-20vw, -15vh) scale(0.85); }
}

@keyframes driftBlob3 {
    0% { transform: translate(0, 0) scale(0.9); }
    100% { transform: translate(-10vw, 10vh) scale(1.2); }
}

/* Landingpage-MittelstÃ¼ck Squircle-App-Symbol */
.ios-app-icon-logo {
    width: clamp(70px, 18vw, 110px);
    height: clamp(70px, 18vw, 110px);
    border-radius: clamp(16px, 4vw, 24px);
    background: linear-gradient(145deg, #18181f 0%, #0d0d12 100%);
    border: 1.5px solid rgba(var(--beer-gold-rgb), 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.ios-app-icon-logo:hover {
    transform: translateY(-4px) rotate(2deg);
    border-color: rgba(var(--beer-gold-rgb), 0.6);
}

.ios-app-icon-logo .app-icon-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 10%, rgba(var(--beer-gold-rgb), 0.22) 0%, transparent 75%);
}

.ios-app-icon-logo .beer-emoji {
    font-size: clamp(2.5rem, 7vw, 3.8rem);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    z-index: 1;
}

/* Landingpage-Layout */
.minimal-landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    padding: clamp(1.5vh, 3vh, 4vh) clamp(12px, 4vw, 20px) clamp(1vh, 2vh, 3vh) clamp(12px, 4vw, 20px);
    width: 100%;
    position: relative;
    z-index: 2;
}

.beerescape-logo-container {
    text-align: center;
    margin-bottom: 2vh;
}

.beerescape-app-title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, var(--beer-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: clamp(8px, 2.5vw, 20px);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.beerescape-app-subtitle {
    font-size: clamp(0.72rem, 2vw, 0.9rem);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Mittiges Kartenstapel-Styling */
.landing-felt-coaster {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: clamp(250px, 65vw, 380px);
    margin: clamp(1vh, 2vh, 2vh) 0;
    perspective: 1200px;
    -webkit-perspective: 1200px;
}

.card-stack-container {
    position: relative;
    width: clamp(140px, 42vw, 220px);
    height: clamp(196px, 59vw, 308px); /* Standard-Poker-VerhÃ¤ltnis 1:1,4 */
    cursor: pointer;
    transform-style: preserve-3d;
    transform: rotateX(40deg) rotateY(-8deg) rotateZ(-12deg);
    transition: transform 0.5s ease-in-out;
}

.card-stack-container:hover {
    transform: rotateX(35deg) rotateY(-5deg) rotateZ(-8deg) scale(1.05);
}

/* Echtes Spielkarten-RÃ¼ckseiten-Styling - Optimiert mit Box-Shadow & Hardware-Beschleunigung */
.luxury-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../images/card.webp');
    background-image: image-set(url('../images/card.webp') type('image/webp'), url('../images/card.png') type('image/png'));
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    transition: transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1.0), box-shadow 1.2s ease-in-out;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
    /* Deaktiviert aufwändige Schlagschatten-Filter auf Mobilgeräten zur FPS-Maximierung */
    filter: none !important;
    box-shadow: none !important;
}

/* Realistic 3D card shadow element */
.luxury-card .card-shadow {
    position: absolute;
    inset: 4px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 14px;
    filter: blur(6px);
    transform: translateZ(-8px) scale(0.98);
    transition: transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1.0), 
                opacity 1.2s ease-in-out, 
                filter 1.2s ease-in-out;
    pointer-events: none;
    opacity: 0.65;
    z-index: -1;
}

/* Shadow when card is shuffling out */
.luxury-card.shuffling .card-shadow {
    transform: translate3d(-35px, 20px, -85px) scale(0.92);
    filter: blur(20px);
    opacity: 0.35;
}

/* Shadow when card is flipped and floating high */
.luxury-card.flipped .card-shadow {
    transform: translate3d(30px, 40px, 135px) scale(0.9);
    filter: blur(30px);
    opacity: 0.28;
}

.card-bottom {
    transform: translateZ(-24px) translateY(10px) scale(0.9) rotate(-5deg);
    opacity: 0.45;
    z-index: 1;
}

.card-middle {
    transform: translateZ(-12px) translateY(5px) scale(0.95) rotate(3deg);
    opacity: 0.75;
    z-index: 2;
}

.card-top {
    transform: translateZ(0) scale(1) rotate(-1deg);
    opacity: 1;
    z-index: 3;
}

/* 55-Kartenstapel & interaktives schwebendes Kartenstyling */
.luxury-card.card-1 {
    transform: translateZ(54px) translateX(0px) translateY(0px) rotate(0deg);
    opacity: 1.0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.8s ease,
                filter 0.8s ease;
}

/* Karte wird angehoben vor dem Umdrehen - realistisches Abheben */
.luxury-card.card-1.flipped {
    transform: translateZ(120px) translateY(-15px) scale(1.08) !important;
    box-shadow:
        0 40px 60px rgba(0, 0, 0, 0.6),
        0 20px 30px rgba(0, 0, 0, 0.4),
        0 60px 80px rgba(0, 0, 0, 0.25) !important;
    z-index: 200 !important;
    filter: brightness(1.05);
}

/* Startbildschirm langsame Mischelanimation - 220 Sekunden */
.card-stack-container.shuffle-active .luxury-card {
    animation: shuffleRealistic 220s infinite ease-in-out;
    animation-delay: var(--anim-delay, 0s);
}

/* Spielbrett-Mischelanimation - 110 Sekunden (inaktiv, auÃŸer Klasse ist vorhanden) */
.card-stack.shuffle-active .luxury-card {
    animation: shuffleRealistic 110s infinite ease-in-out;
    animation-delay: var(--anim-delay, 0s);
}

@keyframes shuffleRealistic {
    /* Obere Position (Position 1) */
    0%, 0.5% {
        transform: translateZ(54px) translateX(0px) translateY(0px) rotate(0deg);
        z-index: 100;
        opacity: 1;
    }
    /* Nach rechts herausschieben und anheben */
    0.9% {
        transform: translateX(175px) translateY(-12px) translateZ(85px) scale(1.03) rotate(14deg);
        z-index: 100;
        opacity: 1;
    }
    /* Unter den Stapel bewegen */
    0.91% {
        z-index: 1;
    }
    /* Untere Position (Position 55) */
    1.8%, 2.7% {
        transform: translateZ(0px) translateX(-3px) translateY(4px) rotate(-4deg);
        z-index: 1;
        opacity: 0.4;
    }
    /* Sanft wieder nach oben steigen */
    100% {
        transform: translateZ(54px) translateX(0px) translateY(0px) rotate(0deg);
        z-index: 100;
        opacity: 1;
    }
}

/* Den gesamten Stapel animieren (anheben & ablegen), wenn eine Karte darunter gleitet */
.card-stack.shuffle-active {
    animation: stackLiftCycle 2s infinite ease-in-out;
    /* Einzelner Schatten, der das gesamte Deck darstellt (fÃ¼r Performance) */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

.card-stack-container.shuffle-active {
    /* 4s Zyklus entspricht dem langsameren Mischen auf dem Startbildschirm (4s pro Karte) */
    animation: stackLiftCycleLanding 4s infinite ease-in-out;
    /* Einzelner Schatten, der das gesamte Deck darstellt (fÃ¼r Performance) */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

/* StandardmÃ¤ÃŸig statische Stapelschatten */
.card-stack, .card-stack-container {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    border-radius: 14px;
}

.card-stack-container.flat-layout {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) !important;
    z-index: 9999 !important;
}

@keyframes stackLiftCycle {
    0%, 50% {
        transform: rotateX(25deg) rotateY(-6deg) rotateZ(-4deg) translateZ(0);
    }
    75% {
        /* Die Ecke durch Neigen anheben und auf Z-Achse nach oben bewegen */
        transform: rotateX(20deg) rotateY(-12deg) rotateZ(-8deg) translateZ(16px);
    }
    85% {
        /* Hart ablegen mit einer leichten negativen Translation */
        transform: rotateX(25deg) rotateY(-6deg) rotateZ(-4deg) translateZ(-3px);
    }
    92% {
        /* Leicht wieder nach oben federn */
        transform: rotateX(24deg) rotateY(-5deg) rotateZ(-3deg) translateZ(2px);
    }
    100% {
        transform: rotateX(25deg) rotateY(-6deg) rotateZ(-4deg) translateZ(0);
    }
}

@keyframes stackLiftCycleLanding {
    0%, 50% {
        transform: rotateX(40deg) rotateY(-8deg) rotateZ(-12deg) translateZ(0);
    }
    75% {
        transform: rotateX(32deg) rotateY(-16deg) rotateZ(-18deg) translateZ(16px);
    }
    85% {
        transform: rotateX(40deg) rotateY(-8deg) rotateZ(-12deg) translateZ(-3px);
    }
    92% {
        transform: rotateX(38deg) rotateY(-7deg) rotateZ(-10deg) translateZ(2px);
    }
    100% {
        transform: rotateX(40deg) rotateY(-8deg) rotateZ(-12deg) translateZ(0);
    }
}


/* Karteninterne Tags und Logos */
.card-luxury-content {
    position: absolute;
    inset: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 3;
}

.card-brand-header {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
}

.card-center-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-center-logo .gold-beer-icon {
    font-size: 3.2rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-center-logo .gold-beer-emblem {
    width: 65px;
    height: 65px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
    margin: 8px 0;
}

.card-action-hint {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #ffffff;
    border-radius: 99px;
    padding: 6px 14px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #ffffff;
    text-transform: uppercase;
}


/* Vereinheitlichte Aktionen & leuchtende Glass-Buttons */
.minimal-button-group {
    width: 100%;
    max-width: clamp(260px, 80vw, 320px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
    margin-top: auto;
    flex-shrink: 0;
}

.button-token {
    width: 100%;
    height: clamp(50px, 12vw, 64px);
    border-radius: 18px;
    font-family: var(--font-family-premium);
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 10px);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    
    /* Vereinheitlichter Premium-Stil */
    background: #1c1a16 !important;
    border: 1.5px solid var(--beer-gold) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.button-token:hover {
    transform: translateY(-1.5px);
    background: #25221d !important;
    border-color: #e5b974 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
}

.button-token:disabled {
    background: rgba(255, 255, 255, 0.03) !important;
    color: rgba(255, 255, 255, 0.2) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

/* Leere Overrides, um sicherzustellen, dass alle Buttons das vereinheitlichte button-token Design nutzen */
.token-brass, .token-copper, .landing-button, .token-orange {
    /* Alle Buttons sind nun einheitlich gestylt */
}

/* Einheitliches Design fÃ¼r weiÃŸe SVG-Icons in allen Buttons */
.btn-icon {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    fill: none !important;
    flex-shrink: 0 !important;
}


/* Premium-Anweisungskartenelemente fÃ¼r die Lobby */
.lobby-instruction-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid #ffffff;
    border-radius: 16px;
    padding: 10px 14px;
    margin-bottom: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.instruction-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lobby-instruction-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    line-height: 1.35;
}

.button-token:active {
    transform: translateY(0.5px) scale(0.99) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Elegante Eingabefelder mit Gold-Details */
.lobby-input {
    width: 100%;
    height: clamp(44px, 10vw, 52px);
    border-radius: 12px;
    background-color: var(--bg-control);
    border: var(--border-glass-gold);
    color: #ffffff;
    font-family: var(--font-family-premium);
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lobby-input::placeholder {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0;
}

.lobby-input:focus {
    border-color: var(--beer-gold);
    box-shadow: 0 0 0 3px rgba(var(--beer-gold-rgb), 0.2);
}

.text-readonly {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border-style: dashed;
    cursor: default;
}

.text-readonly:focus {
    border-color: rgba(var(--beer-gold-rgb), 0.2);
    box-shadow: none;
}

/* An iOS angelehnte, hochschiebbare Bottom-Sheets */
.apple-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.apple-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.apple-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: rgba(20, 20, 25, 0.95);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-top: 1.5px solid rgba(var(--beer-gold-rgb), 0.35);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 12px 20px 30px 20px;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.apple-sheet.open {
    transform: translateY(0);
}

.apple-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.apple-drag-handle {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background-color: rgba(var(--beer-gold-rgb), 0.35);
    margin-bottom: 12px;
}

.apple-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #ffffff;
    text-transform: uppercase;
}

/* FaceID-Ã¤hnliche Scanrahmen */
.apple-scanner-ring-container {
    position: relative;
    width: clamp(160px, 55vw, 210px);
    height: clamp(160px, 55vw, 210px);
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid rgba(var(--beer-gold-rgb), 0.25);
}

.apple-scanner-video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.apple-scanner-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apple-scanner-ring-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    border: 3px solid var(--beer-gold);
    animation: scannerPulse 1.8s infinite ease-in-out;
    z-index: 10;
    pointer-events: none;
}

@keyframes scannerPulse {
    0% { transform: scale(0.97); opacity: 0.3; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(0.97); opacity: 0.3; }
}

/* Grid-Layout fÃ¼r Teamauswahl */
.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin: 10px 0;
}

.team-select-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.15);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.team-select-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(var(--beer-gold-rgb), 0.4);
}

.team-select-btn.active {
    border-color: var(--beer-gold);
    background-color: rgba(var(--beer-gold-rgb), 0.1);
    box-shadow: 0 0 10px rgba(var(--beer-gold-rgb), 0.15);
}

.team-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.team-slots {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Footer-Elemente der Hauptlayouts */
.minimal-footer {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 16px 0 40px 0; /* Mehr Abstand unten */
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.minimal-footer a {
    color: var(--beer-gold) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.minimal-footer a:hover {
    color: var(--beer-gold);
}

.game-uuid-label {
    font-size: 0.7rem;
    opacity: 0.5;
    font-family: monospace;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.footer-copyright {
    display: block;
}

.footer-links {
    font-size: 0.75rem;
    opacity: 0.75;
    display: flex;
    gap: 8px;
}

.footer-links a {
    color: var(--beer-gold) !important;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.25);
}

/* Kleinerer Footer während der aktiven Spielsitzung — immer sichtbar & zentriert */
.game-page-content .minimal-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 8px 0;
    margin-top: 12px;
    gap: 2px;
    font-size: 0.68rem;
}

.game-page-content .game-uuid-label {
    font-size: 0.62rem;
    margin-bottom: 0.05rem;
}

.game-page-content .footer-links {
    font-size: 0.68rem;
    gap: 6px;
}


/* --- LOBBY-BILDSCHIRM-LAYOUT --- */
.lobby-content-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 14px);
    flex: 1 1 auto;
    justify-content: center;
    padding: clamp(10px, 3vw, 20px);
}

.lobby-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--beer-gold);
}

/* SPIELMODUS-SELEKTOR */
.game-mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.15);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
}

.mode-select-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family-premium);
    gap: 4px;
}

.mode-select-btn:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.mode-select-btn.active {
    background: linear-gradient(135deg, var(--beer-gold) 0%, #b37d14 100%);
    color: #000000 !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mode-select-btn .mode-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.mode-select-btn.active .mode-icon {
    transform: scale(1.1);
}

.mode-select-btn .mode-text {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Nur lesbarer Spielmodus-Selektor fÃ¼r Spieler */
.game-mode-selector.readonly {
    background: rgba(255, 255, 255, 0.01);
}

.game-mode-selector.readonly .mode-select-btn {
    cursor: default;
    opacity: 0.4;
}

.game-mode-selector.readonly .mode-select-btn.active {
    opacity: 1;
    background: rgba(var(--beer-gold-rgb), 0.15);
    border: 1px solid var(--beer-gold);
    color: #ffffff !important;
    box-shadow: none;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* An iOS angelehnte, gruppierte ZellenblÃ¶cke fÃ¼r Spielerzeilen */
.lobby-list-container {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.15);
    border-radius: 14px;
    max-height: clamp(120px, 25vh, 200px);
    overflow-y: auto;
}

.lobby-player-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    text-align: left;
    color: #ffffff;
    font-family: var(--font-family-premium);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lobby-player-badge.current-player {
    background-color: rgba(var(--beer-gold-rgb), 0.03);
}

.lobby-player-badge.current-player:active {
    background-color: rgba(var(--beer-gold-rgb), 0.08);
}

.lobby-player-badge.readonly {
    cursor: default;
}

.lobby-player-badge:last-child {
    border-bottom: none;
}

.team-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lobby-warning-text {
    font-size: 0.75rem;
    color: var(--amber-glow);
    text-align: center;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(var(--amber-glow-rgb), 0.08);
    border-radius: 10px;
    border: 0.5px solid rgba(var(--amber-glow-rgb), 0.2);
    font-weight: 600;
}


/* --- AKTIVES INGAME-LAYOUT --- */
.game-board-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    position: relative;
    overflow: visible; /* Von versteckt auf sichtbar geÃ¤ndert, um das Abschneiden von Kartenstapeln und SchaltflÃ¤chen zu verhindern */
    background: transparent !important;
}

.game-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    z-index: 2;
    position: relative;
    padding: clamp(6px, 2vw, 16px);
    background: transparent !important;
}

.game-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
    width: 100%;
    gap: clamp(8px, 2.5vw, 16px);
    min-height: 0;
}

/* Leuchtende Spielstatus-Benachrichtigungsleiste */
.game-notification {
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--border-glass-gold);
    border-radius: 14px;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    max-width: clamp(260px, 85vw, 320px);
    line-height: 1.45;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Aktives Spielzug-Banner — vereintes Info-Panel */
.active-turn-banner {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(15, 15, 20, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: clamp(14px, 3.5vw, 20px);
    padding: clamp(8px, 1.5vw, 12px) clamp(14px, 3vw, 22px);
    width: auto;
    max-width: 90%;
    margin: 0 auto clamp(6px, 1.5vw, 12px) auto;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
    box-sizing: border-box;
    align-self: center;
}

.turn-info-row {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 10px);
    padding: clamp(3px, 0.6vw, 5px) 0;
}

.turn-info-label {
    font-size: clamp(0.55rem, 1.3vw, 0.62rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: clamp(0.8px, 0.3vw, 1.5px);
    white-space: nowrap;
    min-width: clamp(48px, 10vw, 60px);
}

.turn-info-name {
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.turn-info-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: clamp(1px, 0.3vw, 3px) 0;
}

.turn-info-player {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1vw, 8px);
}

.active-turn-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-turn-dot.pulse-dot {
    animation: userBadgePulse 2s infinite ease-in-out;
}

.badge-your-turn {
    font-weight: 800;
    font-size: clamp(0.5rem, 1.2vw, 0.6rem);
    padding: clamp(2px, 0.4vw, 3px) clamp(6px, 1.2vw, 10px);
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-left: clamp(4px, 1vw, 8px);
    animation: pulse-border 1.5s infinite alternate;
}

@keyframes bounce-x {
    0% { transform: translateX(0); }
    100% { transform: translateX(3px); }
}

/* clamp() handles all turn-banner sizing fluidly — no breakpoint needed */

/* Goldene Kartendeck-Slots */
.deck-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: clamp(150px, 48vw, 250px);
    aspect-ratio: 1 / 1.4; /* Standard-Poker-Verhältnis */
    margin: clamp(8px, 2vw, 16px) auto;
    position: relative;
    perspective: 1200px;
    -webkit-perspective: 1200px;
}

.deck-slot .card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(25deg) rotateY(-6deg) rotateZ(-4deg);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.6s ease;
    box-shadow: 
        0 18px 35px rgba(0, 0, 0, 0.5),
        0 8px 15px rgba(0, 0, 0, 0.3);
    border-radius: 14px;
}

.deck-slot:hover .card-stack {
    transform: rotateX(20deg) rotateY(-3deg) rotateZ(-2deg) scale(1.03);
    box-shadow:
        0 24px 45px rgba(0, 0, 0, 0.55),
        0 12px 20px rgba(0, 0, 0, 0.35);
}

/* 3D-Perspektive IMMER beibehalten - nur flach wenn Karte aufgedeckt */
.deck-slot .card-stack.has-flipped-card {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) !important;
}

/* Karten-Umdrehungs-Transformationen */
.flip-container {
    perspective: 1200px;
    -webkit-perspective: 1200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1.0);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
}

.flip-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-back, .flip-card-front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    transform: translateZ(0);
}

.flip-card-back {
    background-image: url('../images/card.webp');
    background-image: image-set(url('../images/card.webp') type('image/webp'), url('../images/card.png') type('image/png'));
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}

.flip-card-front {
    transform: rotateY(180deg) translateZ(1px);
    background-image: url('../images/card_no_logo.webp?v=3');
    background-image: image-set(url('../images/card_no_logo.webp?v=3') type('image/webp'), url('../images/card_no_logo.png?v=3') type('image/png'));
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: 1.5px solid rgba(212, 163, 89, 0.3);
    border-radius: 14px;
    padding: clamp(12px, 3vw, 24px) clamp(10px, 2.5vw, 20px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.6);
    position: absolute;
    inset: 0;
}

.flip-card-front::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(212, 163, 89, 0.16);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

.task-header-type {
    position: relative;
    font-size: clamp(0.55rem, 1.4vw, 0.65rem);
    font-weight: 900;
    letter-spacing: clamp(1.5px, 0.5vw, 2.5px);
    color: var(--beer-gold);
    text-transform: uppercase;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.flip-card-front .task-title {
    position: relative;
    font-family: var(--font-family-premium);
    font-size: clamp(0.85rem, 2.8vw, 1.15rem);
    font-weight: 800;
    color: #ffffff;
    margin: clamp(2px, 0.8vw, 6px) 0;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
    /* Buchdruck-Effekt (sieht in die Karte gedrückt/gedruckt aus) */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8), 0 -0.5px 0 rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
    z-index: 2;
}

.flip-card-front .card-separator {
    position: relative;
    width: 60px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--beer-gold), transparent);
    margin: 6px auto;
    z-index: 2;
}

.task-description-scroll {
    position: relative;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 6px 0;
    padding-right: 4px;
    z-index: 2;
}

/* Eigene Scrollleiste fÃ¼r Aufgabenbeschreibung für ein Premium-GefÃ¼hl */
.task-description-scroll::-webkit-scrollbar {
    width: 4px;
}
.task-description-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
}
.task-description-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.flip-card-front .task-description {
    font-family: var(--font-family-premium);
    font-size: clamp(0.7rem, 2.2vw, 0.88rem);
    line-height: clamp(1.28, 1.4, 1.4);
    color: rgba(255, 255, 255, 0.92);
    margin: auto 0;
    text-align: center;
    font-weight: 500;
    word-break: break-word;
    /* Feines gedrucktes Aussehen */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
    letter-spacing: 0.2px;
}

.task-reward {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--beer-gold);
    background: rgba(212, 163, 89, 0.12);
    border: 1px solid rgba(212, 163, 89, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 4px;
}

/* Ziehstapel-Hilfs-Overlay-Aufforderung */
.deck-draw-hint-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.deck-slot:hover .deck-draw-hint-overlay {
    opacity: 1;
}

.deck-draw-prompt {
    font-weight: 800;
    font-size: clamp(0.5rem, 1.8vw, 0.72rem);
    letter-spacing: clamp(1px, 0.5vw, 2px);
    color: var(--beer-gold);
    border: 1.5px solid var(--beer-gold);
    padding: clamp(4px, 1vw, 8px) clamp(8px, 2.5vw, 16px);
    border-radius: 20px;
    background: rgba(7, 7, 10, 0.85);
    animation: pulseDrawHint 1.5s infinite ease-in-out;
}

@keyframes pulseDrawHint {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* AktionsschaltflÃ¤chenleiste unten */
.action-zone {
    width: 100%;
    max-width: clamp(260px, 80vw, 320px);
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vw, 10px);
    align-items: center;
    margin-top: auto;
    padding-bottom: clamp(6px, 1.5vh, 12px);
    flex-shrink: 0;
}

.zone-label {
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.game-button-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    position: relative;
}


/* --- SPIELSTANDS-SIDEBARS (an iOS angelehnte Widget-Panels) --- */
.scoreboard-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scoreboard-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.scoreboard-toggle-btn {
    position: absolute;
    top: clamp(8px, 2vw, 12px);
    right: clamp(10px, 2.5vw, 16px);
    z-index: 100;
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 163, 89, 0.3);
    border-radius: 99px;
    padding: clamp(5px, 1.2vw, 8px) clamp(10px, 2vw, 16px);
    color: var(--beer-gold);
    font-family: var(--font-family-premium);
    font-weight: 700;
    font-size: clamp(0.68rem, 1.8vw, 0.8rem);
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 6px);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scoreboard-toggle-btn:hover {
    border-color: rgba(212, 163, 89, 0.7);
    background: rgba(212, 163, 89, 0.08);
    transform: translateY(-1px);
}

.scoreboard-toggle-btn:active {
    transform: translateY(0.5px);
}

.scoreboard-toggle-btn.active {
    background-color: var(--beer-gold);
    color: #07070a;
    border-color: transparent;
}

.scoreboard-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 82%;
    max-width: clamp(260px, 80vw, 310px);
    background: rgba(15, 15, 20, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1.5px solid rgba(var(--beer-gold-rgb), 0.22);
    z-index: 95;
    padding: clamp(56px, 15vw, 72px) clamp(10px, 3vw, 16px) clamp(12px, 3vw, 20px) clamp(10px, 3vw, 16px);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -12px 0 35px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.scoreboard-sidebar.open {
    transform: translateX(0);
}

.scoreboard-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--beer-gold);
    margin-bottom: 12px;
}

.scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

.scoreboard-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.1);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scoreboard-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scoreboard-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scoreboard-player-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.scoreboard-team-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.scoreboard-points-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--beer-gold);
    background: rgba(var(--beer-gold-rgb), 0.12);
    border: 0.5px solid rgba(var(--beer-gold-rgb), 0.25);
    padding: 3px 8px;
    border-radius: 6px;
}

.scoreboard-team-players {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.scoreboard-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    position: relative;
}

.scoreboard-player-row.me {
    color: #ffffff;
    font-weight: 700;
}

.score-change-float {
    position: absolute;
    right: 48px;
    font-size: 0.72rem;
    font-weight: 800;
    animation: floatScoreChange 1.8s forwards ease-out;
}

.score-change-plus { color: var(--system-green); }
.score-change-minus { color: var(--system-red); }

@keyframes floatScoreChange {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-14px); opacity: 0; }
}


/* --- WARNUNGS- & DIALOG-OVERLAYS (Duell-, Bonus-, Fallenwarnungen) --- */
.bonus-banner-overlay, .trap-banner-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: clamp(280px, 85vw, 450px);
    background: rgba(20, 20, 25, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 2px solid var(--beer-gold) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(var(--beer-gold-rgb), 0.3) !important;
    z-index: 300 !important;
    padding: clamp(14px, 4vw, 20px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    animation: centerSpringModal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
    height: auto !important;
}

.trap-banner-overlay {
    border-color: #ef4444 !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.3) !important;
}

@keyframes centerSpringModal {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.large-battle-card {
    width: 100%;
    max-width: clamp(280px, 85vw, 320px);
    background: rgba(20, 20, 25, 0.95);
    border: 2px solid var(--system-red);
    border-radius: clamp(16px, 4vw, 24px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.35);
    padding: clamp(12px, 3.5vw, 24px);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 16px);
    margin: clamp(10px, 3vw, 20px) auto;
    animation: scaleInSpring 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 50;
    color: #ffffff;
}

@keyframes scaleInSpring {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.deck-vanished {
    animation: scaleOutSpring 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
    pointer-events: none;
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

@keyframes scaleOutSpring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

.token-orange {
    background: #ff7700 !important;
    color: #ffffff !important;
    border: 1px solid #ffaa66 !important;
    box-shadow: 0 4px 15px rgba(255, 119, 0, 0.4) !important;
}

.token-orange:hover {
    background: #ff9933 !important;
    box-shadow: 0 6px 20px rgba(255, 119, 0, 0.6) !important;
}

.battle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vw, 20px);
}

.battle-card, .bonus-banner-card, .trap-banner-card {
    width: 100%;
    max-width: clamp(260px, 85vw, 300px);
    background: rgba(20, 20, 25, 0.9);
    border: 1.5px solid rgba(var(--beer-gold-rgb), 0.35);
    border-radius: clamp(14px, 3.5vw, 20px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--beer-gold-rgb), 0.15);
    padding: clamp(14px, 4vw, 22px);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2.5vw, 14px);
    animation: scaleSpringDialog 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.22) forwards;
}

@keyframes scaleSpringDialog {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.battle-title, .bonus-banner-title, .trap-banner-title {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 900;
    letter-spacing: -0.3px;
    text-transform: uppercase;
}

.battle-title { color: var(--system-red); }
.bonus-banner-title { color: var(--beer-gold); }
.trap-banner-title { color: var(--amber-glow); }

.bonus-banner-icon, .trap-banner-icon {
    font-size: clamp(2rem, 7vw, 3rem);
    margin: clamp(2px, 0.5vw, 4px) 0;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.3));
}

.battle-versus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 14px;
    border-radius: 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.battle-versus .challenger, .battle-versus .opponent {
    font-size: 0.95rem;
    font-weight: 700;
}

.battle-versus .vs {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--system-red);
}

.battle-desc, .bonus-banner-desc, .trap-banner-desc {
    font-size: clamp(0.72rem, 2vw, 0.85rem);
    color: var(--text-secondary);
    line-height: 1.45;
    font-weight: 500;
}

.battle-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.battle-choice-btn {
    height: clamp(40px, 9vw, 48px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: var(--font-family-premium);
    font-size: clamp(0.82rem, 2.2vw, 0.95rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.battle-choice-btn:hover {
    background: rgba(212, 163, 89, 0.12);
    border-color: rgba(212, 163, 89, 0.5);
    color: var(--beer-gold);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.battle-choice-btn:active {
    transform: translateY(0.5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.battle-status-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.battle-waiting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

/* Spinner-Design */
.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3.5px solid rgba(var(--beer-gold-rgb), 0.1);
    border-top: 3.5px solid var(--beer-gold);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.battle-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.battle-choices-reveal {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 12px;
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.reveal-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.reveal-choice {
    font-size: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.battle-winner-declaration {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--beer-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* --- GAME-OVER-VOLLBILD-ZUSAMMENFASSUNG-DASHBOARD --- */
.game-over-fullscreen {
    position: fixed;
    inset: 0;
    background: var(--bg-obsidian);
    z-index: 300;
    overflow-y: auto;
    padding: clamp(20px, 5vw, 40px) clamp(12px, 4vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-over-glass {
    width: 100%;
    max-width: clamp(300px, 90vw, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 4vw, 24px);
}

.game-over-sparkles {
    font-size: 2.8rem;
    filter: drop-shadow(0 6px 12px rgba(var(--beer-gold-rgb), 0.35));
}

.game-over-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.6px;
    color: var(--text-primary);
    text-align: center;
}

.winner-announcement {
    width: 100%;
    position: relative;
    padding: 24px 20px;
    border-radius: 20px;
    border: 1.5px solid rgba(var(--beer-gold-rgb), 0.3);
    background: var(--bg-surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.winner-glow {
    position: absolute;
    inset: 0;
    filter: blur(35px);
    z-index: 0;
}

.winner-trophy {
    font-size: 2.5rem;
    z-index: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.winner-team-name {
    font-size: 1.25rem;
    font-weight: 800;
    z-index: 1;
    color: #ffffff;
    text-transform: uppercase;
}

.winner-stats-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    z-index: 1;
    margin-top: 4px;
    text-align: center;
}

/* Statistik-Dashboard-Kartenraster */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(6px, 1.5vw, 12px);
    width: 100%;
}

.stat-summary-card {
    background: var(--bg-surface);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.15);
    border-radius: clamp(10px, 2.5vw, 14px);
    padding: clamp(8px, 2vw, 14px) clamp(4px, 1vw, 6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.stat-summary-label {
    font-size: clamp(0.52rem, 1.4vw, 0.65rem);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: clamp(2px, 0.5vw, 4px);
}

.stat-summary-value {
    font-size: clamp(0.78rem, 2vw, 0.95rem);
    font-weight: 800;
    color: #ffffff;
}

/* Bestenlisten-Karten */
.game-over-leaderboard-section {
    width: 100%;
}

.over-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--beer-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 4px;
}

.over-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.over-leaderboard-team-row {
    background: var(--bg-surface);
    border: 1px solid rgba(var(--beer-gold-rgb), 0.15);
    border-radius: clamp(10px, 2.5vw, 14px);
    padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 18px);
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 1.2vw, 8px);
}

.team-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-rank {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--beer-gold);
}

.team-display-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.team-progress-pill {
    font-size: 0.72rem;
    background: rgba(var(--beer-gold-rgb), 0.1);
    border: 0.5px solid rgba(var(--beer-gold-rgb), 0.2);
    padding: 3px 10px;
    border-radius: 6px;
    color: var(--beer-gold);
    margin-left: auto;
    font-weight: 700;
}

.team-player-point-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    font-weight: 500;
}

.over-player-names {
    max-width: 75%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.over-team-total-xp {
    font-weight: 800;
    color: #ffffff;
}

/* Pulsierende Logo-Animation */
.logo-image-pulsing {
    width: 100%;
    max-width: clamp(100px, 30vw, 275px);
    height: auto;
    animation: gentleLogoPulse 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transition: filter 0.3s ease;
}

.logo-image-pulsing:hover {
    filter: drop-shadow(0 6px 20px rgba(212, 163, 89, 0.45));
}

.app-header img.logo-image-pulsing {
    height: clamp(32px, 6vw, 48px) !important;
    width: auto !important;
    max-width: none !important;
}

@keyframes gentleLogoPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    }
    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 8px 22px rgba(212, 163, 89, 0.35));
    }
}

.pro-badge {
    background: linear-gradient(135deg, rgba(28, 26, 22, 0.95) 0%, rgba(14, 13, 11, 0.95) 100%);
    border: 1.5px solid var(--beer-gold);
    color: #ffffff;
    padding: 3px 18px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 3px;
    border-radius: 99px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(212, 163, 89, 0.35);
    text-transform: uppercase;
    font-family: var(--font-family-premium);
    animation: gentleBadgePulse 4s ease-in-out infinite;
    display: inline-block;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

.pro-badge-huge {
    padding: 5px 30px !important;
    font-size: 1.22rem !important;
    letter-spacing: 5px !important;
}

.pro-badge::before {
    content: "\2605\0020";
    color: #e74c3c;
    text-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
}

.pro-badge::after {
    content: "\0020\2605";
    color: #e74c3c; /* Roter Pro-Stern als Akzent */
    text-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
}

@keyframes gentleBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(212, 163, 89, 0.35);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.85), 0 0 18px rgba(212, 163, 89, 0.6);
    }
}

/* --- RESPONSIVE HEIGHT STYLES --- clamp() handles most sizing, this only handles lobby input */
@media screen and (max-height: 600px) {
    .lobby-input {
        height: 44px;
        font-size: 1rem;
    }
    .copy-code-btn {
        height: 44px;
        width: 44px;
    }
}

/* --- BLAZOR-LAUFZEIT-FEHLERBOX --- */
#blazor-error-ui {
    background: #18181f;
    border-top: 1.5px solid var(--system-red);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    display: none;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 24px;
    position: fixed;
    width: 100%;
    z-index: 20000;
    font-family: var(--font-family-premium);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#blazor-error-ui a {
    color: var(--beer-gold);
    text-decoration: none;
    margin-left: 8px;
    border-bottom: 1px dotted var(--beer-gold);
}

#blazor-error-ui a:hover {
    color: #ffffff;
    border-bottom-style: solid;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

/* --- NEUE SPIELVERBESSERUNGEN UND ANIMATIONEN --- */

/* Lobby-Code KopierschaltflÃ¤chen-Stil */
.copy-code-btn {
    background: rgba(28, 26, 22, 0.85);
    border: 1px solid rgba(212, 163, 89, 0.4);
    border-radius: 12px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.copy-code-btn:hover {
    background: rgba(212, 163, 89, 0.15);
    border-color: var(--beer-gold);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 163, 89, 0.2);
}
.copy-code-btn:active {
    transform: scale(0.95);
}
.copy-icon {
    fill: var(--beer-gold);
    transition: fill 0.2s ease;
}
.copy-code-btn:hover .copy-icon {
    fill: #ffffff;
}
.scan-icon {
    color: var(--beer-gold);
    transition: color 0.2s ease;
}
.copy-code-btn:hover .scan-icon {
    color: #ffffff;
}

/* Spiel-Starten-SchaltflÃ¤che Premium-Styling */
.start-game-btn:not(:disabled) {
    background: linear-gradient(135deg, #2b251a 0%, #171512 100%) !important;
    border: 1.5px solid var(--beer-gold) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(212, 163, 89, 0.15) !important;
    letter-spacing: 0.5px;
}
.start-game-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #3a3222 0%, #1e1b17 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(212, 163, 89, 0.35), 0 0 10px rgba(212, 163, 89, 0.2) !important;
    transform: translateY(-2px) scale(1.02);
}

/* Schwebende Deckel-Differenz-Animation */
.points-floating-diff {
    position: absolute;
    right: -32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 10;
    animation: floatUpAndFade 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.points-floating-diff.plus {
    color: var(--system-green);
    text-shadow: 0 0 8px rgba(48, 209, 88, 0.4);
}

.points-floating-diff.minus {
    color: var(--system-red);
    text-shadow: 0 0 8px rgba(255, 69, 58, 0.4);
}

@keyframes floatUpAndFade {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.6);
    }
    15% {
        opacity: 1;
        transform: translateY(-90%) scale(1.15);
    }
    30% {
        transform: translateY(-110%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-160%) scale(0.9);
    }
}

/* --- TABLET BREAKPOINT (1024px) --- */
@media screen and (max-width: 1024px) {
    .left-sideboard-wrapper {
        width: clamp(160px, 18vw, 220px);
    }
    .player-sideboard {
        transform: scale(0.9);
        transform-origin: top right;
    }
    .score-sideboard {
        font-size: 0.85rem;
    }
    .active-traps-container {
        max-width: clamp(150px, 18vw, 200px);
    }
}

/* --- RESPONSIVE MOBILE-FLOW-OVERRIDES --- */
/* On mobile (<768px), switch fixed-positioned elements to optimized layout */
@media screen and (max-width: 768px) {

    /* 1. Logo: zentriert + größer auf Mobil */
    .beerescape-logo-container {
        margin-top: 1.5vh !important;
        margin-bottom: clamp(8px, 2vh, 20px) !important;
        order: -1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }

    /* Spieler-Badge unter dem Logo: zentriert, nicht fixed */
    .beerescape-logo-container .player-sideboard {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        margin: 6px auto 0 auto !important;
        transform: none !important;
        max-width: none !important;
        width: fit-content !important;
    }

    .logo-image-pulsing {
        max-width: clamp(100px, 28vw, 150px) !important;
    }

    .pro-badge {
        padding: 2px 10px !important;
        font-size: 0.6rem !important;
        letter-spacing: 1.5px !important;
    }

    .pro-badge-huge {
        padding: 4px 20px !important;
        font-size: 0.95rem !important;
        letter-spacing: 3px !important;
    }

    /* 2. Aktive-Spiele-Badge: links oben am Rand fixiert */
    .active-lobbies-badge {
        position: fixed !important;
        top: 8px !important;
        left: 8px !important;
        margin: 0 !important;
        z-index: 200 !important;
        padding: 4px 10px !important;
        font-size: 0.65rem !important;
        transform: scale(0.88);
        transform-origin: top left;
    }

    .active-lobbies-badge .pulse-dot {
        width: 7px !important;
        height: 7px !important;
    }

    .active-lobbies-badge .badge-text {
        font-size: 0.6rem !important;
    }

    /* 3. Spielername-Badge: rechts oben am Rand fixiert */
    .player-sideboard {
        position: fixed !important;
        top: 8px !important;
        right: 8px !important;
        left: auto !important;
        margin: 0 !important;
        width: fit-content;
        max-width: 45vw !important;
        z-index: 200 !important;
        padding: 4px 10px !important;
        border-radius: 20px !important;
        border-width: 1.5px !important;
        transform: scale(0.75) !important;
        transform-origin: top right;
    }

    .player-sideboard .sideboard-title {
        font-size: 0.5rem !important;
        padding-right: 5px !important;
        letter-spacing: 0.6px !important;
    }

    .player-sideboard .sideboard-name {
        font-size: 0.7rem !important;
        max-width: 90px !important;
    }

    .player-sideboard .user-badge-dot {
        width: 6px !important;
        height: 6px !important;
    }

    /* 4. Kartenstapel: großzügig skaliert, nutzt Viewport-Höhe */
    .card-stack-container {
        width: clamp(130px, 40vw, 200px) !important;
        height: clamp(182px, 56vw, 280px) !important;
    }

    .deck-slot {
        max-width: clamp(135px, 42vw, 200px) !important;
        aspect-ratio: 1 / 1.4 !important;
        margin: clamp(12px, 3vh, 24px) auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        transform-origin: center center !important;
    }

    /* Main game/landing content */
    .game-board-wrapper, .minimal-landing-container {
        order: 3 !important;
    }

    .game-board-wrapper {
        flex: 1 1 auto !important;
        overflow: visible !important;
        min-height: min-content !important;
    }

    .game-content-container {
        flex: 1 1 auto !important;
        gap: clamp(8px, 2vh, 16px) !important;
        justify-content: center !important;
    }

    .game-board {
        justify-content: flex-start !important;
        flex: 1 1 auto !important;
        gap: clamp(8px, 2vh, 14px) !important;
        padding: 8px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
        min-height: min-content !important;
    }

    .game-page-content .game-board {
        justify-content: center !important;
    }

    /* 5. Buttons: flexibel und horizontal auf Mobil */
    .game-button-group {
        flex-direction: row !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .game-button-group .button-token {
        flex: 1 !important;
        width: auto !important;
        margin-top: 0 !important;
        height: 52px !important;
        font-size: 0.95rem !important;
        border-radius: 12px !important;
        padding: 0 10px !important;
    }

    /* Duell Stein-Papier-Schere horizontal auf Mobil */
    .battle-choices {
        flex-direction: row !important;
        gap: 6px !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .battle-choices .battle-choice-btn {
        flex: 1 !important;
        margin: 0 !important;
        height: 38px !important;
        font-size: 0.8rem !important;
        padding: 4px !important;
        border-radius: 8px !important;
    }

    /* Hangman Minispiel Optimierungen auf Mobil */
    .hangman-gallows-box {
        width: 90px !important;
        height: 105px !important;
        padding: 2px !important;
        border-radius: 12px !important;
    }

    .hangman-svg {
        width: 80px !important;
        height: 95px !important;
    }

    .hangman-lives-container span {
        font-size: 0.85rem !important;
    }

    .hangman-timer-badge span {
        font-size: 0.72rem !important;
    }

    .hangman-char-box {
        font-size: 1.1rem !important;
        width: 18px !important;
        height: 26px !important;
    }

    .hangman-keyboard-grid {
        gap: 4px !important;
        margin-top: 4px !important;
    }

    .hangman-key-btn {
        height: 30px !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }

    /* Action zone am unteren Rand fixiert */
    .action-zone {
        margin-top: auto !important;
        padding: 6px 8px 8px 8px !important;
        flex-shrink: 0 !important;
    }

    /* Left sideboard wrapper: gleiche Position wie Desktop, kleiner skaliert */
    .left-sideboard-wrapper {
        position: fixed !important;
        top: 12% !important;
        left: 0 !important;
        width: clamp(130px, 32vw, 170px) !important;
        max-width: 170px !important;
        z-index: 190 !important;
        transform: scale(0.58);
        transform-origin: top left;
    }

    /* 6. Footer: 1:1 wie Desktop, immer sichtbar & zentriert */
    .minimal-footer {
        order: 20 !important;
        margin-top: auto !important;
        padding: 12px 0 calc(16px + env(safe-area-inset-bottom)) !important;
        gap: 4px !important;
        font-size: 0.75rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    .minimal-footer .footer-copyright {
        font-size: 0.62rem !important;
    }

    .game-page-content .minimal-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .game-page-content .game-uuid-label {
        font-size: 0.58rem !important;
        opacity: 0.5 !important;
        margin-bottom: 0.1rem !important;
    }

    .game-page-content .footer-links {
        font-size: 0.62rem !important;
        gap: 6px !important;
    }

    /* Score-Sideboard: identisch wie Desktop, nur über den Wrapper skaliert */
    .score-sideboard {
        width: 100% !important;
        border-right: none !important;
    }

    /* Aktive Fallen: im Spiel fest oben-links fixiert */
    /* Traps: unterhalb des Sideboards positioniert */
    .active-traps-container {
        position: fixed !important;
        top: calc(12% + 160px) !important;
        left: 0 !important;
        width: clamp(100px, 26vw, 130px) !important;
        z-index: 189 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        transform: scale(0.58);
        transform-origin: top left;
    }

    .active-trap-card {
        width: 100% !important;
        border-radius: 10px !important;
        border-left: 3px solid currentColor !important;
        padding: 12px !important;
        height: auto !important;
        min-height: 36px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
    }

    .active-trap-card .trap-card-title {
        font-size: 0.7rem !important;
    }

    .active-trap-card .trap-card-owner {
        font-size: 0.55rem !important;
    }

    .active-trap-card .trap-card-actions {
        gap: 4px !important;
    }

    .active-trap-card .trap-card-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.65rem !important;
    }

    /* Battle card compact on mobile */
    .large-battle-card {
        padding: clamp(10px, 3vw, 24px) !important;
        margin: 10px auto !important;
    }
}

/* --- INGAME-START-COUNTDOWN-OVERLAY --- */
.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 12, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px;
    box-sizing: border-box;
}

.countdown-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 1rem;
    text-align: center;
    font-family: var(--font-family-premium);
}

.countdown-number {
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 900;
    color: var(--beer-gold);
    text-shadow: 0 0 50px rgba(212, 163, 89, 0.5);
    animation: pulseNumber 1s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
}

.cycling-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cycling-label {
    font-size: clamp(0.72rem, 2vw, 0.85rem);
    font-weight: 700;
    color: var(--beer-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.cycling-value {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    animation: scalePulse 0.12s infinite alternate ease-in-out;
}

.reveal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    text-align: center;
    max-width: 260px;
    width: 90%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.reveal-team-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
}

.reveal-player-name {
    font-size: clamp(1.1rem, 4.5vw, 1.65rem);
    font-weight: 900;
    color: #ffffff;
    margin: 3px 0;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.reveal-starts-text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

@keyframes pulseNumber {
    0% { transform: scale(0.75); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 60px rgba(212, 163, 89, 0.7); }
    100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes scalePulse {
    0% { transform: scale(0.94); }
    100% { transform: scale(1.06); }
}

.animate-title {
    animation: fadeInDown 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-card {
    animation: scaleInSpring 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-btn {
    animation: fadeInUp 0.5s ease-out 0.4s forwards;
    opacity: 0;
}

@keyframes fadeInDown {
    0% { transform: translateY(-30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* clamp() handles all 480px/360px sizing fluidly — these breakpoints are no longer needed */
/* Only minimal battle-specific tweaks remain for very small screens */
@media screen and (max-width: 480px) {
    .battle-choice-btn {
        height: 42px;
        font-size: 0.88rem;
    }
    
    .hangman-char-box {
        font-size: 1.1rem !important;
        width: 20px !important;
        height: 28px !important;
    }
    
    .hangman-key-btn {
        height: 34px !important;
        font-size: 0.85rem !important;
    }

    .hangman-gallows-box {
        width: 80px !important;
        height: 95px !important;
    }
    .hangman-svg {
        width: 70px !important;
        height: 85px !important;
    }
    .hangman-info-side {
        min-width: 140px !important;
    }
    .large-battle-card {
        max-width: 95vw !important;
        padding: 10px !important;
    }
}

/* Bierdeckel-SVG-Symbol */
.beer-coaster-svg {
    display: inline-block;
    vertical-align: middle;
    width: 1.1em;
    height: 1.1em;
    margin-left: 4px;
    color: var(--beer-gold);
    filter: drop-shadow(0 0 3px rgba(243, 156, 18, 0.4));
}

/* Update-Banner Animation */
@keyframes slideUpBanner {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- PWA-Styling --- */
.pwa-install-banner {
    bottom: max(20px, env(safe-area-inset-bottom) + 10px) !important;
}

/* Blur-Effekt für Hintergrundelemente (Logo, Badges), wenn ein Sheet offen ist */
body:has(.apple-sheet.open) .beerescape-logo-container,
body:has(.apple-sheet.open) .landing-felt-coaster,
body:has(.apple-sheet.open) .lobby-content-container,
body:has(.apple-sheet.open) .player-sideboard {
    opacity: 0.25;
    filter: blur(5px);
    pointer-events: none;
}
.beerescape-logo-container, 
.landing-felt-coaster,
.lobby-content-container,
.player-sideboard {
    transition: filter 0.4s ease, opacity 0.4s ease;
}

/* PWA Install Banner Style & Animation */
.pwa-install-banner button {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.pwa-install-banner button:hover {
    filter: brightness(1.12);
    transform: scale(1.02);
}
.pwa-install-banner button:active {
    transform: scale(0.98);
}
@keyframes slideUpPwaBanner {
    from {
        transform: translate(-50%, 30px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ---------------------------------------------------- */
/* MOBILE PERFORMANCE OPTIMIZATIONS (Hardware Accel.)  */
/* ---------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* Hardware acceleration for heavy 3D elements */
    .deck-slot, .card-stack-container, .card-stack {
        transform: translateZ(0);
        will-change: transform;
        perspective: 1000px;
    }

    /* Simplify drop-shadows on complex animations to reduce GPU load */
    .logo-image-pulsing {
        filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4)) !important;
        will-change: transform;
    }

    /* Reduce blur intensity for backdrop-filters (massive performance boost on iOS/Android) */
    /* Heavy blur elements: reduce to 4-6px on mobile, increase opacity to compensate */
    .apple-sheet,
    .apple-overlay,
    .scoreboard-sidebar {
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        background-color: rgba(18, 16, 12, 0.96) !important;
    }

    .scoreboard-drawer-overlay,
    .active-turn-banner,
    .game-notification,
    .lobby-instruction-card {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    .pwa-install-banner, .update-banner {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        background-color: rgba(18, 16, 12, 0.98) !important;
    }

    /* Simplify card shadows during 3D rotations */
    .luxury-card .card-shadow {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        filter: none !important;
    }

    /* Hinting for animated UI parts */
    .animate-card, .animate-title, .animate-btn, .button-token {
        will-change: transform, opacity;
    }

    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

 / *   C o n n e c t i o n   A l e r t   B a n n e r   * / 
 . c o n n e c t i o n - a l e r t - b a n n e r   { 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
         g a p :   1 2 p x ; 
         p a d d i n g :   1 2 p x   2 4 p x ; 
         m a r g i n :   0   a u t o   1 6 p x ; 
         b o r d e r - r a d i u s :   2 0 p x ; 
         w i d t h :   f i t - c o n t e n t ; 
         m a x - w i d t h :   9 0 % ; 
         a n i m a t i o n :   s l i d e D o w n A l e r t   0 . 5 s   c u b i c - b e z i e r ( 0 . 3 4 ,   1 . 5 6 ,   0 . 6 4 ,   1 ) ; 
         b o x - s h a d o w :   0   1 0 p x   2 5 p x   r g b a ( 0 , 0 , 0 , 0 . 5 ) ; 
         z - i n d e x :   1 0 0 ; 
         p o s i t i o n :   r e l a t i v e ; 
 } 
 
 . c o n n e c t i o n - a l e r t - b a n n e r . o f f l i n e   { 
         b a c k g r o u n d :   r g b a ( 2 3 9 ,   6 8 ,   6 8 ,   0 . 1 5 ) ; 
         b o r d e r :   2 p x   s o l i d   # e f 4 4 4 4 ; 
         c o l o r :   # e f 4 4 4 4 ; 
 } 
 
 . c o n n e c t i o n - a l e r t - b a n n e r . o n l i n e   { 
         b a c k g r o u n d :   r g b a ( 1 6 ,   1 8 5 ,   1 2 9 ,   0 . 1 5 ) ; 
         b o r d e r :   2 p x   s o l i d   # 1 0 b 9 8 1 ; 
         c o l o r :   # 1 0 b 9 8 1 ; 
 } 
 
 . c o n n e c t i o n - a l e r t - b a n n e r   . a l e r t - i c o n   { 
         f o n t - s i z e :   1 . 5 r e m ; 
         a n i m a t i o n :   w i g g l e A l e r t   2 s   i n f i n i t e ; 
 } 
 
 . c o n n e c t i o n - a l e r t - b a n n e r   . a l e r t - t e x t   { 
         f o n t - s i z e :   0 . 9 5 r e m ; 
         f o n t - w e i g h t :   8 0 0 ; 
         t e x t - t r a n s f o r m :   u p p e r c a s e ; 
         l e t t e r - s p a c i n g :   0 . 5 p x ; 
 } 
 
 @ k e y f r a m e s   s l i d e D o w n A l e r t   { 
         0 %   {   t r a n s f o r m :   t r a n s l a t e Y ( - 5 0 p x )   s c a l e ( 0 . 8 ) ;   o p a c i t y :   0 ;   } 
         1 0 0 %   {   t r a n s f o r m :   t r a n s l a t e Y ( 0 )   s c a l e ( 1 ) ;   o p a c i t y :   1 ;   } 
 } 
 
 @ k e y f r a m e s   w i g g l e A l e r t   { 
         0 % ,   1 0 0 %   {   t r a n s f o r m :   r o t a t e ( 0 d e g ) ;   } 
         2 5 %   {   t r a n s f o r m :   r o t a t e ( - 1 0 d e g ) ;   } 
         7 5 %   {   t r a n s f o r m :   r o t a t e ( 1 0 d e g ) ;   } 
 } 
  
 
