/**
 * GLOBAL THEME - Fantasy Medieval + Steampunk
 * Style unifié pour tout le jeu Little Monster
 * Thème: Ornementation magique + touches mécaniques artisanales
 * Version: Professional avec profondeur et caractère
 */

/* ==================== VARIABLES GLOBALES ==================== */
:root {
    /* Couleurs principales - Fantasy Medieval */
    --color-gold-primary: #ffd700;
    --color-gold-light: #ffed4e;
    --color-gold-dark: #b8860b;
    
    --color-purple-primary: #d4a829;
    --color-purple-dark: #8b6914;
    --color-purple-light: #f5d74e;
    
    --color-bronze: #cd7f32;
    --color-copper: #b87333;
    --color-brass: #b5a642;
    
    /* Couleurs d'accentuation - Steampunk */
    --color-steam-blue: #4a7c9b;
    --color-steam-teal: #2c7873;
    --color-gear-metal: #8b8d8f;
    
    /* Couleurs de fond - avec profondeur */
    --color-bg-dark: rgba(18, 14, 10, 0.95);
    --color-bg-medium: rgba(24, 20, 14, 0.92);
    --color-bg-light: rgba(32, 26, 18, 0.88);
    
    /* Shading et depth - nouvelles variables */
    --shadow-depth-1: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-depth-2: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-depth-3: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-depth-4: 0 16px 48px rgba(0, 0, 0, 0.8);
    
    /* Effets métalliques - relief 3D */
    --metal-relief: 
        inset 0 1px 0 rgba(255, 215, 0, 0.3),
        inset 0 -1px 0 rgba(139, 69, 19, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.5);
    
    --metal-relief-hover:
        inset 0 2px 0 rgba(255, 237, 78, 0.4),
        inset 0 -2px 0 rgba(139, 69, 19, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.6);
    
    /* Effets et overlays */
    --shadow-glow-gold: 0 0 20px rgba(255, 215, 0, 0.6);
    --shadow-glow-gold-strong: 0 0 40px rgba(255, 215, 0, 0.8);
    --shadow-glow-purple: 0 0 20px rgba(212, 168, 41, 0.6);
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.6);
    
    /* Bordures ornementées avec gradient */
    --border-ornate-gradient: linear-gradient(45deg, #B8860B, #FFD700, #8B4513, #CD853F);
    --border-metal-gradient: linear-gradient(135deg, #cd7f32, #b87333, #b5a642);
    
    /* Bordures simples */
    --border-ornate: 3px solid var(--color-gold-primary);
    --border-subtle: 2px solid var(--color-brass);
    
    /* Typographie */
    --font-title: 'Cinzel', serif;
    --font-body: 'Philosopher', sans-serif;
    --font-accent: 'Crimson Text', serif;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================== TEXT QUALITY — ANTI-ALIASING ==================== */
body, body * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Pixel rendering ONLY for game canvas & sprite images — never text */
canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ==================== BOUTONS GLOBAUX ==================== */

/* Bouton Medieval avec relief métallique 3D */
.btn-medieval {
    position: relative;
    padding: 0.75rem 2rem;
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-gold-primary);
    background: linear-gradient(135deg, 
        rgba(205, 127, 50, 0.9) 0%, 
        rgba(139, 69, 19, 0.9) 100%);
    border: 4px solid transparent;
    border-image: var(--border-ornate-gradient) 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    box-shadow: var(--metal-relief);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    clip-path: polygon(
        8px 0, calc(100% - 8px) 0,
        100% 8px, 100% calc(100% - 8px),
        calc(100% - 8px) 100%, 8px 100%,
        0 calc(100% - 8px), 0 8px
    );
}

/* Shimmer effect au hover */
.btn-medieval::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.4), 
        transparent);
    transition: left var(--transition-slow);
}

/* Engrenage décoratif */
.btn-medieval::after {
    content: '⚙';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--color-brass);
    opacity: 0;
    transition: all var(--transition-medium);
}

.btn-medieval:hover {
    background: linear-gradient(135deg, 
        rgba(184, 115, 51, 0.95) 0%, 
        rgba(205, 127, 50, 0.95) 100%);
    box-shadow: 
        var(--metal-relief-hover),
        0 0 30px rgba(255, 215, 0, 0.6);
    transform: translateY(-3px) scale(1.02);
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.9),
        2px 2px 4px rgba(0, 0, 0, 0.9);
}

