:root {
    /* 🏛️ Museum / Art Gallery Palette */
    --bg-dark: #1a1510;
    --bg-card: #2a2318;
    --bg-card-hover: #3a3228;
    --text-primary: #f0e6d2;
    --text-secondary: #b8a88a;
    --accent-gold: #C9A84C;
    --accent-amber: #B8860B;
    --accent-foam: #F5F0E8;
    --border-color: #8B7349;
    --success: #2ecc71;
    --danger: #c0392b;

    /* Museum-specific */
    --frame-gold: #C9A84C;
    --frame-gold-light: #DEC06E;
    --frame-gold-dark: #8B6914;
    --frame-shadow: rgba(40, 30, 10, 0.8);
    --velvet-red: #8B1A1A;
    --marble-white: #f5f0e8;
    --parchment: #e8dcc8;
    --mahogany: #1e120a;
    --gallery-wall: #2a2015;

    /* Spacing & Layout */
    --nav-height: 64px;
    --header-height: 60px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Effects */
    --shadow-soft: 0 4px 6px -1px rgba(40, 30, 10, 0.6);
    --shadow-glow: 0 0 15px rgba(201, 168, 76, 0.2);
    --glass-bg: rgba(26, 21, 16, 0.92);
    --glass-border: 1px solid rgba(201, 168, 76, 0.15);

    /* Rarity Colors (preserved) */
    --rarity-base: #b0b0b0;
    --rarity-common: #2ecc71;
    --rarity-rare: #3498db;
    --rarity-super_rare: #00bcd4;
    --rarity-epic: #9b59b6;
    --rarity-mythic: #e74c3c;
    --rarity-legendary: #f39c12;
    --rarity-ultra_legendary-gradient: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff);
    --rarity-ultra_legendary: #ff00cc;
    --rarity-seasonal: #e91e63;

    /* French Aliases */
    --rarity-commun: #2ecc71;
    --rarity-epique: #9b59b6;
    --rarity-mythique: #e74c3c;
    --rarity-legendaire: #f39c12;
    --rarity-ultra_legendaire: #ff00cc;
}

/* Structural Overrides for Museum Feel */
body.theme-museum,
body.theme-museum #app {
    background-color: var(--gallery-wall) !important;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(201, 168, 76, 0.1) 0%, transparent 70%),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0px, transparent 1px, transparent 100px);
    background-attachment: fixed;
}

/* Helper to stop all rarity animations */
.stop-animations, .stop-animations * {
    animation: none !important;
    transition: none !important;
}
.stop-animations::before, .stop-animations::after {
    display: none !important;
}

/* Rarity Badges & Effects */
.rarity-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rarity-base {
    background: var(--rarity-base);
    color: #000;
    text-shadow: none;
}

.rarity-commun {
    background: var(--rarity-common);
}

.rarity-rare {
    background: var(--rarity-rare);
}

.rarity-super_rare {
    background: var(--rarity-super_rare);
}

.rarity-epique {
    background: var(--rarity-epic);
    box-shadow: 0 0 10px var(--rarity-epic);
}

.rarity-mythique {
    background: var(--rarity-mythic);
}

.rarity-legendaire {
    background: var(--rarity-legendary);
    box-shadow: 0 0 15px var(--rarity-legendary);
}

.rarity-ultra_legendary {
    background: var(--rarity-ultra_legendary);
    animation: gradient-shift 2s infinite linear;
}

.rarity-saisonniere {
    background: var(--rarity-seasonal);
    border: 1px dashed #fff;
}

.rarity-hidden {
    background: #333;
    color: #aaa;
    cursor: pointer;
    font-family: monospace;
    letter-spacing: 2px;
}

/* Rarity Animations */
@keyframes rarity-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes rarity-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
        filter: brightness(1.5);
    }
}

@keyframes rarity-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes rarity-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px) rotate(-2deg);
    }

    75% {
        transform: translateX(2px) rotate(2deg);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes rarity-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rarity-explode {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes gradient-shift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes border-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Applied Classes */
.anim-commun {
    animation: rarity-bounce 2s infinite;
}

.anim-rare {
    animation: rarity-flash 3s infinite;
}

.anim-super_rare {
    animation: rarity-pulse 2s infinite;
}

.anim-epique {
    animation: rarity-shake 4s infinite;
}

.anim-mythique {
    position: relative;
    overflow: hidden;
}

/* Needs particle effect js maybe, or simple shine */
.anim-mythique::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: rarity-spin 3s infinite linear;
    pointer-events: none;
}

.anim-legendaire {
    animation: rarity-pulse 1s infinite alternate;
    border: 2px solid #fff;
}


/* Constant Animated Card Border for Ultra Legendary */
.card-anim-ultra_legendary {
    position: relative;
    border: 3px solid transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, #ff00cc, #3333ff, #00ccff, #ff00cc, #ff6600);
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 100% 100%, 600% 600%;
    animation: ultra-border-flow 3s linear infinite, ultra-glow 2s ease-in-out infinite;
    overflow: visible;
}

.card-anim-ultra_legendary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    z-index: 1;
    animation: ultra-pulse-core 3s infinite alternate;
    pointer-events: none;
    mix-blend-mode: overlay;
}

@keyframes ultra-border-flow {
    0% {
        background-position: 100% 100%, 0% 50%;
    }

    100% {
        background-position: 100% 100%, 600% 50%;
    }
}

