/* ─── Container (wine-red console) ──────────────────────────────────── */
#game-root .vs-wrap {
    position: relative; padding: 0.75rem; max-width: 620px; margin: 0 auto;
    background: linear-gradient(180deg, #2a1010 0%, #5a1818 100%);
    border-radius: var(--jul-radius-lg, 20px); user-select: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* ─── HUD pills ─────────────────────────────────────────────────────── */
#game-root .vs-header { display: flex; align-items: stretch; gap: 0.4rem; margin-bottom: 0.55rem; }
#game-root .vs-pill {
    flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 0.4rem; padding: 0.32rem 0.55rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12); border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .vs-pill-icon { font-size: 1.1rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
#game-root .vs-pill-body { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
#game-root .vs-lbl { font-size: 0.58rem; letter-spacing: 0.08em; color: #8a5a1a; text-transform: uppercase; font-weight: 700; }
#game-root .vs-val { font-size: 1.15rem; font-weight: 800; color: var(--jul-red-700, #8B0000); font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
#game-root .vs-audio {
    display: flex; align-items: center; gap: 0.3rem; padding: 0.28rem 0.45rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12); border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .vs-mute { background: transparent; border: 0; width: 26px; height: 26px; cursor: pointer; font-size: 0.95rem; padding: 0; }
#game-root .vs-vol { width: 52px; cursor: pointer; accent-color: var(--jul-red-700, #8B0000); }

/* ─── Difficulty chips ──────────────────────────────────────────────── */
#game-root .vs-modes { display: flex; gap: 0.3rem; margin-bottom: 0.6rem; }
#game-root .vs-mode {
    flex: 1 1 0; padding: 0.32rem 0.5rem; font-size: 0.78rem; font-weight: 700; color: #fde9a8;
    background: rgba(0,0,0,0.28); border: 1px solid rgba(255, 221, 100, 0.18); border-radius: 999px;
    cursor: pointer; letter-spacing: 0.02em; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
#game-root .vs-mode:hover:not(.vs-mode--active) { background: rgba(0,0,0,0.42); color: #fff8d0; }
#game-root .vs-mode--active {
    background: linear-gradient(180deg, #fbd24a 0%, #d99b1e 100%); color: #4a1a05; border-color: #b8870b;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.3);
}

/* ─── Playfield + board ─────────────────────────────────────────────── */
#game-root .vs-playfield {
    position: relative; padding: 12px; border: 3px solid #ffd66b; border-radius: 14px; overflow: hidden;
    background-image: url('/games/vendespil/background.jpg'); background-size: cover; background-position: center;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 0 16px rgba(0,0,0,0.3);
}
#game-root .vs-board { display: grid; gap: 8px; justify-content: center; }

/* ─── Cards (3D flip, ornate gold-on-red back) ──────────────────────── */
#game-root .vs-card { aspect-ratio: 3/4; border: none; background: transparent; padding: 0; cursor: pointer; position: relative; perspective: 600px; min-width: 0; }
#game-root .vs-card__back, #game-root .vs-card__face {
    position: absolute; inset: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.4s cubic-bezier(.34,1.3,.64,1);
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
#game-root .vs-card__back {
    transform: rotateY(0deg);
    color: #ffd66b; font-size: clamp(1.2rem, 7vw, 2.3rem); text-shadow: 0 0 6px rgba(255,214,107,0.5);
    background:
        radial-gradient(circle at 50% 50%, rgba(255,214,107,0.18) 0 18%, transparent 19%),
        repeating-radial-gradient(circle at 50% 50%, transparent 0 8px, rgba(255,214,107,0.10) 8px 9px),
        linear-gradient(135deg, #8b0000 0%, #b91c1c 100%);
    border: 2px solid #ffd66b; box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.4);
}
#game-root .vs-card__face {
    transform: rotateY(180deg); background: linear-gradient(160deg, #fffdf6, #f3e6c8); border: 2px solid #e9c766; padding: 9%;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
#game-root .vs-card__face img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
#game-root .vs-card--flipped .vs-card__back { transform: rotateY(180deg); }
#game-root .vs-card--flipped .vs-card__face { transform: rotateY(0deg); }
#game-root .vs-card:hover:not(.vs-card--flipped):not(.vs-card--matched) .vs-card__back { filter: brightness(1.08); }
#game-root .vs-card--matched .vs-card__face { background: linear-gradient(160deg, #eaf7ec, #c9ebcf); border-color: #4caf50; box-shadow: 0 0 12px rgba(76,175,80,0.55); animation: vs-matched 0.4s ease; }
@keyframes vs-matched { 0% { transform: rotateY(0deg) scale(1); } 50% { transform: rotateY(0deg) scale(1.08); } 100% { transform: rotateY(0deg) scale(1); } }

/* ─── Buttons / actions ─────────────────────────────────────────────── */
#game-root .vs-actions { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-top: 0.6rem; }
#game-root .vs-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 1.2rem; font-size: 0.92rem; font-weight: 700; border-radius: 999px; cursor: pointer; transition: transform 0.08s ease, background 0.2s ease; }
#game-root .vs-btn--primary { background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%); color: #fff; border: 1px solid #7f1d1d; box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3); }
#game-root .vs-btn--primary:hover { background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); transform: translateY(-1px); }
#game-root .vs-btn--primary:active { transform: translateY(1px); }

/* ─── Start gate + win overlay ──────────────────────────────────────── */
#game-root .vs-overlay, #game-root .vs-start { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(20, 10, 10, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
#game-root .vs-overlay { z-index: 6; } #game-root .vs-start { z-index: 7; }
#game-root .vs-overlay[hidden], #game-root .vs-start[hidden] { display: none; }
#game-root .vs-wrap.vs-prestart .vs-actions { display: none; }
#game-root .vs-overlay-card {
    max-width: 330px; width: 100%; text-align: center; padding: 1.3rem 1.2rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(150, 95, 40, 0.45); border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.7);
    animation: vs-pop 0.3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes vs-pop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: none; opacity: 1; } }
#game-root .vs-overlay-card h2 { margin: 0 0 0.4rem; color: var(--jul-red-700, #8B0000); font-size: 1.4rem; }
#game-root .vs-overlay-card p { margin: 0 0 0.95rem; color: #4a2a10; font-size: 0.95rem; }
#game-root .vs-rekord { color: #16a34a; }

/* ─── Confetti ──────────────────────────────────────────────────────── */
#game-root .vs-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
#game-root .vs-confetti-piece { position: absolute; top: 20%; left: 50%; width: 8px; height: 13px; border-radius: 2px; animation: vs-confetti-fall 1.6s ease-out forwards; }
@keyframes vs-confetti-fall { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 340px) rotate(var(--rot)); opacity: 0; } }

#game-root .vs-msg { text-align: center; margin-top: 0.5rem; min-height: 1.3em; font-weight: 600; color: #fde9a8; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #game-root .vs-wrap { padding: 0.6rem; }
    #game-root .vs-header { flex-wrap: wrap; gap: 0.3rem; }
    #game-root .vs-pill { flex: 1 1 28%; }
    #game-root .vs-val { font-size: 1rem; }
    #game-root .vs-vol { width: 44px; }
    #game-root .vs-mode { font-size: 0.72rem; padding: 0.3rem 0.35rem; }
    #game-root .vs-board { gap: 5px; }
}