.btn-medieval:hover::before {
    left: 100%;
}

.btn-medieval:hover::after {
    opacity: 0.6;
    animation: gearRotate 2s linear infinite;
}

.btn-medieval:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 
        var(--metal-relief),
        0 4px 16px rgba(0, 0, 0, 0.6);
}

/* Variante Steampunk avec tons bleus */
.btn-steampunk {
    background: linear-gradient(135deg, 
        rgba(74, 124, 155, 0.9) 0%, 
        rgba(44, 120, 115, 0.9) 100%);
    border-color: var(--color-steam-teal);
    color: var(--color-brass);
    box-shadow: 
        var(--shadow-depth-2),
        inset 0 1px 0 rgba(74, 124, 155, 0.4),
        inset 0 -1px 0 rgba(44, 120, 115, 0.6);
}

.btn-steampunk:hover {
    background: linear-gradient(135deg, 
        rgba(94, 144, 175, 0.95) 0%, 
        rgba(64, 140, 135, 0.95) 100%);
    box-shadow: 
        var(--shadow-depth-3),
        0 0 30px rgba(74, 124, 155, 0.6),
        inset 0 2px 0 rgba(134, 164, 195, 0.5);
}

/* Bouton compact circulaire */
.btn-icon-medieval {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(139, 69, 19, 0.9) 0%, 
        rgba(70, 40, 10, 0.95) 100%);
    border: 3px solid var(--color-bronze);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow:
        var(--shadow-depth-2),
        inset 0 2px 4px rgba(255, 215, 0, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

.btn-icon-medieval::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1px solid rgba(205, 133, 63, 0.4);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.btn-icon-medieval:hover {
    transform: scale(1.1);
    border-color: var(--color-gold-primary);
    box-shadow: 
        var(--shadow-depth-3),
        0 0 20px rgba(255, 215, 0, 0.6),
        inset 0 2px 4px rgba(255, 215, 0, 0.3);
}

.btn-icon-medieval:hover::before {
    opacity: 1;
}

.btn-icon-medieval:active {
    transform: scale(1.05);
}

/* ==================== PANNEAUX & MODALS ==================== */

/* Panel avec profondeur et relief 3D */
.panel-ornate {
    position: relative;
    background: linear-gradient(135deg, 
        var(--color-bg-dark) 0%,
        var(--color-bg-medium) 50%,
        var(--color-bg-dark) 100%);
    border: 4px solid transparent;
    border-image: var(--border-ornate-gradient) 1;
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow: 
        var(--shadow-depth-3),
        var(--metal-relief),
        0 0 30px rgba(184, 115, 51, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    clip-path: polygon(
        12px 0, calc(100% - 12px) 0,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 12px 100%,
        0 calc(100% - 12px), 0 12px
    );
    transition: all var(--transition-medium);
}

/* Effet de lueur pulsante sur le bord */
.panel-ornate::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: var(--border-ornate-gradient);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-medium);
    clip-path: polygon(
        12px 0, calc(100% - 12px) 0,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 12px 100%,
        0 calc(100% - 12px), 0 12px
    );
    filter: blur(8px);
}

.panel-ornate:hover {
    box-shadow: 
        var(--shadow-depth-4),
        var(--metal-relief-hover),
        0 0 50px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

.panel-ornate:hover::before {
    opacity: 0.6;
    animation: glow-pulse 2s ease-in-out infinite;
}

/* Engrenages décoratifs dans les coins */
.panel-ornate::after {
    content: '⚙';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.8rem;
    color: var(--color-bronze);
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.6);
    opacity: 0.4;
    animation: gearRotate 12s linear infinite;
}

/* Rivet décoratif */
.panel-ornate.with-rivets {
    position: relative;
}

.panel-ornate.with-rivets::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #B8860B, #8B4513);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.6),
        0 1px 2px rgba(255, 215, 0, 0.4);
    top: 12px;
    left: 12px;
}

/* Panel compact pour sections */
.panel-compact {
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.15) 0%,
        rgba(139, 69, 19, 0.15) 100%);
    border: 3px solid var(--color-copper);
    border-radius: 10px;
    padding: var(--spacing-lg);
    box-shadow:
        var(--shadow-depth-2),
        inset 0 1px 0 rgba(255, 215, 0, 0.2),
        inset 0 -1px 0 rgba(139, 69, 19, 0.3);
    position: relative;
    transition: all var(--transition-medium);
}