@keyframes ultra-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 0, 204, 0.4),
            0 0 50px rgba(51, 51, 255, 0.15),
            0 0 80px rgba(0, 204, 255, 0.1);
    }

    33% {
        box-shadow: 0 0 25px rgba(51, 51, 255, 0.5),
            0 0 60px rgba(0, 204, 255, 0.2),
            0 0 100px rgba(255, 0, 204, 0.1);
    }

    66% {
        box-shadow: 0 0 25px rgba(0, 204, 255, 0.5),
            0 0 60px rgba(255, 0, 204, 0.2),
            0 0 100px rgba(51, 51, 255, 0.1);
    }
}

@keyframes ultra-pulse-core {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* ======================================= */
/* Per-Rarity Card Effects (Beer Grid)     */
/* PREMIUM VISUAL SYSTEM                   */
/* ======================================= */

/* --- Commun – Pulsing emerald border with inner glow --- */
.card-rarity-commun {
    border: 2px solid var(--rarity-commun) !important;
    animation: card-glow-commun 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.card-rarity-commun::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(46, 204, 113, 0.12), transparent);
    transform: skewX(-20deg);
    animation: card-shimmer-slow 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes card-glow-commun {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(46, 204, 113, 0.15), inset 0 0 8px rgba(46, 204, 113, 0.03);
    }

    50% {
        box-shadow: 0 0 16px rgba(46, 204, 113, 0.35), inset 0 0 15px rgba(46, 204, 113, 0.06);
    }
}

/* --- Rare – Blue holographic shine with streak --- */
.card-rarity-rare {
    border: 2px solid var(--rarity-rare) !important;
    animation: card-glow-rare 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.card-rarity-rare::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(115deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(52, 152, 219, 0.4) 45%,
            rgba(255, 255, 255, 0.8) 50%,
            rgba(52, 152, 219, 0.4) 55%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 250% 250%;
    mix-blend-mode: color-dodge;
    animation: holographic-shift 4s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 10;
}

.card-rarity-rare::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: card-shimmer 3s infinite;
    pointer-events: none;
    z-index: 11;
}

@keyframes card-glow-rare {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(52, 152, 219, 0.3), inset 0 0 12px rgba(52, 152, 219, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.6), inset 0 0 20px rgba(52, 152, 219, 0.2);
    }
}

@keyframes holographic-shift {
    0% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

@keyframes card-shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 250%;
    }
}

@keyframes card-shimmer-slow {
    0% {
        left: -100%;
    }

    100% {
        left: 250%;
    }
}

/* --- Super Rare – Dual-tone cyan pulse with rotating ring & Foil --- */
.card-rarity-super_rare {
    border: 2px solid var(--rarity-super_rare) !important;
    animation: card-glow-super_rare 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.card-rarity-super_rare::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent 0%,
            rgba(0, 188, 212, 0.4) 10%,
            transparent 20%,
            transparent 50%,
            rgba(0, 188, 212, 0.4) 60%,
            transparent 70%);
    animation: rarity-spin 6s linear infinite;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

.card-rarity-super_rare::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg,
            rgba(0, 255, 255, 0) 0%,
            rgba(0, 188, 212, 0.2) 30%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(0, 188, 212, 0.2) 70%,
            rgba(0, 255, 255, 0) 100%);
    background-size: 200% 200%;
    animation: holographic-shift 5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

@keyframes card-glow-super_rare {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 188, 212, 0.4), 0 0 25px rgba(0, 188, 212, 0.1);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 188, 212, 0.7), 0 0 50px rgba(0, 188, 212, 0.3);
    }
}

/* --- Épique – Premium Purple Flow & Reverse Holographic Particle Fog --- */
.card-rarity-epique {
    border: 2px solid transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, #9b59b6, #8e44ad, #ff6bdf, #9b59b6);
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 100% 100%, 300% 300%;
    animation: card-glow-epique 2s ease-in-out infinite, epic-border-flow 4s linear infinite;
    position: relative;
    overflow: hidden;
}

.card-rarity-epique::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(155, 89, 182, 0.5) 0%, transparent 60%),
        conic-gradient(from 0deg,
            transparent 0%,
            rgba(255, 107, 223, 0.3) 15%,
            transparent 25%,
            rgba(155, 89, 182, 0.4) 40%,
            transparent 50%);
    animation: rarity-spin 4s linear infinite, reverse-pulse 2s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: color-dodge;
}

.card-rarity-epique::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 180, 255, 0.5), rgba(155, 89, 182, 0.3), transparent);
    transform: skewX(-20deg);
    animation: card-shimmer 2s infinite;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

@keyframes reverse-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes card-glow-epique {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(155, 89, 182, 0.5), 0 0 30px rgba(155, 89, 182, 0.2);
    }

    50% {
        box-shadow: 0 0 35px rgba(155, 89, 182, 0.8), 0 0 70px rgba(155, 89, 182, 0.4);
    }
}

@keyframes epic-border-flow {
    0% {
        background-position: 100% 100%, 0% 50%;
    }

    100% {
        background-position: 100% 100%, 300% 50%;
    }
}

/* --- Mythique – Hellfire Core & Screaming Glow --- */
.card-rarity-mythique {
    border: 3px solid transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, #e74c3c, #ff1a1a, #ff9f43, #e74c3c, #ff4757);
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 100% 100%, 400% 400%;
    animation: mythic-border 3s linear infinite, card-glow-mythique 1.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* Pure CSS Flame Core - More Intense */
.card-rarity-mythique::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -10%;
    width: 120%;
    height: 100px;
    background: radial-gradient(ellipse at center bottom, rgba(255, 150, 0, 1) 0%, rgba(255, 0, 0, 0.8) 40%, transparent 70%);
    filter: blur(5px);
    z-index: 3;
    animation: css-flame-flicker 1s infinite alternate;
    pointer-events: none;
    mix-blend-mode: color-dodge;
}

/* Inner fire wash effect */
.card-rarity-mythique::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg,
            rgba(255, 60, 0, 0.6) 0%,
            rgba(255, 107, 107, 0.2) 30%,
            transparent 80%);
    pointer-events: none;
    z-index: 1;
    animation: fire-flicker 1.5s ease-in-out infinite;
    mix-blend-mode: overlay;
}

@keyframes mythic-border {
    0% {
        background-position: 100% 100%, 0% 50%;
    }

    100% {
        background-position: 100% 100%, 400% 50%;
    }
}

@keyframes card-glow-mythique {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 50, 0, 0.5),
            0 0 50px rgba(231, 76, 60, 0.3),
            inset 0 0 20px rgba(255, 50, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 50, 0, 0.8),
            0 0 90px rgba(231, 76, 60, 0.5),
            inset 0 0 40px rgba(255, 50, 0, 0.4);
    }
}

@keyframes css-flame-flicker {
    0% {
        transform: scaleY(1) translateY(0);
        opacity: 0.8;
    }

    33% {
        transform: scaleY(1.4) translateY(-10px);
        opacity: 1;
    }

    66% {
        transform: scaleY(0.8) translateY(-2px);
        opacity: 0.9;
    }

    100% {
        transform: scaleY(1.2) translateY(-15px);
        opacity: 1;
    }
}

@keyframes fire-flicker {

    0%,
    100% {
        opacity: 0.6;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.05);
    }
}

/* --- Légendaire – GOLDEN DIVINE AURA & Shimmering Foil --- */
.card-rarity-legendaire {
    border: 3px solid transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
        linear-gradient(135deg, #f39c12, #fff200, #e67e22, #f39c12, #fff);
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 100% 100%, 400% 400%;
    animation: legendary-border 3s linear infinite, card-glow-legendaire 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* Pure CSS Sparkle */
.card-rarity-legendaire::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px 5px #fff, 0 0 30px 10px gold;
    z-index: 3;
    animation: css-sparkle-float 3s ease-in-out infinite alternate;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Golden light sweep and foil */
.card-rarity-legendaire::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -120%;
    width: 80%;
    height: 140%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            rgba(255, 215, 0, 0.8),
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-15deg);
    animation: golden-sweep 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: color-dodge;
}

@keyframes legendary-border {
    0% {
        background-position: 100% 100%, 0% 50%;
    }

    100% {
        background-position: 100% 100%, 400% 50%;
    }
}

@keyframes card-glow-legendaire {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(243, 156, 18, 0.35),
            0 0 40px rgba(243, 196, 15, 0.12),
            0 0 80px rgba(243, 156, 18, 0.05);
    }

    50% {
        box-shadow: 0 0 30px rgba(243, 156, 18, 0.6),
            0 0 70px rgba(243, 196, 15, 0.25),
            0 0 120px rgba(243, 156, 18, 0.1);
    }
}

@keyframes css-sparkle-float {

    0%,
    100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-8px) scale(1.5);
        opacity: 1;
        box-shadow: 0 0 12px 3px gold, 0 0 25px 8px rgba(255, 215, 0, 0.8);
    }
}

@keyframes golden-sweep {
    0% {
        left: -120%;
    }

    100% {
        left: 220%;
    }
}

/* Ultra Légendaire – uses .card-anim-ultra_legendary applied via JS */

/* ======================================= */
/* Modal Detail – Rarity Border Colors     */
/* ======================================= */
.modal-rarity-base {
    border: 2px solid var(--border-color) !important;
}

.modal-rarity-commun {
    border: 2px solid var(--rarity-commun) !important;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

.modal-rarity-rare {
    border: 2px solid var(--rarity-rare) !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
}

.modal-rarity-super_rare {
    border: 2px solid var(--rarity-super_rare) !important;
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.25);
}

.modal-rarity-epique {
    border: 2px solid var(--rarity-epique) !important;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}

.modal-rarity-mythique {
    border: 3px solid var(--rarity-mythique) !important;
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.35);
}

.modal-rarity-legendaire {
    border: 3px solid var(--rarity-legendaire) !important;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.35);
}