.panel-compact:hover {
    border-color: var(--color-brass);
    box-shadow:
        var(--shadow-depth-3),
        var(--metal-relief),
        0 0 20px rgba(184, 115, 51, 0.4);
    transform: translateY(-1px);
}

/* ==================== TITRES ==================== */
.title-medieval {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-gold-primary);
    text-align: center;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.9);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.title-medieval::before,
.title-medieval::after {
    content: '⚜';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--color-gold-primary);
    text-shadow: var(--shadow-glow-gold);
}

.title-medieval::before {
    left: -50px;
}

.title-medieval::after {
    right: -50px;
}

.subtitle-ornate {
    font-family: var(--font-accent);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-gold-light);
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: var(--spacing-md);
}

/* ==================== INPUTS & FORMS ==================== */
.input-medieval {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-gold-light);
    background: rgba(18, 14, 10, 0.8);
    border: 2px solid var(--color-brass);
    border-radius: 8px;
    outline: none;
    transition: all var(--transition-medium);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.input-medieval:focus {
    border-color: var(--color-gold-primary);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4);
    background: rgba(30, 15, 50, 0.9);
}

.input-medieval::placeholder {
    color: rgba(181, 166, 66, 0.5);
    font-style: italic;
}

/* ==================== CARTES & ITEMS ==================== */

/* Carte steampunk avec relief 3D et shading */
.card-steampunk {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(24, 20, 14, 0.95) 0%,
        rgba(32, 26, 18, 0.95) 50%, 
        rgba(24, 20, 14, 0.95) 100%);
    border: 3px solid transparent;
    border-image: var(--border-metal-gradient) 1;
    border-radius: 12px;
    padding: var(--spacing-lg);
    transition: all var(--transition-medium);
    box-shadow: 
        var(--shadow-depth-2),
        inset 0 1px 0 rgba(205, 127, 50, 0.2),
        inset 0 -1px 0 rgba(139, 69, 19, 0.3);
    overflow: hidden;
    clip-path: polygon(
        10px 0, calc(100% - 10px) 0,
        100% 10px, 100% calc(100% - 10px),
        calc(100% - 10px) 100%, 10px 100%,
        0 calc(100% - 10px), 0 10px
    );
}

/* Overlay de lueur au hover */
.card-steampunk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, 
        rgba(255, 215, 0, 0.15) 0%, 
        transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

/* Engrenage décoratif */
.card-steampunk::after {
    content: '⚙';
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 1.5rem;
    color: var(--color-bronze);
    opacity: 0.2;
    transition: all var(--transition-medium);
}

.card-steampunk:hover {
    border-image: var(--border-ornate-gradient) 1;
    box-shadow: 
        var(--shadow-depth-3),
        var(--metal-relief),
        0 0 30px rgba(255, 215, 0, 0.4);
    transform: translateY(-5px) scale(1.02);
}

.card-steampunk:hover::before {
    opacity: 1;
}

.card-steampunk:hover::after {
    opacity: 0.6;
    animation: gearRotate 4s linear infinite;
}

/* Carte avec effet de sélection */
.card-steampunk.selected {
    border-image: var(--border-ornate-gradient) 1;
    box-shadow: 
        var(--shadow-depth-3),
        0 0 40px rgba(255, 215, 0, 0.7),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
    animation: border-pulse 2s ease-in-out infinite;
}

/* Item slot avec profondeur */
.item-slot {
    position: relative;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg,
        rgba(18, 14, 10, 0.8) 0%,
        rgba(24, 20, 14, 0.8) 100%);
    border: 3px solid var(--color-copper);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow:
        var(--shadow-depth-1),
        inset 0 2px 4px rgba(0, 0, 0, 0.6),
        inset 0 -1px 0 rgba(184, 115, 51, 0.2);
    clip-path: polygon(
        6px 0, calc(100% - 6px) 0,
        100% 6px, 100% calc(100% - 6px),
        calc(100% - 6px) 100%, 6px 100%,
        0 calc(100% - 6px), 0 6px
    );
}

.item-slot:hover {
    border-color: var(--color-brass);
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.3) 0%,
        rgba(139, 69, 19, 0.3) 100%);
    box-shadow:
        var(--shadow-depth-2),
        0 0 20px rgba(184, 115, 51, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
    transform: scale(1.08);
}

.item-slot.filled {
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.4) 0%,
        rgba(139, 69, 19, 0.4) 100%);
    border-color: var(--color-brass);
    box-shadow:
        var(--shadow-depth-2),
        0 0 15px rgba(255, 215, 0, 0.3),
        inset 0 2px 4px rgba(255, 215, 0, 0.2);
}

.item-slot.empty {
    opacity: 0.5;
    cursor: default;
}

.item-slot.empty:hover {
    transform: none;
    border-color: var(--color-copper);
}

/* ==================== BADGES & LABELS ==================== */
.badge-ornate {
    display: inline-block;
    padding: 0.35rem 1rem;
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-gold-primary);
    background: linear-gradient(135deg, 
        rgba(44, 32, 18, 0.9) 0%, 
        rgba(40, 20, 70, 0.9) 100%);
    border: 2px solid var(--color-gold-primary);
    border-radius: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==================== SCROLLBARS PERSONNALISÉES ==================== */
.scrollbar-ornate::-webkit-scrollbar {
    width: 12px;
}

.scrollbar-ornate::-webkit-scrollbar-track {
    background: rgba(18, 14, 10, 0.6);
    border-radius: 6px;
    border: 1px solid var(--color-brass);
}

.scrollbar-ornate::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        var(--color-bronze) 0%, 
        var(--color-copper) 100%);
    border-radius: 6px;
    border: 2px solid var(--color-brass);
    box-shadow: inset 0 0 6px rgba(255, 215, 0, 0.3);
}

.scrollbar-ornate::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        var(--color-gold-dark) 0%, 
        var(--color-bronze) 100%);
    box-shadow: 
        inset 0 0 6px rgba(255, 215, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.4);
}

/* ==================== DIVIDERS ORNEMENTÉS ==================== */
.divider-ornate {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-gold-primary) 50%, 
        transparent 100%);
    margin: var(--spacing-lg) 0;
    position: relative;
}

.divider-ornate::before {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--color-gold-primary);
    background: var(--color-bg-dark);
    padding: 0 var(--spacing-md);
    text-shadow: var(--shadow-glow-gold);
}

/* ==================== TOOLTIPS ==================== */
.tooltip-medieval {
    position: absolute;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-gold-light);
    background: var(--color-bg-dark);
    border: 2px solid var(--color-gold-primary);
    border-radius: 8px;
    box-shadow: 
        var(--shadow-glow-gold),
        var(--shadow-deep);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 1000;
    white-space: nowrap;
}

/* ==================== ANIMATIONS ==================== */

/* Glow pulse effect - pour éléments importants */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.6),
            0 8px 32px rgba(0, 0, 0, 0.6),
            inset 0 1px 0 rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 0.9),
            0 12px 40px rgba(0, 0, 0, 0.7),
            inset 0 2px 0 rgba(255, 215, 0, 0.4);
    }
}

/* Float gentle - pour titres et éléments flottants */
@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shimmer effect - pour reflets métalliques */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Gear rotation - engrenages steampunk */
@keyframes gearRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse de bordure - pour éléments actifs */
@keyframes border-pulse {
    0%, 100% {
        border-color: rgba(184, 134, 11, 0.6);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        border-color: rgba(255, 215, 0, 0.9);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

/* Slide in from left - pour menus */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade in avec scale */
@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bounce subtil pour buttons */
@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Flicker effect - pour lueurs magiques */
@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    75% {
        opacity: 0.9;
    }
}

/* Steam rising - effet vapeur */
@keyframes steamRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}

/* Classes d'animation utilitaires */
.anim-glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

.anim-float {
    animation: float-gentle 3s ease-in-out infinite;
}

.anim-gear-rotate {
    animation: gearRotate 8s linear infinite;
}

.anim-gear-rotate-reverse {
    animation: gearRotate 8s linear infinite reverse;
}

.anim-border-pulse {
    animation: border-pulse 2s ease-in-out infinite;
}

.anim-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.anim-slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.anim-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.anim-fade-in-scale {
    animation: fadeInScale 0.4s ease-out;
}

.anim-flicker {
    animation: flicker 2s infinite;
}

/* ==================== UTILITAIRES ==================== */
.text-shadow-gold {
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.9);
}

.glow-gold {
    box-shadow: var(--shadow-glow-gold);
}