.modal-rarity-ultra_legendaire {
    border: 3px solid transparent !important;
    background-image: linear-gradient(#111, #111), var(--rarity-ultra_legendary-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 30px rgba(255, 0, 204, 0.3);
}

/* Reveal Overlay Styles */
.reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.reveal-card {
    width: 200px;
    height: 300px;
    background: #222;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    animation: reveal-shake-hard 2s ease-in-out forwards;
}

@keyframes reveal-shake-hard {
    0% {
        transform: scale(0.8) rotate(0deg);
    }

    20% {
        transform: scale(0.9) rotate(-5deg);
    }

    40% {
        transform: scale(0.9) rotate(5deg);
    }

    60% {
        transform: scale(1.0) rotate(-10deg);
        filter: brightness(2);
    }

    80% {
        transform: scale(1.1) rotate(10deg);
        filter: brightness(3);
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.reveal-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, #fff, transparent);
    opacity: 0;
    animation: burst-fade 0.5s 2s forwards;
    /* Starts after shake */
}

@keyframes burst-fade {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}


/* Scrollbar Styling – Museum */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mahogany);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--frame-gold-dark), var(--frame-gold), var(--frame-gold-dark));
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--frame-gold), var(--frame-gold-light), var(--frame-gold));
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    /* Gallery wall texture */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(60, 45, 25, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(60, 45, 25, 0.2) 0%, transparent 50%),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,0.03) 40px, rgba(0,0,0,0.03) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0,0,0,0.03) 40px, rgba(0,0,0,0.03) 41px);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Typography – Museum Serif */
h1,
h2,
h3 {
    font-family: 'Playfair Display', 'Russo One', serif;
    letter-spacing: 0.5px;
    color: var(--frame-gold-light);
}

/* Structure */
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.03) 0%, transparent 60%);
}

/* Header – Museum Gallery */
.app-header {
    min-height: calc(var(--header-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--spacing-md) 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--mahogany) 0%, rgba(30, 18, 10, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--frame-gold-dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 -1px 0 var(--frame-gold);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--frame-gold-light);
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    color: var(--frame-gold-light);
}

.icon-btn:active {
    background: rgba(201, 168, 76, 0.15);
}

/* Main Content */
#main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    padding-bottom: calc(var(--nav-height) + 120px);
    /* Safe area for inputs & FAB */
    scroll-behavior: smooth;
}

/* Beer Grid – Museum Gallery Wall */
.beer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 8px;
}

/* Beer Card – Museum Painting Frame */
.beer-card {
    background: linear-gradient(145deg, #2c2418, #241e14);
    /* Ornate gilded frame border */
    border: 4px solid var(--frame-gold-dark);
    border-radius: 4px;
    padding: var(--spacing-md) var(--spacing-sm);
    padding-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    /* Multi-layered painting frame shadow */
    box-shadow:
        /* Inner carved frame */
        inset 0 0 0 1px var(--frame-gold),
        inset 0 0 0 3px rgba(0,0,0,0.3),
        inset 0 0 10px rgba(0,0,0,0.4),
        /* Outer frame depth */
        2px 2px 0 var(--frame-gold-dark),
        4px 4px 0 #5a4a2a,
        /* Wall shadow */
        6px 8px 16px rgba(0,0,0,0.6);
}

.beer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle canvas texture overlay */
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.01) 2px, rgba(255,255,255,0.01) 3px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,0.01) 2px, rgba(255,255,255,0.01) 3px);
    pointer-events: none;
    z-index: 0;
}

.beer-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        inset 0 0 0 1px var(--frame-gold-light),
        inset 0 0 0 3px rgba(0,0,0,0.3),
        inset 0 0 15px rgba(201, 168, 76, 0.1),
        2px 2px 0 var(--frame-gold),
        4px 4px 0 var(--frame-gold-dark),
        /* Warm spotlight effect */
        0 0 30px rgba(201, 168, 76, 0.15),
        8px 12px 24px rgba(0,0,0,0.7);
}

.beer-card:active {
    transform: scale(0.98);
}

.beer-card.drunk {
    border-color: var(--frame-gold);
    background: linear-gradient(145deg, #2c2418, #302010);
}

.beer-card .check-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--frame-gold-light);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.beer-card.drunk .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Beer Image – Mounted on Canvas */
.beer-image {
    width: 80px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s;
    position: relative;
    z-index: 1;
}

.beer-card:hover .beer-image {
    transform: translateY(-5px) rotate(1deg);
}

.beer-info {
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Museum Plaque Title */
.beer-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
    color: var(--frame-gold-light);
}

/* Engraved Subtitle */
.beer-brewery {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-style: italic;
}

/* Floating Action Button – Antique Gold Medallion */
.fab {
    position: absolute;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--frame-gold-light), var(--frame-gold-dark));
    color: var(--mahogany);
    border: 2px solid var(--frame-gold);
    box-shadow:
        0 0 15px rgba(201, 168, 76, 0.3),
        0 4px 12px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    box-shadow:
        0 0 25px rgba(201, 168, 76, 0.4),
        0 6px 16px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.fab:active {
    transform: scale(0.9);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: var(--spacing-md);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 168, 76, 0.2);
    border-radius: 50%;
    border-top-color: var(--frame-gold-light);
    animation: spin 1s ease-in-out infinite;
}

/* Navigation – Museum Bronze Plaque Bar */
.bottom-nav {
    height: calc(var(--nav-height) + min(env(safe-area-inset-bottom), 40px));
    background: linear-gradient(0deg, var(--mahogany) 0%, rgba(30, 18, 10, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--frame-gold-dark);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5), inset 0 1px 0 var(--frame-gold);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: min(env(safe-area-inset-bottom), 40px);
    box-sizing: border-box;
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Playfair Display', serif;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: color 0.3s;
    padding: 6px 8px;
    min-width: 50px;
    letter-spacing: 0.5px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--frame-gold-light);
}

.nav-item.active {
    color: var(--frame-gold-light);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
}

/* Utilities */
.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Styles – Museum Exhibition Panel */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 8, 5, 0.88);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(160deg, #1e1812, #28201a);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 4px;
    border: 3px solid var(--frame-gold-dark);
    padding: var(--spacing-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow:
        inset 0 0 0 1px var(--frame-gold),
        inset 0 0 20px rgba(0,0,0,0.3),
        4px 4px 0 var(--frame-gold-dark),
        6px 6px 0 #3a2a14,
        8px 12px 30px rgba(0,0,0,0.7);
}

@media (min-width: 600px) {
    .modal-content {
        border-radius: 4px;
        height: auto;
        min-height: 400px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Form Styles – Museum Parchment */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Playfair Display', serif;
    font-style: italic;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(30, 24, 18, 0.8);
    border: 1px solid var(--frame-gold-dark);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--frame-gold);
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, var(--frame-gold), var(--frame-gold-dark));
    color: var(--mahogany);
    border: 1px solid var(--frame-gold-light);
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: var(--spacing-md);
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: background 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--frame-gold-light), var(--frame-gold));
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.2);
}

/* Text Color Utilities */
.text-white {
    color: #ffffff !important;
}

.text-black {
    color: #000000 !important;
}

.text-gold {
    color: var(--accent-gold) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Search Bar – Museum Archive */
.search-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(30, 18, 10, 0.98), rgba(42, 35, 24, 0.98));
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--frame-gold-dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    z-index: 9;
    animation: slideDown 0.2s ease-out;
}

.search-bar.hidden {
    display: none;
}

#search-input {
    flex: 1;
    background: rgba(20, 15, 10, 0.8);
    border: 1px solid var(--frame-gold-dark);
    padding: 10px;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
}

#search-input:focus {
    outline: none;
    border-color: var(--frame-gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Advanced Animations (Added by Agent) --- */

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 1px solid var(--accent-gold);
    /* Fallback */
    border-radius: 50px;
    padding: 10px 25px 10px 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow: hidden;
    animation: ach-slide-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    min-width: 280px;
}

/* Achievement TCG Premium Foils */

/* Commun */
.ach-rarity-commun {
    border-color: var(--rarity-commun);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(46, 204, 113, 0.2);
}

/* Rare - Blue Holo Shift */
.ach-rarity-rare {
    border-color: var(--rarity-rare);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(52, 152, 219, 0.4);
}

.ach-rarity-rare::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0%, rgba(52, 152, 219, 0.3) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(52, 152, 219, 0.3) 55%, transparent 100%);
    background-size: 250% 250%;
    mix-blend-mode: color-dodge;
    animation: holographic-shift 4s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

/* Super Rare - Cyan Aura Scan */
.ach-rarity-super_rare {
    border-color: var(--rarity-super_rare);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 188, 212, 0.5);
}

.ach-rarity-super_rare::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 0%, rgba(0, 188, 212, 0.4) 30%, rgba(255, 255, 255, 0.6) 50%, rgba(0, 188, 212, 0.4) 70%, transparent 100%);
    background-size: 200% 200%;
    mix-blend-mode: overlay;
    animation: holographic-shift 3s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Epique - Purple Fog */
.ach-rarity-epique {
    border-color: var(--rarity-epique);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(155, 89, 182, 0.6);
}

.ach-rarity-epique::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255, 107, 223, 0.4) 15%, transparent 25%, rgba(155, 89, 182, 0.5) 40%, transparent 50%);
    animation: rarity-spin 4s linear infinite;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: color-dodge;
}

/* Mythique - Hellfire Core */
.ach-rarity-mythique {
    border-color: var(--rarity-mythique);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(231, 76, 60, 0.6);
}

.ach-rarity-mythique::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -10%;
    width: 120%;
    height: 40px;
    background: radial-gradient(ellipse at center bottom, rgba(255, 150, 0, 0.8) 0%, rgba(255, 0, 0, 0.6) 40%, transparent 70%);
    filter: blur(4px);
    z-index: 1;
    animation: css-flame-flicker 1s infinite alternate;
    pointer-events: none;
    mix-blend-mode: color-dodge;
}

/* Legendaire - Divine Gold & Sparkle */
.ach-rarity-legendaire {
    border-color: var(--rarity-legendaire);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 50px rgba(243, 196, 15, 0.6);
}

.ach-rarity-legendaire::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -120%;
    width: 80%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), rgba(255, 215, 0, 0.8), rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-15deg);
    animation: golden-sweep 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: color-dodge;
}

/* Ultra Legendaire - RGB Pulse */
.ach-rarity-ultra_legendaire {
    border-color: transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)), linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #ff00cc);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 400% 400%;
    animation: ach-slide-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, rgb-border 3s linear infinite;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 50px rgba(0, 204, 255, 0.6);
}

.achievement-toast.out {
    animation: ach-slide-out 0.5s ease-in forwards;
}