.glow-purple {
    box-shadow: var(--shadow-glow-purple);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ornate-corner-tl::before {
    content: '┏';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.5rem;
    color: var(--color-gold-primary);
    line-height: 1;
}

.ornate-corner-tr::after {
    content: '┓';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.5rem;
    color: var(--color-gold-primary);
    line-height: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 1.5rem;
        --spacing-xxl: 2rem;
    }
    
    .title-medieval {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    .title-medieval::before,
    .title-medieval::after {
        display: none;
    }
    
    .btn-medieval {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATED COIN CHANGE NOTIFICATION
   ═══════════════════════════════════════════════════════════════════════════ */

.coin-change-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -100px);
    opacity: 0;
    z-index: 100000;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.coin-change-notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.coin-change-notification.hide {
    transform: translate(-50%, 100px);
    opacity: 0;
}

.coin-notification-content {
    background: linear-gradient(135deg, rgba(18, 14, 10, 0.98) 0%, rgba(32, 24, 14, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 3px solid var(--color-gold-primary);
    border-radius: 20px;
    padding: 25px 35px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 215, 0, 0.3),
        inset 0 -2px 0 rgba(139, 69, 19, 0.4);
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 400px;
}

.notification-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--color-gold-dark);
}

.purchase-icon {
    animation: purchaseBounce 0.6s ease-out;
}

.sale-icon {
    animation: saleBounce 0.6s ease-out;
}

@keyframes purchaseBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(-10deg); }
}

@keyframes saleBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(10deg); }
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-gold-primary);
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 5px;
}

.notification-item {
    font-family: 'Philosopher', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.coin-animation-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 215, 0, 0.3);
}

.coin-change-arrow {
    font-size: 2.5rem;
    font-weight: bold;
    animation: arrowPulse 1s ease-in-out infinite;
}

.coin-change-arrow.increase {
    color: #22c55e;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

.coin-change-arrow.decrease {
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

.coin-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid var(--color-gold-dark);
}

.coin-icon {
    width: 35px;
    height: 35px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.coin-value {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-gold-primary);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
    min-width: 80px;
    text-align: right;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .coin-notification-content {
        min-width: 90vw;
        padding: 20px 25px;
        gap: 15px;
    }
    
    .notification-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .notification-title {
        font-size: 1.2rem;
    }
    
    .coin-change-arrow {
        font-size: 2rem;
    }
    
    .coin-value {
        font-size: 1.4rem;
        min-width: 60px;
    }

    .coin-icon {
        width: 28px;
        height: 28px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🍬 CANDY BUFF INDICATOR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper for buttons + candy indicator */
.icon-buttons-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Candy buff indicator - absolute positioned below buttons, left-aligned */
.candy-buff-indicator {
    position: absolute;
    top: 100%;
    left: -109px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.candy-buff-indicator:hover {
    transform: scale(1.1);
}

.candy-buff-indicator.hidden {
    display: none !important;
}

.candy-buff-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    object-fit: cover;
    animation: candy-glow 2s ease-in-out infinite;
}

@keyframes candy-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
    }
}

.candy-buff-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

.candy-buff-indicator:hover .candy-buff-tooltip {
    opacity: 1;
    visibility: visible;
}

.candy-buff-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255, 215, 0, 0.5);
}

.candy-buff-name {
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 4px;
}

.candy-buff-effect {
    font-size: 11px;
    color: #a0ffa0;
    margin-bottom: 4px;
}

.candy-buff-timer {
    font-size: 10px;
    color: #aaa;
}

/* ==================== CUSTOM CURSOR - Little Monster Hand ==================== */
/* Replaces the default browser cursor with the Little Monster red hand cursor.
   cursoropen-32.png   = default (idle / hovering)  — 32x32
   cursorslected-32.png = mousedown / active / clicking — 32x32
   Hotspot at (5, 2) — near the fingertip of the 32px hand. */

*, *::before, *::after {
    cursor: url('/shared_assets/images/icons/cursoropen-32.png') 5 2, auto !important;
}

*:active {
    cursor: url('/shared_assets/images/icons/cursorslected-32.png') 5 2, auto !important;
}

/* Interactive elements also use the open hand (not the browser "pointer") */
a, button, [role="button"], input[type="submit"], input[type="button"],
select, label[for], .clickable, [onclick], summary {
    cursor: url('/shared_assets/images/icons/cursoropen-32.png') 5 2, auto !important;
}

a:active, button:active, [role="button"]:active, input[type="submit"]:active,
input[type="button"]:active, select:active, .clickable:active, [onclick]:active {
    cursor: url('/shared_assets/images/icons/cursorslected-32.png') 5 2, auto !important;
}