.ach-icon {
    width: 45px;
    height: 45px;
    background: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: ach-icon-pop 0.5s 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.ach-content {
    display: flex;
    flex-direction: column;
}

.ach-label {
    font-size: 0.7rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.ach-title {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
}

/* Remove ach-shine as we now use rarity effects */

@keyframes ach-slide-in {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes ach-slide-out {
    to {
        transform: translateX(-50%) translateY(-150px);
        opacity: 0;
    }
}

@keyframes ach-icon-pop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Premium screen shake for massive achievements */
.premium-shake {
    animation: screen-shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes screen-shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Enhanced Rarity Frames */
.rarity-frame-mythique {
    position: relative;
}

.rarity-frame-mythique::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #ff0000);
    z-index: -1;
    filter: blur(10px);
    opacity: 0.6;
    animation: pulse-fire 2s infinite;
}

@keyframes pulse-fire {
    0% {
        opacity: 0.5;
        filter: blur(8px);
    }

    50% {
        opacity: 0.8;
        filter: blur(12px);
    }

    100% {
        opacity: 0.5;
        filter: blur(8px);
    }
}

.rarity-frame-ultra_legendary::before {
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #ff00cc);
    background-size: 400%;
    animation: rgb-border 3s linear infinite;
}

@keyframes rgb-border {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}


/* Accessibility & Utils */
@media (max-width: 600px) {
    .desktop-only {
        display: none !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}

.p-20 {
    padding: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.gap-10 {
    gap: 10px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

/* SVG Donut Chart */
.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 80%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #333;
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    stroke: var(--accent-gold);
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

/* Stats Cards – Museum Info Plaque */
.stat-card {
    background: linear-gradient(145deg, #2c2418, #241e14);
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 2px solid var(--frame-gold-dark);
    box-shadow:
        inset 0 0 0 1px rgba(201, 168, 76, 0.3),
        2px 3px 8px rgba(0,0,0,0.4);
}

.stat-value {
    font-size: 1.5rem;
    color: var(--frame-gold-light);
    font-weight: bold;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Comparison Items */
.comp-item {
    background: var(--bg-card);
    padding: 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    gap: 10px;
    align-items: center;
}

.comp-icon {
    font-size: 1.2rem;
}

/* Filter Modal */
.filter-section {
    border-top: 1px solid var(--frame-gold-dark);
    padding-top: 20px;
    margin-top: 20px;
}

/* Achievements */
.ach-category-title {
    margin-top: 15px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--frame-gold-dark);
    padding-bottom: 5px;
    color: var(--frame-gold-light);
    font-family: 'Playfair Display', serif;
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.ach-item {
    text-align: center;
    cursor: help;
    position: relative;
    transition: transform 0.2s;
}

.ach-item:hover {
    transform: scale(1.1);
}

.ach-icon {
    font-size: 2rem;
}

/* Backdrop Filter for Safari */
.app-header,
.bottom-nav {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Update Toast */
.update-toast {
    position: fixed;
    bottom: 80px;
    /* Above nav */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    /* ensure variable name matches usage */
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.update-toast button {
    background-color: var(--accent-gold);
    color: #000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        /* Maintain X centering */
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Modal Container – Museum Exhibition Frame */
#modal-container {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 5, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal content – Museum Panel */
.modal-content {
    background: linear-gradient(160deg, #1e1812, #28201a);
    border: 3px solid var(--frame-gold-dark);
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 1px var(--frame-gold),
        inset 0 0 20px rgba(0,0,0,0.3),
        4px 4px 0 var(--frame-gold-dark),
        8px 12px 30px rgba(0,0,0,0.7);
    max-height: 90vh;
    width: 100%;
    max-width: 500px;
    overflow-y: auto;
    position: relative;
    margin: auto;
}

/* Prevent body scroll when modal open - applied via JS */
body.modal-open {
    overflow: hidden;
}

/* Compact dialog modals – Museum Plaque Style */
.modal-dialog {
    background: linear-gradient(160deg, #1e1812, #241e14);
    border: 2px solid var(--frame-gold-dark);
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 1px var(--frame-gold),
        inset 0 0 15px rgba(0,0,0,0.3),
        4px 4px 0 var(--frame-gold-dark),
        8px 12px 30px rgba(0,0,0,0.7);
    max-width: 400px;
    width: calc(100% - 40px);
    margin: auto;
    padding: 30px 25px;
    text-align: center;
    animation: dialogPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-dialog h3 {
    margin: 0 0 18px 0;
    color: var(--frame-gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.modal-dialog p {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 22px 0;
    white-space: pre-line;
}

.modal-dialog .form-input,
.modal-dialog input[type="text"],
.modal-dialog input[type="number"] {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.modal-dialog .modal-dialog-actions {
    display: flex;
    gap: 10px;
}

.modal-dialog .modal-dialog-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    font-family: 'Playfair Display', serif;
}

.modal-dialog .modal-dialog-actions button:active {
    transform: scale(0.97);
}

.modal-dialog .btn-cancel {
    background: rgba(30, 24, 18, 0.8);
    border: 1px solid var(--frame-gold-dark);
    color: var(--text-secondary);
}

.modal-dialog .btn-confirm {
    background: linear-gradient(145deg, var(--frame-gold), var(--frame-gold-dark));
    border: 1px solid var(--frame-gold-light);
    color: var(--mahogany);
    font-weight: 700;
}

.modal-dialog .btn-confirm.danger {
    background: linear-gradient(145deg, #c0392b, #96281b);
    border: 1px solid #e74c3c;
    color: #fff;
}

.modal-dialog .btn-ok {
    background: linear-gradient(145deg, var(--frame-gold), var(--frame-gold-dark));
    border: 1px solid var(--frame-gold-light);
    color: var(--mahogany);
    font-weight: 700;
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.1s;
    font-family: 'Playfair Display', serif;
}

.modal-dialog .btn-ok:active {
    transform: scale(0.97);
}

.modal-dialog .dialog-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

@keyframes dialogPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#modal-container.hidden {
    display: none;
    /* Hide via display to stop interactions and ensure re-center on show */
    opacity: 0;
}

/* --- WRAPPED STORY --- */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.story-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.3s;
}

.story-progress-container {
    display: flex;
    gap: 4px;
    padding: 10px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10002;
}

.story-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
}

.story-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    z-index: 10003;
    cursor: pointer;
    opacity: 0.7;
}

.story-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    z-index: 10001;
}

.story-tap-left,
.story-tap-right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30%;
    z-index: 10001;
    /* Above content? No, invisible overlay for nav */
}

.story-tap-left {
    left: 0;
}

.story-tap-right {
    right: 0;
    width: 70%;
    /* Give more space to 'Next' */
}

/* Story Typography */
.story-title {
    font-family: 'Russo One', sans-serif;
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    color: var(--accent-gold);
}

.story-subtitle {
    font-size: 1.2rem;
    color: #ddd;
}

.story-stat-label {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.story-big-number {
    font-size: 5rem;
    font-weight: 900;
    font-family: 'Russo One', sans-serif;
    background: -webkit-linear-gradient(#fff, #aaa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.story-big-text {
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Russo One', sans-serif;
    margin-bottom: 20px;
}

.story-beer-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 50%;
    border: 4px solid var(--accent-gold);
    background: #fff;
    padding: 10px;
}

.story-beer-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

/* Animations */
@keyframes pop-in {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slide-up {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes scale-up {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotate-in {
    0% {
        transform: rotate(-10deg) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.animate-pop-in {
    animation: pop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slide-up 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fade-in 1s ease-out forwards;
    opacity: 0;
}

.animate-scale-up {
    animation: scale-up 0.5s ease-out forwards;
    opacity: 0;
}

.animate-rotate-in {
    animation: rotate-in 0.7s ease-out forwards;
    opacity: 0;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* --- Chart Styles --- */
.chart-container {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    position: relative;
}

.chart-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-gold);
    line-height: 1;
    text-align: center;
    width: 100%;
    pointer-events: none;
}

@media (min-width: 768px) {
    .chart-container {
        width: 240px;
        height: 240px;
    }

    .chart-percentage {
        font-size: 3rem;
    }
}

/* --- PC Layout Optimization --- */
@media (min-width: 768px) {

    /* Widen App */
    #app {
        max-width: 1200px !important;
        border-left: 1px solid #222;
        border-right: 1px solid #222;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    /* Responsive Grid */
    .beer-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    }

    /* Dock Navigation */
    .bottom-nav {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 400px;
        border-radius: 30px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        padding-bottom: 0;
    }

    /* Search Bar Width */
    .search-bar {
        max-width: 1200px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 100%;
    }
}

/* --- PC Layout Optimization (Full Width Override) --- */
@media (min-width: 768px) {
    #app {
        max-width: 100% !important;
        border: none;
        box-shadow: none;
    }

    .beer-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        padding: 0 40px;
    }

    .search-bar {
        max-width: 100% !important;
        left: 0;
        transform: none;
        width: 100%;
        padding: 10px 40px;
        right: 0;
    }
}

/* --- Stats & Settings Specifics (PC) --- */
@media (min-width: 768px) {

    /* Center Stats/Settings Content */
    #main-content>.text-center.p-20 {
        max-width: 900px;
        margin: 0 auto;
        display: grid;
        gap: 20px;
    }

    /* Settings Buttons - Prevent Mega Stretch */
    .btn-primary {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Map Aspect Ratio */
    #beer-map-container svg {
        max-height: 600px;
    }

    /* Fix weird left alignment in Settings titles */
    .stat-card h4 {
        text-align: center !important;
    }

    .stat-card {
        padding: 30px;
    }
}

/* Wrapped Story Styles (Appended for Z-Index Fix) */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.story-content {
    position: relative;
    z-index: 20;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: none;
}

.story-content>* {
    pointer-events: none;
}

/* Default text non-clickable */
.story-content button,
.story-content a {
    pointer-events: auto;
}

/* Buttons clickable */
.story-tap-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
}

.story-tap-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
}

.story-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 30;
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}

.story-progress-container {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    padding: 0 10px;
    display: flex;
    gap: 4px;
    z-index: 30;
}

.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.1s linear;
}

/* --- Achievement Toast Styling --- */
.achievement-toast {
    position: relative;
    /* Changed from fixed */
    /* top/left/right removed */
    margin: 0;
    /* Wrapper handles centering */
    z-index: 2147483647 !important;
    /* Max Z-Index */
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Clean dark shadow only */
    backdrop-filter: blur(10px);
    width: fit-content;
    max-width: 90vw;
    pointer-events: none;
}

/* --- Achievement System & Toasts --- */

.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    padding: 10px 0;
    justify-items: center;
}

/* Explicit clean style for Toast Icon to avoid artifacts */
.achievement-toast .ach-item {
    width: 40px !important;
    height: 40px !important;
    background: #000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: default !important;
    border-radius: 50% !important;
}



.achievement-toast .ach-icon,
.achievement-toast .ach-icon * {
    font-size: 1.2rem !important;
    filter: none !important;
    text-shadow: none !important;
    color: #FFF !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.ach-item {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* Force dark background */
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a) !important;
    border: 2px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 5px 10px #151515, -5px -5px 10px #353535;
    /* Soft neumorphism */
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    color: #fff;
    /* Default text color */
}

.ach-item[style*="opacity:1"] {
    /* Unlocked state */
    /* Gold Glow */
    background: #000000 !important;
    /* Pure Black for max contrast */
}

.ach-icon {
    font-size: 1.8rem;
    /* Restored size */
    line-height: 1;
    color: #FFFFFF;
    /* White Text for readability against black */
    text-align: center;
    /* Removed heavy shadows that blur text */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    z-index: 2;
    font-weight: 900;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-style: normal;
    background: transparent !important;
    /* Force transparent background globally */
    text-shadow: none !important;
    /* remove any shadow globally */
}

.ach-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 192, 0, 0.15);
}

.ach-item:active {
    transform: scale(0.95);
}

/* Toast (reusing some achievement styles but specific alignment) */
.achievement-toast .ach-icon {
    width: auto;
    height: auto;
    margin-right: 0;
}

.ach-content {
    display: flex;
    flex-direction: column;
}

.ach-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #FFC000;
    font-weight: bold;
    letter-spacing: 1px;
}

.ach-title {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.ach-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    animation: shine 2s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

@keyframes rumble {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(-2px, 2px) rotate(-1deg);
    }

    50% {
        transform: translate(2px, -2px) rotate(1deg);
    }

    75% {
        transform: translate(-2px, -2px) rotate(-1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.rumble-effect {
    animation: rumble 0.1s infinite linear;
}

/* Custom Toast Animation (No side-effects) */
@keyframes toastEntry {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    60% {
        transform: translateY(10px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastExit {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

.toast-enter-anim {
    animation: toastEntry 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-exit-anim {
    animation: toastExit 0.5s ease-in forwards;
}

/* ============================================= */
/* 🎭 MUSEUM CURTAIN OPENING ANIMATION          */
/* ============================================= */

#curtain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    pointer-events: none;
    animation: curtain-fade-out 0.5s 2.8s ease forwards;
}

.curtain-left,
.curtain-right {
    width: 50%;
    height: 100%;
    position: relative;
    /* Rich velvet red with vertical drape folds */
    background:
        /* Drape fold highlights */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255, 255, 255, 0.03) 15px,
            transparent 30px,
            rgba(0, 0, 0, 0.1) 45px,
            transparent 60px,
            rgba(255, 255, 255, 0.05) 75px,
            transparent 90px
        ),
        /* Base velvet gradient */
        linear-gradient(180deg,
            #3a0a0a 0%,
            #8B1A1A 8%,
            #9B2020 15%,
            #8B1A1A 30%,
            #7a1515 50%,
            #8B1A1A 70%,
            #6a1010 85%,
            #3a0a0a 100%
        );
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* Gold trim at the top of each curtain */
.curtain-left::before,
.curtain-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(180deg,
        #8B6914 0%,
        #C9A84C 30%,
        #DEC06E 50%,
        #C9A84C 70%,
        #8B6914 100%
    );
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Gold tassel/fringe at the bottom edge */
.curtain-left::after,
.curtain-right::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: repeating-linear-gradient(
        90deg,
        #C9A84C 0px,
        #DEC06E 3px,
        #8B6914 6px,
        #C9A84C 9px
    );
    opacity: 0.6;
}

/* Left curtain slides left */
.curtain-left {
    animation: curtain-open-left 2.2s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: left center;
}

/* Right curtain slides right */
.curtain-right {
    animation: curtain-open-right 2.2s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: right center;
}

@keyframes curtain-open-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-105%);
    }
}

@keyframes curtain-open-right {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(105%);
    }
}

@keyframes curtain-fade-out {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        display: none;
    }
}

/* Hide curtain after animation completes */
#curtain-overlay.curtain-done {
    display: none !important;
}

/* ======================================= */
/* 🏛️ Museum Theme - Recent UI Enhancements */
/* ======================================= */

/* 1. Wrapped Story Museum Overrides */
.theme-museum .story-overlay {
    background: radial-gradient(circle at center, #2a2015 0%, #1a1510 100%) !important;
}

.theme-museum .story-bento-card {
    background: var(--parchment) !important;
    border: 5px solid var(--frame-gold-dark) !important;
    border-radius: 4px !important;
    color: var(--mahogany) !important;
    box-shadow: 
        inset 0 0 10px rgba(0,0,0,0.2),
        4px 4px 0 var(--frame-gold-dark),
        8px 8px 15px rgba(0,0,0,0.4) !important;
    position: relative;
    max-width: 340px;
}

.theme-museum .story-bento-card::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid var(--frame-gold);
    pointer-events: none;
}

.theme-museum .story-title {
    font-family: 'Playfair Display', serif !important;
    color: var(--frame-gold-light) !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
    letter-spacing: 2px;
}

.theme-museum .story-stat-number {
    font-family: 'Playfair Display', serif !important;
    color: var(--velvet-red) !important;
}

.theme-museum .story-stat-sub {
    color: #5d4a37 !important;
    font-style: italic;
}

/* 2. Stats Breakdown Museum Badges */
.theme-museum .stat-badge {
    border: 1px solid var(--frame-gold-dark);
    border-radius: 4px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    background: var(--mahogany) !important;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.theme-museum .stat-badge-json {
    color: var(--parchment) !important;
}
.theme-museum .stat-badge-json span { color: var(--frame-gold-light) !important; }

.theme-museum .stat-badge-api {
    color: var(--accent-gold) !important;
}

.theme-museum .stat-badge-custom {
    color: var(--frame-gold-light) !important;
    border-color: var(--frame-gold);
}

/* 3. Match Score Ring Overrides */
.theme-museum .circle-bg {
    stroke: rgba(0,0,0,0.5) !important;
}